/* ============================================================
   style.css — Custom Styles for Portal Supplier KDMP
   ============================================================ */

/* ─── Variables ─────────────────────────────────────────────── */
:root {
  --kdmp-red:        #C62828;
  --kdmp-red-dark:   #8E0000;
  --kdmp-red-light:  #EF5350;
  --kdmp-red-pale:   #FFEBEE;
  --kdmp-white:      #FFFFFF;
  --kdmp-gold:       #F9A825;
  --kdmp-gold-pale:  #FFF8E1;
  --kdmp-dark:       #1C1C2E;
  --kdmp-gray:       #6B7280;
  --kdmp-light:      #F8F9FA;
  --shadow-sm:       0 2px 8px rgba(0,0,0,.08);
  --shadow-md:       0 4px 20px rgba(0,0,0,.12);
  --shadow-lg:       0 8px 40px rgba(0,0,0,.18);
  --radius:          12px;
  --radius-sm:       8px;
  --radius-lg:       20px;
  --transition:      .22s ease;
}

/* ─── Base ───────────────────────────────────────────────────── */
* { box-sizing: border-box; }
body {
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  color: #2D2D2D;
  background: #F6F7FB;
  line-height: 1.65;
}
h1,h2,h3,h4,h5,h6 { font-weight: 700; }
a { color: var(--kdmp-red); text-decoration: none; }
a:hover { color: var(--kdmp-red-dark); text-decoration: none; }
.hover-white:hover { color: #fff !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }

/* ─── Navbar ─────────────────────────────────────────────────── */
.bg-primary-kdmp { background: linear-gradient(135deg, var(--kdmp-red-dark) 0%, var(--kdmp-red) 100%) !important; }
.navbar-dark .nav-link { font-size: 13.5px; font-weight: 500; border-radius: 6px; padding: 6px 10px !important; transition: background var(--transition); }
.navbar-dark .nav-link:hover,
.navbar-dark .nav-link.active { background: rgba(255,255,255,.15); }
.navbar-dark .nav-link.active { font-weight: 600; }

/* ─── Avatar ─────────────────────────────────────────────────── */
.avatar-sm {
  width: 28px; height: 28px;
  background: var(--kdmp-gold);
  color: var(--kdmp-dark);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
}
.avatar-md {
  width: 48px; height: 48px;
  background: var(--kdmp-red-pale);
  color: var(--kdmp-red);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px;
}
.avatar-lg {
  width: 72px; height: 72px;
  background: var(--kdmp-red-pale);
  color: var(--kdmp-red);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 28px;
}

/* ─── Cards ──────────────────────────────────────────────────── */
.card { border: none; border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: box-shadow var(--transition), transform var(--transition); }
.card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.card-header { background: transparent; border-bottom: 1px solid rgba(0,0,0,.06); font-weight: 600; }
.card-footer { background: transparent; border-top: 1px solid rgba(0,0,0,.06); }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn { border-radius: 8px; font-weight: 600; font-size: 13.5px; transition: all var(--transition); }
.btn-kdmp, .btn-primary {
  background: linear-gradient(135deg, var(--kdmp-red) 0%, var(--kdmp-red-dark) 100%);
  border: none; color: #fff;
}
.btn-kdmp:hover, .btn-primary:hover { background: var(--kdmp-red-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(198,40,40,.35); }
.btn-outline-kdmp { border: 2px solid var(--kdmp-red); color: var(--kdmp-red); background: transparent; }
.btn-outline-kdmp:hover { background: var(--kdmp-red); color: #fff; }
.btn-gold { background: var(--kdmp-gold); color: var(--kdmp-dark); border: none; }
.btn-gold:hover { background: #E65100; color: #fff; }
.btn-lg { padding: 12px 28px; font-size: 15px; border-radius: 10px; }
.btn-xl { padding: 14px 36px; font-size: 17px; border-radius: 12px; }

/* ─── Badge ──────────────────────────────────────────────────── */
.badge { border-radius: 6px; font-weight: 600; font-size: 11px; }

/* ─── Hero Section ───────────────────────────────────────────── */
.hero-section {
  background: linear-gradient(135deg, var(--kdmp-red-dark) 0%, var(--kdmp-red) 50%, #B71C1C 100%);
  color: #fff;
  padding: 80px 0 60px;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 600px; height: 600px;
  background: rgba(255,255,255,.05);
  border-radius: 50%;
}
.hero-section::after {
  content: '';
  position: absolute;
  bottom: -30%; left: -10%;
  width: 400px; height: 400px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
}
.hero-section .hero-tag {
  display: inline-block;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 30px;
  padding: 5px 18px;
  font-size: 13px;
  margin-bottom: 16px;
}
.hero-section h1 { font-size: clamp(26px, 5vw, 52px); font-weight: 800; line-height: 1.2; }
.hero-section .lead { font-size: 16px; opacity: .9; }

/* ─── Stats Strip ────────────────────────────────────────────── */
.stats-strip { background: #fff; border-bottom: 3px solid var(--kdmp-red); }
.stat-item { padding: 20px 15px; text-align: center; }
.stat-item .stat-num { font-size: 28px; font-weight: 800; color: var(--kdmp-red); line-height: 1; }
.stat-item .stat-label { font-size: 12px; color: var(--kdmp-gray); }

/* ─── Section Titles ─────────────────────────────────────────── */
.section-title { font-size: clamp(20px, 3vw, 32px); font-weight: 800; }
.section-subtitle { color: var(--kdmp-gray); font-size: 15px; }
.text-kdmp { color: var(--kdmp-red) !important; }
.section-badge {
  display: inline-block;
  background: var(--kdmp-red-pale);
  color: var(--kdmp-red);
  border-radius: 30px;
  padding: 4px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* ─── Category Cards ─────────────────────────────────────────── */
.cat-card {
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  background: #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
  text-decoration: none;
  color: inherit;
  display: block;
}
.cat-card:hover { border-color: var(--kdmp-red); box-shadow: var(--shadow-md); transform: translateY(-3px); color: var(--kdmp-red); }
.cat-card .cat-icon {
  width: 52px; height: 52px;
  background: var(--kdmp-red-pale);
  color: var(--kdmp-red);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin: 0 auto 10px;
}
.cat-card .cat-name { font-weight: 600; font-size: 13px; }
.cat-card .cat-count { font-size: 11px; color: var(--kdmp-gray); }

/* ─── Product Cards ──────────────────────────────────────────── */
.product-card { border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); transition: all var(--transition); display: flex; flex-direction: column; height: 100%; }
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.product-card .product-img {
  width: 100%; height: 180px; object-fit: cover;
  background: var(--kdmp-red-pale);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; color: var(--kdmp-red);
}
.product-card .product-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-card .product-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.product-card .product-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; line-height: 1.4; }
.product-card .product-price { font-weight: 700; color: var(--kdmp-red); font-size: 15px; }
.product-card .product-unit { font-size: 11px; color: var(--kdmp-gray); }
.product-card .product-supplier { font-size: 11px; color: var(--kdmp-gray); margin-top: 4px; }
.product-card .product-footer { padding: 10px 14px; border-top: 1px solid #f0f0f0; }

/* ─── Supplier Cards ─────────────────────────────────────────── */
.supplier-card { border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); transition: all var(--transition); height: 100%; }
.supplier-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.supplier-card .sup-logo {
  width: 64px; height: 64px;
  border-radius: var(--radius-sm);
  background: var(--kdmp-red-pale);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; color: var(--kdmp-red);
  flex-shrink: 0;
}
.verified-badge { color: #1565C0; font-size: 14px; }

/* ─── Order Status ───────────────────────────────────────────── */
.order-timeline { position: relative; padding-left: 30px; }
.order-timeline::before { content: ''; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: #e0e0e0; }
.timeline-item { position: relative; padding-bottom: 22px; }
.timeline-item::before {
  content: ''; position: absolute; left: -24px; top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%; background: #ccc; border: 2px solid #fff;
}
.timeline-item.active::before { background: var(--kdmp-red); }
.timeline-item.done::before { background: #43A047; }

/* ─── Chat / Negotiation ─────────────────────────────────────── */
.chat-container { max-height: 450px; overflow-y: auto; padding: 16px; background: #F8F9FA; border-radius: var(--radius); }
.chat-msg { margin-bottom: 14px; }
.chat-msg .bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  position: relative;
}
.bubble-mine { background: var(--kdmp-red); color: #fff; border-bottom-right-radius: 4px; margin-left: auto; }
.bubble-other { background: #fff; border: 1px solid #e5e5e5; color: var(--kdmp-dark); border-bottom-left-radius: 4px; }
.bubble-offer { background: var(--kdmp-gold-pale); border: 1px solid var(--kdmp-gold); color: var(--kdmp-dark); }
.chat-time { font-size: 10px; color: rgba(255,255,255,.65); margin-top: 4px; }
.chat-time-other { font-size: 10px; color: var(--kdmp-gray); margin-top: 4px; }

/* ─── Form Styles ────────────────────────────────────────────── */
.form-control, .form-select { border-radius: var(--radius-sm); border: 1.5px solid #E0E0E0; font-size: 14px; padding: 10px 14px; transition: border-color var(--transition), box-shadow var(--transition); }
.form-control:focus, .form-select:focus { border-color: var(--kdmp-red); box-shadow: 0 0 0 3px rgba(198,40,40,.12); outline: none; }
.form-label { font-weight: 600; font-size: 13px; color: #444; margin-bottom: 5px; }
.form-text { font-size: 11px; color: var(--kdmp-gray); }
.input-group-text { background: var(--kdmp-red-pale); border-color: #E0E0E0; color: var(--kdmp-red); font-weight: 600; }

/* ─── Auth Pages ─────────────────────────────────────────────── */
.auth-page { min-height: 100vh; background: linear-gradient(135deg, var(--kdmp-red-dark) 0%, var(--kdmp-red) 100%); }
.auth-card { border-radius: var(--radius-lg); max-width: 460px; width: 100%; }
.auth-divider { position: relative; text-align: center; margin: 16px 0; }
.auth-divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: #E0E0E0; }
.auth-divider span { background: #fff; padding: 0 12px; font-size: 12px; color: var(--kdmp-gray); position: relative; }
.btn-google { background: #fff; border: 1.5px solid #dadce0; color: #3c4043; font-weight: 500; }
.btn-google:hover { background: #f8f9fa; color: #202124; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.btn-wa { background: #25D366; border: none; color: #fff; }
.btn-wa:hover { background: #1EBE57; color: #fff; }

/* ─── Dashboard ──────────────────────────────────────────────── */
.dash-sidebar {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 12px;
  height: fit-content;
  position: sticky;
  top: 76px;
}
.dash-sidebar .sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px; font-weight: 500;
  color: #444;
  text-decoration: none;
  transition: all var(--transition);
  margin-bottom: 2px;
}
.dash-sidebar .sidebar-link:hover { background: var(--kdmp-red-pale); color: var(--kdmp-red); }
.dash-sidebar .sidebar-link.active { background: var(--kdmp-red); color: #fff !important; font-weight: 600; }
.dash-sidebar .sidebar-link i { font-size: 16px; width: 20px; }

.stat-card { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 16px; }
.stat-card .sc-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-card .sc-num { font-size: 26px; font-weight: 800; line-height: 1; }
.stat-card .sc-label { font-size: 12px; color: var(--kdmp-gray); margin-top: 2px; }

/* ─── Tables ─────────────────────────────────────────────────── */
.table { font-size: 13.5px; }
.table th { font-weight: 600; color: #555; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.table-hover tbody tr:hover { background-color: var(--kdmp-red-pale); }

/* ─── Footer ─────────────────────────────────────────────────── */
.footer-kdmp { background: linear-gradient(135deg, var(--kdmp-dark) 0%, #2D0000 100%); }
.border-white-10 { border-color: rgba(255,255,255,.1) !important; }

/* ─── Misc ───────────────────────────────────────────────────── */
.bg-kdmp { background: var(--kdmp-red) !important; }
.bg-kdmp-pale { background: var(--kdmp-red-pale) !important; }
.text-gold { color: var(--kdmp-gold) !important; }
.rounded-kdmp { border-radius: var(--radius) !important; }
.shadow-kdmp { box-shadow: var(--shadow-md) !important; }
.divider-red { border: none; border-top: 3px solid var(--kdmp-red); width: 60px; margin: 12px 0; }

/* ─── Hero Role Cards ────────────────────────────────────────── */
.role-card { border: 2px solid #E0E0E0; border-radius: var(--radius); padding: 24px; cursor: pointer; transition: all var(--transition); text-align: center; background: #fff; }
.role-card:hover, .role-card.selected { border-color: var(--kdmp-red); background: var(--kdmp-red-pale); }
.role-card .role-icon { font-size: 36px; color: var(--kdmp-red); margin-bottom: 10px; }

/* ─── Responsive Tweaks ──────────────────────────────────────── */
@media (max-width: 768px) {
  .hero-section { padding: 50px 0 40px; }
  .stat-item .stat-num { font-size: 22px; }
  .dash-sidebar { display: none !important; }
  .product-card .product-img { height: 150px; }
  .chat-container { max-height: 300px; }
}

/* ─── Utilities ──────────────────────────────────────────────── */
.img-cover { width: 100%; height: 100%; object-fit: cover; }
.transition { transition: all var(--transition); }
.cursor-pointer { cursor: pointer; }
.text-12 { font-size: 12px !important; }
.text-13 { font-size: 13px !important; }
.text-15 { font-size: 15px !important; }

/* ─── Loading / Spinner ──────────────────────────────────────── */
.btn:disabled { opacity: .65; cursor: not-allowed; }
.spinner-border-sm { width: 14px; height: 14px; }

/* ─── OTP Input ──────────────────────────────────────────────── */
.otp-input { width: 44px !important; height: 52px; text-align: center; font-size: 22px; font-weight: 700; border-radius: 8px; border: 2px solid #E0E0E0; transition: border-color var(--transition); }
.otp-input:focus { border-color: var(--kdmp-red); box-shadow: 0 0 0 3px rgba(198,40,40,.12); }

/* ─── Tag Pills ──────────────────────────────────────────────── */
.tag-pill { display: inline-block; background: var(--kdmp-red-pale); color: var(--kdmp-red); border-radius: 20px; padding: 3px 12px; font-size: 12px; font-weight: 600; margin: 2px; }

/* ─── Print ──────────────────────────────────────────────────── */
@media print {
  .navbar, .footer-kdmp, .btn, .no-print { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
