/* ============================================================
   LEADSBOK AI Business Doctor — Futuristic UI System
   Cyan theme · Glass · Responsive · All devices
   ============================================================ */

:root {
  --lb-primary: #5BD1D7;
  --lb-primary-dark: #3AACB2;
  --lb-primary-light: #8DE1E5;
  --lb-primary-glow: rgba(91, 209, 215, 0.35);
  --lb-accent: #22d3ee;
  --lb-danger: #f43f5e;
  --lb-warning: #f59e0b;
  --lb-success: #10b981;
  --lb-bg: #f0f7fa;
  --lb-bg-deep: #e6f4f7;
  --lb-card: rgba(255, 255, 255, 0.85);
  --lb-card-solid: #ffffff;
  --lb-text: #0f172a;
  --lb-muted: #64748b;
  --lb-border: rgba(91, 209, 215, 0.18);
  --lb-radius: 16px;
  --lb-radius-sm: 10px;
  --lb-radius-lg: 24px;
  --lb-shadow: 0 4px 20px rgba(91, 209, 215, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);
  --lb-shadow-lg: 0 20px 50px rgba(91, 209, 215, 0.12), 0 8px 16px rgba(15, 23, 42, 0.06);
  --lb-shadow-glow: 0 0 40px rgba(91, 209, 215, 0.25);
  --lb-glass: blur(16px) saturate(180%);
  --lb-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--lb-bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(91, 209, 215, 0.15), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(34, 211, 238, 0.1), transparent);
  background-attachment: fixed;
  color: var(--lb-text);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: var(--safe-bottom);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.display-4, .display-5 {
  letter-spacing: -0.03em;
}

/* ---------- Navbar ---------- */
.navbar-lb {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: var(--lb-glass);
  -webkit-backdrop-filter: var(--lb-glass);
  border-bottom: 1px solid var(--lb-border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, var(--lb-shadow);
  padding-top: max(0.5rem, var(--safe-top));
  z-index: 1030;
}

.navbar-lb .navbar-brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--lb-primary-dark);
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color var(--lb-transition), transform var(--lb-transition);
}

.navbar-lb .navbar-brand:hover {
  color: var(--lb-primary);
  transform: translateY(-1px);
}

.navbar-lb .navbar-brand i {
  font-size: 1.35rem;
  filter: drop-shadow(0 0 8px var(--lb-primary-glow));
}

.navbar-lb .nav-link {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--lb-muted);
  padding: 0.5rem 0.85rem !important;
  border-radius: 8px;
  transition: color var(--lb-transition), background var(--lb-transition);
}

.navbar-lb .nav-link:hover,
.navbar-lb .nav-link:focus {
  color: var(--lb-primary-dark);
  background: rgba(91, 209, 215, 0.1);
}

.navbar-lb .navbar-toggler {
  border: 1px solid var(--lb-border);
  border-radius: 10px;
  padding: 0.4rem 0.55rem;
  box-shadow: none;
}

.navbar-lb .navbar-toggler:focus {
  box-shadow: 0 0 0 3px var(--lb-primary-glow);
}

.navbar-lb .navbar-toggler-icon {
  width: 1.2em;
  height: 1.2em;
}

.navbar-lb .badge {
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.4em 0.75em;
  border-radius: 999px;
  background: rgba(91, 209, 215, 0.12) !important;
  color: var(--lb-primary-dark) !important;
  border-color: var(--lb-border) !important;
}

/* ---------- Buttons ---------- */
.btn {
  font-weight: 600;
  border-radius: 12px;
  padding: 0.55rem 1.25rem;
  transition: all var(--lb-transition);
  letter-spacing: -0.01em;
}

.btn-lg {
  padding: 0.75rem 1.75rem;
  border-radius: 14px;
  font-size: 1.05rem;
}

.btn-sm {
  padding: 0.35rem 0.85rem;
  border-radius: 9px;
  font-size: 0.825rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--lb-primary) 0%, var(--lb-primary-dark) 100%);
  border: none;
  color: #fff;
  box-shadow: 0 4px 14px var(--lb-primary-glow);
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, var(--lb-primary-light) 0%, var(--lb-primary) 100%);
  border: none;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--lb-primary-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-outline-secondary {
  border: 1.5px solid #cbd5e1;
  color: var(--lb-text);
  background: rgba(255, 255, 255, 0.6);
}

.btn-outline-secondary:hover {
  background: #fff;
  border-color: var(--lb-primary);
  color: var(--lb-primary-dark);
  transform: translateY(-1px);
}

