/* ============================================================
   MAA!DD - Professional Corporate SaaS Theme
   Palette: Slate & Corporate Blue
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --pro-primary: #0F172A;
  --pro-secondary: #334155;
  --pro-accent: #2563EB;
  --pro-accent-hover: #1D4ED8;
  --pro-bg: #F8FAFC;
  --pro-surface: #FFFFFF;
  --pro-border: #E2E8F0;
  --pro-text: #1E293B;
  --pro-muted: #64748B;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body {
  background-color: var(--pro-bg);
  font-family: 'Inter', sans-serif;
  color: var(--pro-text);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand {
  font-weight: 800;
  color: var(--pro-primary);
  letter-spacing: -0.02em;
}

.text-accent {
  color: var(--pro-accent) !important;
}

.bg-primary-custom {
  background-color: var(--pro-primary) !important;
}

.bg-surface {
  background-color: var(--pro-surface) !important;
}

.navbar-custom {
  background-color: var(--pro-surface);
  border-bottom: 1px solid var(--pro-border);
  padding: 1rem 0;
}

.navbar-brand {
  font-size: 1.5rem;
}

.nav-link {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--pro-secondary) !important;
  transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--pro-accent) !important;
}

.btn-agency {
  background-color: var(--pro-accent);
  color: var(--pro-surface);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.5rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-agency:hover {
  background-color: var(--pro-accent-hover);
  color: var(--pro-surface);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-outline-agency {
  background-color: transparent;
  color: var(--pro-secondary);
  border: 1px solid var(--pro-border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.5rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-outline-agency:hover {
  background-color: var(--pro-bg);
  color: var(--pro-primary);
}

.card-premium {
  background-color: var(--pro-surface);
  border: 1px solid var(--pro-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 2rem;
  transition: box-shadow 0.3s ease;
}

.card-premium:hover {
  box-shadow: var(--shadow-md);
}

.form-control,
.form-select {
  border-radius: var(--radius-sm);
  border: 1px solid var(--pro-border);
  background-color: var(--pro-surface);
  color: var(--pro-text);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--pro-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--pro-secondary);
  margin-bottom: 0.5rem;
}

.upload-zone {
  border: 2px dashed var(--pro-border);
  border-radius: var(--radius-md);
  background-color: var(--pro-bg);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.upload-zone:hover {
  border-color: var(--pro-accent);
  background-color: #EFF6FF;
}

.upload-zone input[type="file"] {
  display: none;
}

.upload-zone i {
  font-size: 2rem;
  color: var(--pro-muted);
  margin-bottom: 0.5rem;
}

.status-badge,
.status-pill {
  padding: 0.4rem 0.8rem;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
}

.status-pending,
.status-pill.pending {
  background-color: #FEF3C7;
  color: #D97706;
}

.status-verified,
.status-pill.verified {
  background-color: #D1FAE5;
  color: #059669;
}

.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background-color: var(--pro-surface);
  border-right: 1px solid var(--pro-border);
  padding: 1.5rem;
}

.main-content {
  flex: 1;
  padding: 2rem;
  background-color: var(--pro-bg);
}

#campaign-info h2 {
  font-size: 2rem;
  color: #333;
}

#campaign-info ul li {
  margin-bottom: 10px;
}

.driver-btn {
  background-color: #007bff;
  color: #fff;
}

.advertiser-btn {
  background-color: #28a745;
  color: #fff;
}

.driver-btn:hover,
.advertiser-btn:hover {
  opacity: 0.9;
}

.footer {
  background: linear-gradient(135deg, var(--pro-primary) 0%, #1E293B 100%);
  border-top: 1px solid var(--pro-secondary);
}

.footer h4,
.footer h5 {
  color: #F8FAFC;
}

.footer p.small {
  color: #94A3B8;
}

.footer a {
  text-decoration: none;
  color: #CBD5E1 !important;
  transition: all 0.2s ease;
}

.footer a:hover {
  text-decoration: none;
  color: #38BDF8 !important;
  /* highlight corporate blue */
  transform: translateX(2px);
  display: inline-block;
}

