/* ==========================================================================
   B A C Tech Intelligence - Core Design System & Stylesheet
   Brand: B A C Web Development Services (https://officialbac.in/)
   Targeting WCAG 2.2 AA Accessibility, Modern SaaS Light Theme (similar to officialbac.in)
   ========================================================================== */

:root {
  /* Official Brand Palette from verified officialbac.in */
  --bac-primary: #059669;        /* Emerald 600 */
  --bac-primary-hover: #047857;  /* Emerald 700 */
  --bac-teal: #0d9488;           /* Teal 600 */
  --bac-cyan: #0891b2;           /* Cyan 600 */
  --bac-indigo: #4f46e5;         /* Indigo 600 */

  /* Light Theme Surfaces (Matched to officialbac.in bg-slate-50 / bg-white) */
  --bac-bg-deep: #f8fafc;        /* Slate 50 */
  --bac-bg-card: #ffffff;        /* Pure White */
  --bac-bg-card-hover: #f8fafc;  /* Slate 50 */
  --bac-bg-elevated: #f1f5f9;    /* Slate 100 */
  --bac-border: #e2e8f0;         /* Slate 200 */
  --bac-border-light: #f1f5f9;   /* Slate 100 */

  /* Typography Colors - High Contrast Slate */
  --bac-text-main: #0f172a;      /* Slate 900 (High contrast readable text) */
  --bac-text-muted: #475569;     /* Slate 600 */
  --bac-text-dim: #64748b;       /* Slate 500 */
  --bac-text-inverse: #ffffff;

  /* Status Tokens */
  --bac-success-bg: rgba(16, 185, 129, 0.12);
  --bac-success-text: #047857;
  --bac-success-border: rgba(16, 185, 129, 0.35);

  --bac-warning-bg: rgba(245, 158, 11, 0.12);
  --bac-warning-text: #b45309;
  --bac-warning-border: rgba(245, 158, 11, 0.35);

  --bac-danger-bg: rgba(244, 63, 94, 0.12);
  --bac-danger-text: #be123c;
  --bac-danger-border: rgba(244, 63, 94, 0.35);

  --bac-info-bg: rgba(59, 130, 246, 0.12);
  --bac-info-text: #1d4ed8;
  --bac-info-border: rgba(59, 130, 246, 0.35);

  /* Elevation Shadows */
  --bac-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  --bac-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --bac-shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --bac-shadow-glow: 0 0 25px -5px rgba(16, 185, 129, 0.15);

  /* Typography */
  --font-brand: 'Righteous', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Utility: Hidden */
.hidden {
  display: none !important;
}

/* Base Reset & Global Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--bac-text-main);
  background-color: var(--bac-bg-deep);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-color: var(--bac-bg-deep);
}

/* Accessible Focus States */
:focus-visible {
  outline: 2px solid var(--bac-primary);
  outline-offset: 3px;
}

/* Reduced Motion Override */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Typography Utilities */
.brand-title {
  font-family: var(--font-brand);
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, #059669, #0d9488);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--bac-text-main);
  font-weight: 700;
  line-height: 1.25;
}

a {
  color: var(--bac-primary);
  text-decoration: none;
  transition: color 0.15s ease-in-out;
}

a:hover {
  color: var(--bac-teal);
}

/* Global Form & Table Contrast Baselines */
table {
  color: var(--bac-text-main);
  border-collapse: collapse;
}

th {
  color: var(--bac-text-main);
  font-weight: 700;
}

td {
  color: var(--bac-text-muted);
}

input, select, textarea {
  color: var(--bac-text-main);
  font-family: inherit;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Navbar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bac-border);
  box-shadow: var(--bac-shadow-sm);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.brand-wrapper .brand-logo {
  font-size: 1.85rem;
  font-family: var(--font-brand);
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0.08em;
  display: inline-block;
}

.desktop-auth-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--bac-primary);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--bac-text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  transition: color 0.15s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--bac-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Mobile Menu Navigation Elements */
.mobile-menu-btn {
  display: none;
  background: var(--bac-bg-card);
  border: 1px solid var(--bac-border);
  color: var(--bac-text-main);
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 1.1rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.mobile-menu-btn:hover {
  border-color: var(--bac-primary);
  color: var(--bac-primary);
}

.mobile-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border-bottom: 1px solid var(--bac-border);
  box-shadow: var(--bac-shadow-lg);
  padding: 1.25rem 0;
  z-index: 99;
}

.mobile-nav-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mobile-nav-links a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: 0.5rem;
  color: var(--bac-text-main);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.15s;
}

.mobile-nav-links a:hover,
.mobile-nav-links a.active {
  background: rgba(16, 185, 129, 0.08);
  color: var(--bac-primary);
}

.mobile-nav-auth {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bac-border);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.65rem 1.25rem;
  border-radius: 0.625rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  text-decoration: none;
  line-height: 1.2;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
  color: #ffffff;
}

.btn-secondary {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: var(--bac-text-main);
}

.btn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-outline {
  background: transparent;
  border-color: #cbd5e1;
  color: var(--bac-text-main);
}

.btn-outline:hover {
  border-color: var(--bac-primary);
  color: var(--bac-primary);
  background: rgba(16, 185, 129, 0.05);
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.45rem 0.85rem;
  border-radius: 0.5rem;
}