.btn-light {
  background: #fff;
  border: none;
  color: var(--lb-primary-dark);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.btn-light:hover {
  background: #f8fafc;
  color: var(--lb-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.btn-outline-gold {
  color: var(--lb-primary-dark);
  border: 1.5px solid rgba(91, 209, 215, 0.4);
  background: rgba(91, 209, 215, 0.06);
  transition: all var(--lb-transition);
}

.btn-outline-gold:hover {
  color: #fff;
  background: var(--lb-primary);
  border-color: var(--lb-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--lb-primary-glow);
}

/* ---------- Cards & Glass ---------- */
.card {
  border-radius: var(--lb-radius);
  border: 1px solid var(--lb-border);
  background: var(--lb-card-solid);
  box-shadow: var(--lb-shadow);
  transition: transform var(--lb-transition), box-shadow var(--lb-transition);
}

.card-glass {
  background: var(--lb-card);
  backdrop-filter: var(--lb-glass);
  -webkit-backdrop-filter: var(--lb-glass);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--lb-shadow-lg);
}

/* ---------- Forms ---------- */
.form-control,
.form-select {
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.9);
  transition: border-color var(--lb-transition), box-shadow var(--lb-transition);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--lb-primary);
  box-shadow: 0 0 0 4px var(--lb-primary-glow);
  background: #fff;
}

.form-label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--lb-text);
  margin-bottom: 0.4rem;
}

.form-text {
  font-size: 0.8rem;
  color: var(--lb-muted);
}

/* ---------- Auth pages ---------- */
.auth-page {
  min-height: calc(100vh - 80px);
  min-height: calc(100dvh - 80px);
  display: flex;
  align-items: center;
  padding: 2rem 0;
}

.auth-card {
  border: 1px solid var(--lb-border);
  border-radius: var(--lb-radius-lg);
  box-shadow: var(--lb-shadow-lg);
  overflow: hidden;
  background: #fff;
}

.auth-card .auth-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(91, 209, 215, 0.2), rgba(34, 211, 238, 0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: var(--lb-primary-dark);
  font-size: 1.75rem;
  box-shadow: 0 0 30px var(--lb-primary-glow);
}

/* ---------- Hero ---------- */
.hero-section {
  position: relative;
  overflow: hidden;
  padding: 3rem 0 4rem;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 40%, rgba(91, 209, 215, 0.18), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(34, 211, 238, 0.12), transparent 40%);
  pointer-events: none;
}

.hero-section .container {
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(91, 209, 215, 0.12);
  border: 1px solid var(--lb-border);
  color: var(--lb-primary-dark);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.leakage-card {
  border-radius: var(--lb-radius-lg) !important;
  border: 1px solid var(--lb-border) !important;
  border-left: 4px solid var(--lb-danger) !important;
  background: #fff !important;
  box-shadow: var(--lb-shadow-lg) !important;
  overflow: hidden;
}

.leakage-card .table {
  font-size: 0.9rem;
}

.leakage-card .table td {
  padding: 0.55rem 0;
  border-color: #f1f5f9;
}

/* ---------- Steps ---------- */
.step-num {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--lb-primary), var(--lb-primary-dark));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  margin: 0 auto;
  box-shadow: 0 8px 20px var(--lb-primary-glow);
}

.feature-tile {
  display: flex;
  gap: 1rem;
  padding: 1.15rem;
  border-radius: var(--lb-radius);
  background: #fff;
  border: 1px solid var(--lb-border);
  height: 100%;
  transition: transform var(--lb-transition), box-shadow var(--lb-transition), border-color var(--lb-transition);
}

.feature-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--lb-shadow-lg);
  border-color: rgba(91, 209, 215, 0.35);
}

.feature-tile i {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(91, 209, 215, 0.12);
  color: var(--lb-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

/* ---------- Metrics ---------- */
.metric-card {
  border-radius: var(--lb-radius);
  border: 1px solid var(--lb-border);
  background: #fff;
  transition: transform var(--lb-transition), box-shadow var(--lb-transition);
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--lb-shadow-lg);
}

.metric-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--lb-muted);
  font-weight: 600;
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.metric-value.small-value {
  font-size: 1.1rem;
}

/* ---------- Upload ---------- */
.upload-card {
  border-radius: var(--lb-radius);
  border: 2px dashed rgba(91, 209, 215, 0.35);
  background: rgba(91, 209, 215, 0.04);
  transition: all var(--lb-transition);
  cursor: pointer;
}

.upload-card:hover,
.upload-card.dragover {
  border-color: var(--lb-primary);
  background: rgba(91, 209, 215, 0.1);
  box-shadow: var(--lb-shadow-glow);
}

.upload-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(91, 209, 215, 0.15);
  color: var(--lb-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(135deg, #0e7490 0%, #0891b2 40%, #06b6d4 100%);
  position: relative;
  overflow: hidden;
}

.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.12), transparent 50%),
    radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.08), transparent 40%);
  pointer-events: none;
}

.cta-band .container {
  position: relative;
  z-index: 1;
}

/* ---------- Footer ---------- */
footer {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--lb-border);
  padding: 2.5rem 0 calc(2rem + var(--safe-bottom));
  margin-top: 3rem;
  color: var(--lb-muted);
  font-size: 0.875rem;
}

footer a {
  color: var(--lb-muted);
  text-decoration: none;
  transition: color var(--lb-transition);
}