/* Password Toggle Overrides */
.toggle-password {
  cursor: pointer;
  background-color: var(--pro-surface);
  border: 1px solid var(--pro-border);
  border-left: none;
  color: var(--pro-muted);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.form-control.password-input {
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

/* Fix focus rings for input group */
.input-group:focus-within .password-input,
.input-group:focus-within .toggle-password {
  border-color: var(--pro-accent);
}

.input-group:focus-within .password-input {
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.1);
}

/* Highlight active tab */
.nav-pills .nav-link.active {
  background-color: #0d6efd !important;
  /* Blue for driver */
  color: #fff !important;
}

.nav-pills .nav-link.active[data-role="advertiser"] {
  background-color: #198754 !important;
  /* Green for advertiser */
  color: #fff !important;
}

/* ============================================================
   Mobile Responsiveness Overrides
   ============================================================ */
@media (max-width: 768px) {

  /* 1. Typography Scaling */
  .display-4 {
    font-size: 2.2rem;
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  h4 {
    font-size: 1.1rem;
  }

  .lead {
    font-size: 1rem;
  }

  /* 2. Padding Reduction */
  .py-5 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  .my-5 {
    margin-top: 2rem !important;
    margin-bottom: 2rem !important;
  }

  .p-5 {
    padding: 1.5rem !important;
  }

  .card-premium {
    padding: 1.25rem;
  }

  /* 3. Full-width Tap Targets */
  .btn {
    width: 100%;
    margin-bottom: 0.5rem;
    padding: 0.75rem 1rem;
  }

  /* Don't force 100% on navbar or specific small buttons */
  .navbar .btn,
  .input-group .btn,
  .btn-sm {
    width: auto;
  }

  /* 4. Layout Adjustments */
  .d-flex.gap-3:not(.navbar .d-flex.gap-3) {
    flex-direction: column;
    gap: 0.5rem !important;
  }

  .navbar .d-flex {
    flex-direction: row;
    /* Force horizontal in navbar */
    gap: 0.5rem !important;
  }

  .profile-header-row {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .profile-header-row .col-auto {
    margin-top: 0.5rem;
  }

  .navbar-brand {
    font-size: 1.15rem;
    /* Shrink logo slightly to prevent squishing */
  }

  .status-badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.6rem;
  }

  /* 5. Form Elements */
  .form-control,
  .form-select {
    font-size: 16px;
    /* Prevents iOS auto-zoom */
  }

  .upload-zone {
    padding: 1rem;
    min-height: auto;
  }

  /* 6. Footer Stack Formatting */
  .footer .row>div {
    text-align: center;
    margin-bottom: 2rem;
  }

  .footer .d-flex.gap-3 {
    justify-content: center;
    flex-direction: row;
    /* keep social icons in a row */
  }

  #driver-summary-info {
    border-right: none !important;
    padding-right: 0 !important;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }
}

/* --- Tracking Pulse Indicator --- */
.pulse-icon {
  display: inline-block;
  width: 10px;
  height: 10px;
  background-color: #64748b;
  border-radius: 50%;
  position: relative;
  transition: background-color 0.3s ease;
}

.pulse-icon.active {
  background-color: #198754;
}

.pulse-icon.active::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-color: #198754;
  border-radius: 50%;
  z-index: -1;
  animation: sonarPulse 1.5s infinite ease-out;
}

@keyframes sonarPulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }

  100% {
    transform: scale(3);
    opacity: 0;
  }
}

.tracking-toggle-container {
  user-select: none;
  transition: all 0.3s ease;
}

.tracking-toggle-container:hover {
  border-color: #0d6efd !important;
  background-color: #fff !important;
}

.stat-card {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.8rem;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--pro-border);
  min-width: 120px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: all 0.2s ease;
}

.stat-card:hover {
  border-color: var(--pro-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.stat-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--pro-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.stat-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--pro-primary);
  white-space: nowrap;
}

#summary-contact {
  font-size: 0.75rem;
  line-height: 1.2;
}

/* --- Premium Auth Styling --- */
.auth-card {
  background: var(--pro-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--pro-border);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  padding: 2.5rem;
  width: 100%;
}

.auth-container {
  width: 100%;
  margin-inline: auto;
}

@media (max-width: 576px) {
  .auth-card {
    padding: 1.5rem 0;
    border: none;
    box-shadow: none;
    background: transparent;
  }

  .auth-mobile-header {
    margin-bottom: 2rem !important;
  }

  .auth-page-wrapper {
    justify-content: flex-start !important;
    padding-top: 1.5rem !important;
  }
}

@media (min-width: 577px) and (max-width: 991px) {
  .auth-card {
    max-width: 500px;
    margin-inline: auto;
  }
}