/* -------------------------------------------------------------
   Global Variables & Color Palette
   ------------------------------------------------------------- */
:root {
  --font-main: 'Hind Siliguri', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Theme Colors */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-surface: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;

  /* Brand Accents */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;

  /* Risk Matrix Colors */
  --safe-color: #22c55e;
  --safe-bg: #f0fdf4;
  --safe-border: #bbf7d0;

  --medium-color: #eab308;
  --medium-bg: #fefce8;
  --medium-border: #fef08a;

  --high-color: #ef4444;
  --high-bg: #fef2f2;
  --high-border: #fecaca;

  --new-color: #6b7280;
  --new-bg: #f3f4f6;
  --new-border: #e5e7eb;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --radius-lg: 14px;
  --radius-md: 10px;
}

/* Dark Theme */
body.dark-mode {
  --bg-body: #0b0f19;
  --bg-card: #131b2e;
  --bg-surface: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #26334d;
  --primary-light: #1e293b;

  --safe-bg: rgba(34, 197, 94, 0.12);
  --safe-border: rgba(34, 197, 94, 0.3);

  --medium-bg: rgba(234, 179, 8, 0.12);
  --medium-border: rgba(234, 179, 8, 0.3);

  --high-bg: rgba(239, 68, 68, 0.12);
  --high-border: rgba(239, 68, 68, 0.3);

  --new-bg: rgba(107, 114, 128, 0.15);
  --new-border: rgba(107, 114, 128, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s, color 0.25s;
}

/* -------------------------------------------------------------
   Header
   ------------------------------------------------------------- */
.app-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(12px);
}

.header-container {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.jhinuk-brand-logo {
  height: 48px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
  transition: transform 0.2s ease;
}

.jhinuk-brand-logo:hover {
  transform: scale(1.04);
}

body.dark-mode .jhinuk-brand-logo {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  padding: 3px 6px;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.brand-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* User Profile Chip */
.user-profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.8rem;
  border-radius: 30px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.user-chip-avatar {
  font-size: 0.95rem;
}

.user-chip-name {
  color: var(--text-main);
}

.user-chip-expiry {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.12);
  padding: 0.15rem 0.45rem;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
}

/* Admin Nav Button */
.btn-nav-admin {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.12);
  color: #3b82f6;
  border: 1px solid rgba(37, 99, 235, 0.3);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-nav-admin:hover {
  background: var(--primary);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Logout Button */
.btn-nav-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.28);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-nav-logout:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.badge-status .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--safe-color);
  box-shadow: 0 0 8px var(--safe-color);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.9); }
}

.btn-theme-toggle {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-theme-toggle:hover {
  background: var(--border-color);
  transform: scale(1.05);
}

/* -------------------------------------------------------------
   Main Layout & Search Section
   ------------------------------------------------------------- */
.main-content {
  max-width: 1120px;
  margin: 1.75rem auto;
  padding: 0 1rem;
  flex: 1;
  width: 100%;
}

.search-section {
  margin-bottom: 1.75rem;
}

.search-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 2rem;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

.search-title-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.search-badge-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.search-title h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.search-title p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

/* Modern Unified Search Form */
.search-form {
  display: flex;
  gap: 0.85rem;
  align-items: stretch;
  width: 100%;
}

.input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: 14px;
  height: 58px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.input-wrapper:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18), inset 0 2px 4px rgba(0, 0, 0, 0.03);
  background: var(--bg-card);
}

.country-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 1rem;
  height: 100%;
  border-right: 1.5px solid var(--border-color);
  user-select: none;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.02);
}

body.dark-mode .country-badge {
  background: rgba(255, 255, 255, 0.02);
}

.country-flag {
  font-size: 1.15rem;
}

.country-code {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.input-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 0 1rem;
  font-size: 1.25rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.06em;
  min-width: 0;
}

.input-wrapper input::placeholder {
  font-family: var(--font-main);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: normal;
  color: var(--text-muted);
  opacity: 0.75;
}