footer a:hover {
  color: var(--lb-primary-dark);
}

/* ---------- Dropdown ---------- */
.dropdown-menu {
  border: 1px solid var(--lb-border);
  box-shadow: var(--lb-shadow-lg);
  border-radius: 14px;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
}

.dropdown-item {
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--lb-transition), color var(--lb-transition);
}

.dropdown-item:hover {
  background: rgba(91, 209, 215, 0.1);
  color: var(--lb-primary-dark);
}

.dropdown-item.active {
  background: rgba(91, 209, 215, 0.15);
  color: var(--lb-primary-dark);
}

.dropdown-item.text-danger:hover {
  background: rgba(244, 63, 94, 0.1);
  color: var(--lb-danger) !important;
}

.dropdown-divider {
  border-color: var(--lb-border);
  margin: 0.4rem 0;
}

.dropdown-header {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--lb-muted);
  padding: 0.5rem 0.9rem;
}

/* ---------- Alerts ---------- */
.alert {
  border-radius: 12px;
  border: none;
  font-weight: 500;
  box-shadow: var(--lb-shadow);
}

.alert-success {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.alert-danger {
  background: rgba(244, 63, 94, 0.12);
  color: #be123c;
}

/* ---------- Utilities ---------- */
.text-gold,
.text-cyan {
  color: var(--lb-primary-dark) !important;
}

.bg-gold,
.bg-cyan {
  background: var(--lb-primary) !important;
}

.bg-gold-light,
.bg-cyan-light {
  background: rgba(91, 209, 215, 0.12) !important;
}

.min-vh-75 {
  min-height: 70vh;
  min-height: 70dvh;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lb-success);
  display: inline-block;
  animation: pulseDot 2s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.65; }
}

.fade-in {
  animation: fadeIn 0.5s ease-out both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.float-anim {
  animation: floatY 4s ease-in-out infinite;
}

/* ---------- Guest top bar (landing) ---------- */
.guest-topbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: var(--lb-glass);
  -webkit-backdrop-filter: var(--lb-glass);
  border-bottom: 1px solid var(--lb-border);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.guest-topbar .brand {
  font-weight: 800;
  color: var(--lb-primary-dark);
  text-decoration: none;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.guest-topbar .brand i {
  filter: drop-shadow(0 0 6px var(--lb-primary-glow));
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablets */
@media (max-width: 991.98px) {
  .hero-section {
    padding: 2rem 0 3rem;
  }

  .navbar-lb .navbar-collapse {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 14px;
    margin-top: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--lb-border);
    box-shadow: var(--lb-shadow-lg);
  }

  .navbar-lb .nav-link {
    padding: 0.65rem 1rem !important;
  }
}

/* Mobile */
@media (max-width: 767.98px) {
  body {
    font-size: 0.95rem;
  }

  .display-4 {
    font-size: 1.85rem;
  }

  .display-5 {
    font-size: 1.6rem;
  }

  .hero-section {
    padding: 1.5rem 0 2.5rem;
  }

  .min-vh-75 {
    min-height: auto;
  }

  .metric-value {
    font-size: 1.35rem;
  }

  .metric-value.small-value {
    font-size: 0.95rem;
  }

  .btn-lg {
    padding: 0.7rem 1.4rem;
    font-size: 1rem;
    width: 100%;
  }

  .hero-section .d-flex.flex-wrap.gap-3 {
    flex-direction: column;
  }

  .hero-section .d-flex.flex-wrap.gap-3 .btn {
    width: 100%;
  }

  .header-actions .btn:not(#themeToggle):not(.dropdown-toggle) {
    display: none;
  }

  .auth-page {
    padding: 1.25rem 0;
    align-items: flex-start;
  }

  .auth-card .card-body {
    padding: 1.5rem !important;
  }

  .feature-tile {
    padding: 1rem;
  }

  .step-num {
    width: 46px;
    height: 46px;
    font-size: 1.1rem;
  }

  footer {
    text-align: center;
  }

  footer .text-md-end {
    text-align: center !important;
  }
}

/* Small phones */
@media (max-width: 399.98px) {
  .display-4 {
    font-size: 1.55rem;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .btn {
    padding: 0.5rem 1rem;
  }
}

/* Large screens */
@media (min-width: 1400px) {
  .hero-section {
    padding: 4rem 0 5rem;
  }
}

/* Touch devices — larger tap targets */
@media (hover: none) and (pointer: coarse) {
  .nav-link,
  .dropdown-item,
  .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .navbar-lb .nav-link {
    min-height: 48px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print */
@media print {
  .navbar,
  .navbar-lb,
  .guest-topbar,
  .no-print,
  .btn,
  footer,
  .animated-sidebar,
  .sidebar-toggle-mobile,
  .sidebar-overlay,
  .app-header,
  .app-footer {
    display: none !important;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }

  .main-wrapper {
    width: 100% !important;
    margin-left: 0 !important;
  }

  body {
    background: #fff !important;
  }
}