.btn-lg {
  font-size: 1.05rem;
  padding: 0.85rem 1.75rem;
  border-radius: 0.75rem;
}

/* Cards & Panels */
.card {
  background: var(--bac-bg-card);
  border: 1px solid var(--bac-border);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--bac-shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--bac-shadow-md);
}

/* Hero Section */
.hero-section {
  padding: 5rem 0 3.5rem;
  text-align: center;
  position: relative;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--bac-primary);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 1.75rem;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 1.25rem;
  line-height: 1.15;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--bac-text-muted);
  max-width: 780px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

/* Scan Box */
.scan-box-wrapper {
  max-width: 740px;
  margin: 0 auto 2rem;
  position: relative;
}

.scan-box {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 1rem;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--bac-shadow-lg), var(--bac-shadow-glow);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.scan-box:focus-within {
  border-color: var(--bac-primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.scan-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.85rem 1.25rem;
  font-size: 1.05rem;
  color: var(--bac-text-main);
  outline: none;
}

.scan-input::placeholder {
  color: var(--bac-text-dim);
}

/* Allowance Pill */
.allowance-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  font-size: 0.84rem;
  color: var(--bac-text-muted);
}

.allowance-bar strong {
  color: var(--bac-primary);
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .desktop-auth-actions { display: none; }
  .mobile-menu-btn { display: inline-flex; }
  .hero-title { font-size: 2.25rem; }
}

@media (max-width: 768px) {
  .hero-title { font-size: 2rem; }
  .hero-subtitle { font-size: 1rem; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .scan-box { flex-direction: column; align-items: stretch; padding: 0.75rem; }
  .scan-box button { width: 100%; }
}

@media (max-width: 480px) {
  .nav-container { height: 4rem; }
  .brand-wrapper .brand-logo { font-size: 1.65rem; }
}

/* Technology Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 0.375rem;
}

.badge-high {
  background: var(--bac-success-bg);
  color: var(--bac-success-text);
  border: 1px solid var(--bac-success-border);
}

.badge-medium {
  background: var(--bac-info-bg);
  color: var(--bac-info-text);
  border: 1px solid var(--bac-info-border);
}

.badge-low {
  background: var(--bac-bg-elevated);
  color: var(--bac-text-muted);
  border: 1px solid var(--bac-border);
}

/* Category Filter Tabs for Report View */
.category-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  -webkit-overflow-scrolling: touch;
}

.category-filter-btn {
  background: var(--bac-bg-card);
  border: 1px solid var(--bac-border);
  color: var(--bac-text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.category-filter-btn:hover,
.category-filter-btn.active {
  background: var(--bac-primary);
  border-color: var(--bac-primary);
  color: #ffffff;
}

/* Report View Specifics */
.report-header {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--bac-border);
  margin-bottom: 2rem;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.tech-card {
  background: var(--bac-bg-card);
  border: 1px solid var(--bac-border);
  border-radius: 0.875rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--bac-shadow-sm);
  transition: all 0.2s ease-in-out;
}

.tech-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--bac-shadow-md);
  transform: translateY(-2px);
}

.tech-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--bac-text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  gap: 0.5rem;
}

.tech-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(30, 64, 175, 0.08);
  color: var(--bac-primary);
  font-size: 0.95rem;
  flex-shrink: 0;
}

.tech-version-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 1px 7px;
  border-radius: 6px;
  margin-left: 0.35rem;
  vertical-align: middle;
}

/* Category Sections (Wappalyzer-surpassing clean grouping) */
.tech-category-section {
  margin-bottom: 2.25rem;
  background: var(--bac-bg-card);
  border: 1px solid var(--bac-border);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--bac-shadow-sm);
  transition: all 0.2s;
}

.tech-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--bac-border);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.12), rgba(16, 185, 129, 0.12));
  color: var(--bac-primary);
  font-size: 1rem;
}

.tech-category-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--bac-text-main);
  margin: 0;
}

.tech-category-count {
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bac-bg-deep);
  color: var(--bac-text-muted);
  border: 1px solid var(--bac-border);
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  text-transform: uppercase;
}

/* Collapsible Evidence Accordion */
.tech-evidence-details {
  margin-top: 0.75rem;
}

.tech-evidence-summary {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bac-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: rgba(30, 64, 175, 0.04);
  transition: all 0.15s;
}

.tech-evidence-summary:hover {
  background: rgba(30, 64, 175, 0.08);
}

.tech-evidence-arrow {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

.tech-evidence-details[open] .tech-evidence-arrow {
  transform: rotate(180deg);
}

.tech-card-evidence {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #0f172a;
  border-radius: 0.375rem;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: #e2e8f0;
  word-break: break-all;
  border: 1px solid #1e293b;
  line-height: 1.45;
}

/* View Mode Toggle Buttons */
.view-toggle-btn {
  background: transparent;
  border: none;
  color: var(--bac-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.view-toggle-btn.active {
  background: var(--bac-primary);
  color: #ffffff;
}

/* Responsive Table Wrapper */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Footer - Sleek Dark Slate Footer like officialbac.in */
.site-footer {
  margin-top: auto;
  background: #0f172a;
  border-top: 1px solid #1e293b;
  padding: 3.5rem 0 2rem;
  color: #94a3b8;
  font-size: 0.88rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; }
}

.footer-heading {
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  color: #94a3b8;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: #34d399;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: #64748b;
}