.clear-input-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 0.85rem;
  font-size: 1.15rem;
  display: none;
  transition: color 0.15s;
}

.clear-input-btn:hover {
  color: var(--high-color);
}

.clear-input-btn.visible {
  display: block;
}

.input-shortcut-hint {
  padding-right: 1rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: transparent;
  border-radius: 4px;
  user-select: none;
  pointer-events: none;
  display: block;
}

@media (max-width: 640px) {
  .input-shortcut-hint {
    display: none;
  }
}

.btn-search {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 0 2rem;
  height: 58px;
  font-family: var(--font-main);
  font-size: 1.08rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: 0 6px 20px -2px rgba(37, 99, 235, 0.4);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-search:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -2px rgba(37, 99, 235, 0.55);
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.btn-search:active {
  transform: translateY(0);
}

.btn-search .btn-icon {
  font-size: 1.15rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Presets Bar */
.presets-bar {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.presets-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  user-select: none;
}

.preset-pills-list {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.preset-pill {
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.preset-pill .pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.preset-pill .safe-dot { background-color: var(--safe-color); box-shadow: 0 0 6px var(--safe-color); }
.preset-pill .medium-dot { background-color: var(--medium-color); box-shadow: 0 0 6px var(--medium-color); }
.preset-pill .high-dot { background-color: var(--high-color); box-shadow: 0 0 6px var(--high-color); }
.preset-pill .new-dot { background-color: var(--new-color); box-shadow: 0 0 6px var(--new-color); }

.preset-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  background: var(--bg-card);
}

.preset-pill.safe:hover { border-color: var(--safe-color); color: var(--safe-color); }
.preset-pill.medium:hover { border-color: var(--medium-color); color: var(--medium-color); }
.preset-pill.high:hover { border-color: var(--high-color); color: var(--high-color); }
.preset-pill.new:hover { border-color: var(--new-color); color: var(--text-main); }

.error-banner {
  margin-top: 1.25rem;
  padding: 0.9rem 1.1rem;
  background: var(--high-bg);
  border: 1px solid var(--high-border);
  color: var(--high-color);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
}

/* -------------------------------------------------------------
   Loading Section
   ------------------------------------------------------------- */
.loading-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-section p {
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.loader-timer {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* -------------------------------------------------------------
   Summary Hero Card & Verification Stamp (স্ট্যাম্প)
   ------------------------------------------------------------- */
.summary-hero-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.summary-hero-card.SAFE {
  border-color: var(--safe-border);
  background: linear-gradient(135deg, var(--bg-card) 60%, var(--safe-bg));
}

.summary-hero-card.MEDIUM_RISK {
  border-color: var(--medium-border);
  background: linear-gradient(135deg, var(--bg-card) 60%, var(--medium-bg));
}

.summary-hero-card.HIGH_RISK {
  border-color: var(--high-border);
  background: linear-gradient(135deg, var(--bg-card) 60%, var(--high-bg));
}

.summary-hero-card.NEW_CUSTOMER {
  border-color: var(--new-border);
  background: linear-gradient(135deg, var(--bg-card) 60%, var(--new-bg));
}

.hero-left {
  flex: 1;
  min-width: 300px;
}

.customer-info-tag {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.customer-info-tag .tag-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.customer-info-tag .tag-phone {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-main);
  letter-spacing: 0.05em;
}

.customer-info-tag .tag-source {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.risk-badge-large {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.risk-badge-large .risk-emoji {
  font-size: 2.2rem;
  line-height: 1;
}

.risk-details .risk-title {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-family: var(--font-mono);
}

.risk-details .risk-subtitle {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
}

.recommendation-box {
  background: var(--bg-surface);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.recommendation-box .rec-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.recommendation-box p {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.45;
}

/* -------------------------------------------------------------
   THE OFFICIAL VERIFICATION STAMP (কুরিয়ার ফ্রড ভেরিফিকেশন স্ট্যাম্প)
   ------------------------------------------------------------- */
.hero-right {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stamp-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.verification-stamp {
  width: 175px;
  height: 175px;
  border-radius: 50%;
  border: 4px dashed var(--safe-color);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-6deg);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
  user-select: none;
  position: relative;
}

.verification-stamp:hover {
  transform: rotate(0deg) scale(1.05);
}

.stamp-inner-border {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--safe-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(4px);
}

.stamp-mini-logo {
  width: 26px;
  height: auto;
  object-fit: contain;
  margin-bottom: 2px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

body.dark-mode .stamp-inner-border {
  background: rgba(19, 27, 46, 0.7);
}

.stamp-org {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--safe-color);
  font-family: var(--font-mono);
  margin-bottom: 2px;
}

.stamp-status-bold {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--safe-color);
  line-height: 1.1;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.stamp-rate {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--safe-color);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.stamp-date {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.stamp-stars {
  font-size: 0.65rem;
  color: var(--safe-color);
  letter-spacing: 2px;
  margin-top: 2px;
}

/* Stamp Variations */
.verification-stamp.SAFE {
  border-color: var(--safe-color);
}
.verification-stamp.SAFE .stamp-inner-border {
  border-color: var(--safe-color);
}
.verification-stamp.SAFE .stamp-org,
.verification-stamp.SAFE .stamp-status-bold,
.verification-stamp.SAFE .stamp-rate,
.verification-stamp.SAFE .stamp-stars {
  color: var(--safe-color);
}

.verification-stamp.MEDIUM_RISK {
  border-color: var(--medium-color);
}
.verification-stamp.MEDIUM_RISK .stamp-inner-border {
  border-color: var(--medium-color);
}
.verification-stamp.MEDIUM_RISK .stamp-org,
.verification-stamp.MEDIUM_RISK .stamp-status-bold,
.verification-stamp.MEDIUM_RISK .stamp-rate,
.verification-stamp.MEDIUM_RISK .stamp-stars {
  color: var(--medium-color);
}

.verification-stamp.HIGH_RISK {
  border-color: var(--high-color);
}
.verification-stamp.HIGH_RISK .stamp-inner-border {
  border-color: var(--high-color);
}
.verification-stamp.HIGH_RISK .stamp-org,
.verification-stamp.HIGH_RISK .stamp-status-bold,
.verification-stamp.HIGH_RISK .stamp-rate,
.verification-stamp.HIGH_RISK .stamp-stars {
  color: var(--high-color);
}

.verification-stamp.NEW_CUSTOMER {
  border-color: var(--new-color);
}
.verification-stamp.NEW_CUSTOMER .stamp-inner-border {
  border-color: var(--new-color);
}
.verification-stamp.NEW_CUSTOMER .stamp-org,
.verification-stamp.NEW_CUSTOMER .stamp-status-bold,
.verification-stamp.NEW_CUSTOMER .stamp-rate,
.verification-stamp.NEW_CUSTOMER .stamp-stars {
  color: var(--new-color);
}

.btn-stamp-action {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.btn-stamp-action:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* -------------------------------------------------------------
   Metrics 4-Card Grid
   ------------------------------------------------------------- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.metric-icon {
  font-size: 1.8rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border-radius: 12px;
}

.metric-data {
  display: flex;
  flex-direction: column;
}

.metric-value {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1.1;
  color: var(--text-main);
}

.metric-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* -------------------------------------------------------------
   Courier Breakdown Section
   ------------------------------------------------------------- */
.breakdown-section {
  margin-bottom: 1.5rem;
}

.breakdown-heading {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.courier-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
}

.courier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
}

.courier-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.courier-logo-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: #fff;
}

.steadfast-bg {
  background: linear-gradient(135deg, #0284c7, #0369a1);
}

.pathao-bg {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.courier-info h4 {
  font-size: 1.05rem;
  font-weight: 700;
}

.courier-status-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.courier-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--new-color);
}

.courier-indicator.active {
  background-color: var(--safe-color);
  box-shadow: 0 0 6px var(--safe-color);
}

.courier-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.courier-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

.courier-row strong {
  font-family: var(--font-mono);
  font-size: 1.05rem;
}

.text-success {
  color: var(--safe-color);
}

.text-danger {
  color: var(--high-color);
}

.courier-rate-bar {
  margin-top: 0.4rem;
}

.rate-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-surface);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* -------------------------------------------------------------
   Recent Searches History
   ------------------------------------------------------------- */
.history-section {
  margin-bottom: 2.5rem;
}

.history-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.12);
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.15rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.history-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.history-icon-badge {
  font-size: 1.15rem;
}

.history-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.btn-clear-history {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s;
}

.btn-clear-history:hover {
  background: var(--high-bg);
  color: var(--high-color);
  border-color: var(--high-border);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.15rem;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.history-item:hover {
  border-color: #3b82f6;
  background: var(--bg-card);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.history-item-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.history-phone-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.history-phone-icon {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.history-phone {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--text-main);
}

.history-badge {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  display: inline-block;
}

.history-badge.SAFE {
  background: var(--safe-bg);
  color: var(--safe-color);
  border: 1px solid var(--safe-border);
}

.history-badge.MEDIUM_RISK {
  background: var(--medium-bg);
  color: var(--medium-color);
  border: 1px solid var(--medium-border);
}

.history-badge.HIGH_RISK {
  background: var(--high-bg);
  color: var(--high-color);
  border: 1px solid var(--high-border);
}

.history-badge.NEW_CUSTOMER {
  background: var(--new-bg);
  color: var(--text-muted);
  border: 1px solid var(--new-border);
}

.history-item-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.history-rate-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.03);
}

body.dark-mode .history-rate-chip {
  background: rgba(255, 255, 255, 0.05);
}

.history-rate-chip.rate-high .rate-val { color: var(--safe-color); font-weight: 800; }
.history-rate-chip.rate-mid .rate-val { color: var(--medium-color); font-weight: 800; }
.history-rate-chip.rate-low .rate-val { color: var(--high-color); font-weight: 800; }
.history-rate-chip .rate-sub { color: var(--text-muted); font-size: 0.78rem; font-family: var(--font-main); }

.history-time {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.history-recheck-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--primary);
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.15s;
}

.history-item:hover .history-recheck-btn {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.empty-history {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 1.5rem 0;
}

/* -------------------------------------------------------------
   Toast Notification & Footer
   ------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #0f172a;
  color: #ffffff;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 999;
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}

.hidden {
  display: none !important;
}

/* -------------------------------------------------------------
   Comprehensive Mobile & Responsive Media Queries
   ------------------------------------------------------------- */
@media (max-width: 860px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }
  .header-status {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .main-content {
    margin: 1rem auto;
    padding: 0 0.75rem;
  }
  .search-card {
    padding: 1.25rem;
    border-radius: 14px;
  }
  .search-form {
    flex-direction: column;
    gap: 0.75rem;
  }
  .input-wrapper {
    height: 52px;
    width: 100%;
  }
  .btn-search {
    width: 100%;
    height: 52px;
  }
  .summary-hero-card {
    flex-direction: column;
    text-align: center;
  }
  .hero-left {
    min-width: 100%;
  }
  .customer-info-tag {
    justify-content: center;
  }
  .risk-badge-large {
    justify-content: center;
  }
  .recommendation-box {
    text-align: left;
  }
  .verification-stamp {
    transform: rotate(0deg);
  }
  .history-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }
  .history-item-right {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  .brand-text h1 {
    font-size: 1.1rem;
  }
  .brand-text p {
    font-size: 0.75rem;
  }
  .country-badge {
    padding: 0 0.65rem;
  }
  .input-wrapper input {
    font-size: 1.1rem;
    padding: 0 0.65rem;
  }
  .presets-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .preset-pills-list {
    width: 100%;
  }
  .preset-pill {
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
  }
}

