/* ==========================================================================
   Maple Security Agency - Design System & Viewport Responsive Styles
   Color Contrast matched to Official Obsidian & Platinum Shield Logo
   ========================================================================== */

:root {
  /* Logo Inspired Palette */
  --brand-obsidian: #0D1117;
  --brand-charcoal: #161B22;
  --brand-slate-dark: #21262D;
  --brand-silver: #E6EDF3;
  --brand-platinum: #F0F6FC;
  --brand-red: #DC2626;
  --brand-red-hover: #B91C1C;
  --brand-red-subtle: #FEF2F2;
  --brand-amber: #F59E0B;
  --brand-emerald: #10B981;

  /* Text & Surfaces */
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --bg-page: #F8FAFC;
  --bg-surface: #FFFFFF;
  --border-subtle: #E2E8F0;
  --border-focus: #0F172A;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
  --shadow-card-hover: 0 20px 35px -8px rgba(15, 23, 42, 0.12);
  --shadow-crest: 0 10px 30px -5px rgba(13, 17, 23, 0.35);
}

/* Base Styles */
html {
  scroll-behavior: smooth;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  overflow-x: hidden;
  width: 100%;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #F1F5F9;
}
::-webkit-scrollbar-thumb {
  background: #94A3B8;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #64748B;
}

/* Headings */
h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -0.02em;
}

/* Navigation */
.glass-nav {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-nav.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.08);
  border-bottom-color: #CBD5E1;
}

/* Navigation Link Font Sizing & Interactions */
.nav-link {
  font-size: 15px;
  font-weight: 700;
  color: #334155;
  padding: 8px 14px;
  border-radius: 10px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.01em;
}

.nav-link:hover {
  color: #0F172A;
  background-color: #F1F5F9;
}

.nav-link.active {
  color: #0F172A;
  background-color: #E2E8F0;
  font-weight: 800;
}

/* Mobile Nav Links */
.mobile-nav-link {
  font-size: 16px;
  font-weight: 700;
  color: #1E293B;
  padding: 10px 14px;
  border-radius: 12px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-nav-link:hover {
  background-color: #F1F5F9;
  color: #0F172A;
}

.mobile-nav-link.active {
  background-color: #0F172A;
  color: #FFFFFF;
}

/* Logo Crest Container */
.logo-crest-box {
  background: linear-gradient(135deg, #161B22 0%, #0D1117 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.logo-crest-box:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

/* Light Mode High-Contrast Cards */
.security-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  box-shadow: var(--shadow-card);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.security-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: #94A3B8;
}

/* Hero Background Grid */
.hero-grid-pattern {
  background-color: #FFFFFF;
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(13, 17, 23, 0.03) 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(220, 38, 38, 0.03) 0%, transparent 45%),
    linear-gradient(to right, rgba(226, 232, 240, 0.6) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(226, 232, 240, 0.6) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
}

/* Animations */
@keyframes floatShield {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(0.5deg);
  }
}

@keyframes pulseRedRing {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(220, 38, 38, 0);
  }
}

@keyframes pulseGreenLight {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
}

.animate-float-shield {
  animation: floatShield 5s ease-in-out infinite;
}

.pulse-badge-ring {
  animation: pulseRedRing 2.5s infinite;
}

.pulse-green-live {
  animation: pulseGreenLight 2s infinite;
}

/* Buttons */
.btn-tactical {
  background: linear-gradient(135deg, #161B22 0%, #0D1117 100%);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 14px rgba(13, 17, 23, 0.25);
  transition: all 0.25s ease;
}

.btn-tactical:hover {
  background: linear-gradient(135deg, #21262D 0%, #161B22 100%);
  box-shadow: 0 6px 20px rgba(13, 17, 23, 0.35);
  transform: translateY(-2px);
  color: #FFFFFF;
}

.btn-tactical-red {
  background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3);
  transition: all 0.25s ease;
}

.btn-tactical-red:hover {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.45);
  transform: translateY(-2px);
}

.btn-outline-dark {
  background: #FFFFFF;
  color: #0F172A;
  border: 1px solid #CBD5E1;
  transition: all 0.25s ease;
}

.btn-outline-dark:hover {
  background: #F8FAFC;
  border-color: #0F172A;
  transform: translateY(-2px);
}

/* Card Media Hover Effect */
.media-zoom-box {
  overflow: hidden;
  position: relative;
}

.media-zoom-box img {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.security-card:hover .media-zoom-box img {
  transform: scale(1.06);
}

/* Reveal Animations */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* Accordion */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0, 1, 0, 1), opacity 0.3s ease;
  opacity: 0;
}

.accordion-item.active .accordion-content {
  max-height: 500px;
  transition: max-height 0.4s ease-in-out, opacity 0.3s ease;
  opacity: 1;
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
}

/* ==========================================================================
   VIEWPORT OPTIMIZATION RULES ("har ek k view k according")
   ========================================================================== */

/* 1. Mobile Specific Optimizations (< 640px) */
@media (max-width: 639px) {
  body {
    padding-bottom: 74px; /* Space for mobile sticky bottom bar */
  }

  /* Prevent text jumping or horizontal scrolling */
  h1 {
    font-size: 2rem !important;
    line-height: 1.15 !important;
  }
  
  h2 {
    font-size: 1.75rem !important;
    line-height: 1.2 !important;
  }

  /* Compact padding on small screens */
  .section-padding {
    padding-top: 3.5rem !important;
    padding-bottom: 3.5rem !important;
  }

  /* Touch-friendly inputs (prevents iOS Safari auto-zoom) */
  input, select, textarea {
    font-size: 16px !important;
  }

  /* Floating badge positioned cleanly on mobile */
  .hero-floating-badge {
    position: static !important;
    margin-top: 1rem !important;
    width: 100% !important;
  }

  /* Estimator slider thumb sizing for touch */
  input[type="range"] {
    height: 10px;
  }

  /* Back to top button positioned above mobile bottom bar */
  #backToTopBtn {
    bottom: 84px !important;
    right: 16px !important;
    width: 42px !important;
    height: 42px !important;
  }
}

/* 2. Tablet Specific Optimizations (640px - 1023px) */
@media (min-width: 640px) and (max-width: 1023px) {
  .section-padding {
    padding-top: 4.5rem !important;
    padding-bottom: 4.5rem !important;
  }

  /* Balanced 2-column tablet layout */
  .tablet-2-col {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* 3. Desktop & Widescreen Optimizations (>= 1024px) */
@media (min-width: 1024px) {
  .section-padding {
    padding-top: 6rem;
    padding-bottom: 6rem;
  }
}

/* Range input accent styling */
input[type="range"] {
  accent-color: #0F172A;
}
