/* ============================================= */
/* NAFSOL WEBSITE - PHP VERSION                   */
/* Complete CSS with Dark/Light Mode              */
/* ============================================= */

/* ---- CSS Variables (Light Mode - Default) ---- */
:root {
  --background: #fafafa;
  --foreground: #0a0a0a;
  --card: #ffffff;
  --card-foreground: #0a0a0a;
  --primary: #073b77;
  --primary-foreground: #ffffff;
  --secondary: #f0f7ff;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --border: rgba(0, 0, 0, 0.08);
  --ring: #073b77;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(0, 0, 0, 0.06);
  --section-alt: rgba(7, 59, 119, 0.02);
  --radius: 0.625rem;
  --nafsol-blue: #073b77;
  --nafsol-green: #028037;
  --nafsol-light-blue: #095e95;
  --nafsol-dark: #041a3a;
}

/* ---- Dark Mode Variables ---- */
.dark {
  --background: #09090b;
  --foreground: #fafafa;
  --card: #18181b;
  --card-foreground: #fafafa;
  --primary: #028037;
  --primary-foreground: #ffffff;
  --secondary: #27272a;
  --muted: #27272a;
  --muted-foreground: #a1a1aa;
  --border: rgba(255, 255, 255, 0.06);
  --ring: #028037;
  --glass-bg: rgba(24, 24, 27, 0.72);
  --glass-border: rgba(255, 255, 255, 0.06);
  --section-alt: rgba(2, 128, 55, 0.03);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--background);
  color: var(--foreground);
  overflow-x: hidden;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea, select { font: inherit; }

/* ---- Selection ---- */
::selection { background: rgba(7, 59, 119, 0.15); color: #041a3a; }
.dark ::selection { background: rgba(2, 128, 55, 0.2); color: #fafafa; }

/* ---- Custom Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f8fafc; }
.dark ::-webkit-scrollbar-track { background: #09090b; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #073b77, #095e95); border-radius: 3px; }
.dark ::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #028037, #073b77); }

/* ---- Keyframe Animations ---- */
@keyframes slideReveal { from { opacity: 0; transform: translateY(50px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes morphBlob { 0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; } 25% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; } 50% { border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%; } 75% { border-radius: 60% 40% 60% 30% / 60% 40% 30% 60%; } }
@keyframes cardFloat { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-8px); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@keyframes slideInFromRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes floatWidget1 { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-6px) rotate(1deg); } }
@keyframes floatWidget2 { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-8px) rotate(-1deg); } }
@keyframes floatWidget3 { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-5px) rotate(0.5deg); } }

.animate-slideReveal { animation: slideReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-morphBlob { animation: morphBlob 8s ease-in-out infinite; }
.animate-cardFloat { animation: cardFloat 4s ease-in-out infinite; }
.animate-fadeInUp { animation: fadeInUp 0.6s ease-out forwards; }
.animate-float { animation: cardFloat 3s ease-in-out infinite; }

/* ---- Gradient Text ---- */
.gradient-text-brand { background: linear-gradient(135deg, #073b77 0%, #095e95 40%, #028037 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ---- Scroll Reveal ---- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.active { opacity: 1; transform: translateY(0); }
.reveal-left { opacity: 0; transform: translateX(-40px); transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal-left.active { opacity: 1; transform: translateX(0); }
.reveal-right { opacity: 0; transform: translateX(40px); transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal-right.active { opacity: 1; transform: translateX(0); }
.stagger-children > * { opacity: 0; transform: translateY(20px); transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.stagger-children.active > *:nth-child(1) { transition-delay: 0ms; opacity: 1; transform: translateY(0); }
.stagger-children.active > *:nth-child(2) { transition-delay: 80ms; opacity: 1; transform: translateY(0); }
.stagger-children.active > *:nth-child(3) { transition-delay: 160ms; opacity: 1; transform: translateY(0); }
.stagger-children.active > *:nth-child(4) { transition-delay: 240ms; opacity: 1; transform: translateY(0); }
.stagger-children.active > *:nth-child(5) { transition-delay: 320ms; opacity: 1; transform: translateY(0); }
.stagger-children.active > *:nth-child(6) { transition-delay: 400ms; opacity: 1; transform: translateY(0); }

/* ---- Navbar ---- */
.navbar { position: fixed; top: 0; left: 0; right: 0; z-index: 50; transition: all 0.3s; }
.navbar.scrolled { background: var(--glass-bg); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); border-bottom: 1px solid var(--border); box-shadow: 0 1px 20px rgba(0,0,0,0.04); }
.dark .navbar.scrolled { box-shadow: 0 1px 20px rgba(0,0,0,0.2); }
.navbar-inner { max-width: 1280px; margin: 0 auto; padding: 0 1rem; display: flex; align-items: center; justify-content: space-between; height: 64px; }
@media(min-width:1024px) { .navbar-inner { padding: 0 1.25rem; height: 96px; } }
.navbar-logo { display: flex; align-items: center; gap: 0.5rem; position: relative; z-index: 50; flex-shrink: 0; }
.navbar-logo img { height: 36px; width: auto; object-fit: contain; }
@media(min-width:1024px) { .navbar-logo img { height: 80px; } }
.navbar-logo-text { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.025em; background: linear-gradient(135deg, #073b77 0%, #095e95 40%, #028037 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
@media(min-width:1024px) { .navbar-logo-text { font-size: 1.875rem; } }

.navbar-links { display: none; align-items: center; gap: 1.75rem; }
@media(min-width:1024px) { .navbar-links { display: flex; } }
.nav-link { position: relative; font-size: 13px; font-weight: 500; letter-spacing: 0.025em; color: var(--muted-foreground); transition: color 0.3s; }
.nav-link:hover, .nav-link.active { color: var(--foreground); }
.nav-link::after { content: ''; position: absolute; bottom: -3px; left: 0; width: 0; height: 2px; background: linear-gradient(90deg, #073b77, #028037); transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1); border-radius: 1px; }
.dark .nav-link::after { background: linear-gradient(90deg, #028037, #095e95); }
.nav-link:hover::after { width: 100%; }

.navbar-right { display: none; align-items: center; gap: 0.75rem; flex-shrink: 0; }
@media(min-width:1024px) { .navbar-right { display: flex; } }
.theme-toggle-btn { position: relative; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); transition: all 0.3s; color: var(--foreground); }
.theme-toggle-btn:hover { background: var(--muted); }
.theme-toggle-btn svg { position: absolute; transition: all 0.3s; width: 20px; height: 20px; }
.theme-toggle-btn .sun-icon.is-dark { opacity: 0; transform: rotate(90deg) scale(0); }
.theme-toggle-btn .moon-icon:not(.is-dark) { opacity: 0; transform: rotate(-90deg) scale(0); }

.btn-primary { display: inline-flex; align-items: center; gap: 6px; background: var(--primary); color: var(--primary-foreground); font-size: 13px; font-weight: 600; padding: 10px 20px; border-radius: 9999px; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.btn-primary:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(7, 59, 119, 0.2); }
.dark .btn-primary:hover { box-shadow: 0 8px 24px rgba(2, 128, 55, 0.2); }
.btn-outline { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--primary); color: var(--primary); font-size: 13px; font-weight: 600; padding: 10px 20px; border-radius: 9999px; transition: all 0.3s; }
.btn-outline:hover { background: var(--primary); color: var(--primary-foreground); transform: translateY(-2px); }

/* Mobile Menu Button */
.mobile-menu-btns { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
@media(min-width:1024px) { .mobile-menu-btns { display: none; } }
.mobile-theme-btn { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content; center; color: var(--foreground); transition: background 0.3s; }
.mobile-theme-btn:hover { background: var(--muted); }
.hamburger-btn { padding: 8px; color: var(--foreground); position: relative; z-index: 50; }

/* Mobile Nav Overlay */
.mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.2); backdrop-filter: blur(4px); z-index: 40; animation: fadeIn 0.25s ease forwards; }
.mobile-overlay.open { display: block; }
.mobile-panel { position: fixed; top: 0; right: 0; height: 100%; width: 288px; max-width: 85vw; z-index: 40; box-shadow: -4px 0 30px rgba(0,0,0,0.1); display: flex; flex-direction: column; padding: 80px 24px 24px; background: #fff; animation: slideInFromRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; transform: translateX(100%); overflow-y: auto; }
.dark .mobile-panel { background: #09090b; }
.mobile-panel.open { transform: translateX(0); }
.mobile-panel a { display: block; font-size: 1rem; font-weight: 600; padding: 12px 0; color: var(--foreground); transition: color 0.3s; }
.mobile-panel a:hover { color: var(--primary); }

/* ---- Hero Section ---- */
.hero-section { background: radial-gradient(ellipse at 50% 0%, rgba(7, 59, 119, 0.04) 0%, transparent 60%); position: relative; }
.dark .hero-section { background: radial-gradient(ellipse at 30% 20%, rgba(2, 128, 55, 0.08) 0%, transparent 50%), radial-gradient(ellipse at 70% 80%, rgba(7, 59, 119, 0.06) 0%, transparent 50%), var(--background); }
.hero-dot-grid { background-image: radial-gradient(circle, rgba(7, 59, 119, 0.05) 1px, transparent 1px); background-size: 28px 28px; }
.dark .hero-dot-grid { background-image: radial-gradient(circle, rgba(255, 255, 255, 0.03) 1px, transparent 1px); }

.hero-dashboard { background: var(--glass-bg); backdrop-filter: blur(20px); border: 1px solid var(--glass-border); border-radius: 20px; overflow: hidden; padding: 20px; position: relative; }

/* ---- Marquee ---- */
.marquee-section { border-bottom: 1px solid var(--border); background: rgba(241,245,249,0.3); overflow: hidden; padding: 20px 0; }
.dark .marquee-section { background: rgba(39,39,42,0.3); }
.marquee-track { display: flex; animation: marquee 35s linear infinite; width: max-content; }
.marquee-track:hover { animation-play-state: paused; }
.marquee-track span { font-size: 0.875rem; font-weight: 600; color: rgba(100,116,139,0.4); padding: 0 2rem; white-space: nowrap; transition: color 0.3s; cursor: default; }
.marquee-track span:hover { color: rgba(100,116,139,0.7); }

/* ---- Glass / Service Cards ---- */
.glass-card { background: var(--glass-bg); backdrop-filter: blur(20px); border: 1px solid var(--glass-border); border-radius: 16px; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.glass-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(7, 59, 119, 0.06); border-color: rgba(7, 59, 119, 0.12); }
.dark .glass-card:hover { box-shadow: 0 12px 40px rgba(2, 128, 55, 0.06); }

.service-card { position: relative; background: var(--glass-bg); backdrop-filter: blur(12px); border: 1px solid var(--glass-border); border-radius: 16px; padding: 24px; overflow: hidden; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); cursor: pointer; }
.service-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, #073b77, #095e95, #028037); opacity: 0; transition: opacity 0.3s; }
.service-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(7, 59, 119, 0.08); }
.service-card:hover::before { opacity: 1; }
.dark .service-card:hover { box-shadow: 0 16px 40px rgba(2, 128, 55, 0.08); }

/* ---- Feature / CTA / FAQ Cards ---- */
.feature-box { background: var(--glass-bg); backdrop-filter: blur(12px); border: 1px solid var(--glass-border); border-radius: 14px; padding: 20px; transition: all 0.3s; }
.feature-box:hover { border-color: rgba(7, 59, 119, 0.15); box-shadow: 0 8px 24px rgba(7, 59, 119, 0.05); }
.dark .feature-box:hover { border-color: rgba(2, 128, 55, 0.2); box-shadow: 0 8px 24px rgba(2, 128, 55, 0.05); }

.cta-card { background: var(--glass-bg); backdrop-filter: blur(16px); border: 1px solid var(--glass-border); border-radius: 20px; box-shadow: 0 6px 24px rgba(4, 26, 58, 0.04); transition: all 0.3s; }
.cta-card:hover { box-shadow: 0 12px 40px rgba(4, 26, 58, 0.08); }
.dark .cta-card:hover { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3); }

.faq-item { background: var(--glass-bg); backdrop-filter: blur(12px); border: 1px solid var(--glass-border); border-radius: 12px; transition: all 0.3s; }
.faq-item:hover { border-color: rgba(7, 59, 119, 0.15); }
.dark .faq-item:hover { border-color: rgba(2, 128, 55, 0.2); }
.faq-item-open { box-shadow: 0 6px 24px rgba(7, 59, 119, 0.05); }
.dark .faq-item-open { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2); }

/* ---- Project Cards ---- */
.project-card { position: relative; overflow: hidden; border-radius: 16px; background: var(--glass-bg); backdrop-filter: blur(12px); border: 1px solid var(--glass-border); transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.project-card:hover { transform: translateY(-6px) scale(1.01); box-shadow: 0 20px 40px rgba(4, 26, 58, 0.1); }
.dark .project-card:hover { box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4); }

/* ---- Stats Banner ---- */
.stats-bg { background: linear-gradient(135deg, #041a3a 0%, #073b77 50%, #095e95 100%); position: relative; overflow: hidden; }
.dark .stats-bg { background: linear-gradient(135deg, #09090b 0%, #0f1729 40%, #041a3a 100%); }
.stats-bg::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px); background-size: 36px 36px; }
.stats-bg::after { content: ''; position: absolute; top: -200px; right: -200px; width: 500px; height: 500px; background: radial-gradient(circle, rgba(2, 128, 55, 0.12) 0%, transparent 70%); border-radius: 50%; }

/* ---- Process Timeline ---- */
.process-line { height: 2px; background: rgba(0, 0, 0, 0.06); }
.dark .process-line { background: rgba(255, 255, 255, 0.06); }
.process-line-fill { height: 100%; width: 0; background: linear-gradient(90deg, #073b77, #095e95, #028037); transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1); border-radius: 1px; }
.process-line-fill.active { width: 100%; }
.process-number { width: 64px; height: 64px; border-radius: 50%; background: var(--muted); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.process-step.active .process-number { background: linear-gradient(135deg, #073b77, #095e95) !important; color: white !important; box-shadow: 0 4px 20px rgba(7, 59, 119, 0.3); }
.dark .process-step.active .process-number { background: linear-gradient(135deg, #028037, #073b77) !important; box-shadow: 0 4px 20px rgba(2, 128, 55, 0.3); }

/* ---- Tech Pills ---- */
.tech-pill { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 100px; font-size: 13px; font-weight: 500; transition: all 0.3s; cursor: default; border: 1px solid transparent; }
.tech-pill:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.06); }
.tech-pill-navy { background: #f0f4ff; color: #073b77; border-color: rgba(7, 59, 119, 0.1); }
.tech-pill-navy:hover { background: #073b77; color: white; border-color: #073b77; }
.dark .tech-pill-navy { background: #1e293b; color: #93c5fd; border-color: rgba(7, 59, 119, 0.2); }
.dark .tech-pill-navy:hover { background: #073b77; color: white; border-color: #073b77; }
.tech-pill-green { background: #ecfdf5; color: #028037; border-color: rgba(2, 128, 55, 0.1); }
.tech-pill-green:hover { background: #028037; color: white; border-color: #028037; }
.dark .tech-pill-green { background: #1a2e23; color: #86efac; border-color: rgba(2, 128, 55, 0.2); }
.dark .tech-pill-green:hover { background: #028037; color: white; border-color: #028037; }
.tech-pill-blue { background: #f0f9ff; color: #095e95; border-color: rgba(9, 94, 149, 0.1); }
.tech-pill-blue:hover { background: #095e95; color: white; border-color: #095e95; }
.dark .tech-pill-blue { background: #172554; color: #7dd3fc; border-color: rgba(9, 94, 149, 0.2); }
.dark .tech-pill-blue:hover { background: #095e95; color: white; border-color: #095e95; }

/* ---- Inputs ---- */
.nafsol-input { transition: all 0.3s; border: 1px solid var(--border); background: var(--background); color: var(--foreground); width: 100%; padding: 10px 16px; border-radius: 12px; font-size: 14px; }
.nafsol-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(7, 59, 119, 0.08); }
.dark .nafsol-input:focus { box-shadow: 0 0 0 3px rgba(2, 128, 55, 0.1); }
.nafsol-input::placeholder { color: var(--muted-foreground); }

/* ---- Section Helpers ---- */
.section-divider { width: 50px; height: 3px; background: linear-gradient(90deg, #073b77, #028037); border-radius: 2px; }
.section-separator { border-bottom: 1px solid var(--border); }
.container { max-width: 1280px; margin: 0 auto; padding: 0 1.25rem; }
@media(min-width:1024px) { .container { padding: 0 2rem; } }

/* ---- Footer ---- */
.footer { background: rgba(241,245,249,0.3); border-top: 1px solid var(--border); }
.dark .footer { background: rgba(39,39,42,0.3); }
.footer-link { transition: color 0.3s, padding-left 0.3s; color: var(--muted-foreground); font-size: 14px; }
.footer-link:hover { color: #028037; padding-left: 4px; }
.dark .footer-link:hover { color: #4ade80; }

/* ---- Floating Buttons ---- */
.back-to-top { position: fixed; bottom: 24px; right: 24px; z-index: 40; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); opacity: 0; transform: translateY(20px); pointer-events: none; }
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: all; }
.back-to-top button { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: var(--primary-foreground); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 20px rgba(7, 59, 119, 0.3); transition: all 0.3s; margin-bottom: 12px; }
.back-to-top button:hover { transform: translateY(-3px); }
.theme-float-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--muted); border: 1px solid var(--border); display: flex; align-items: center; justify-content; center; color: var(--foreground); box-shadow: 0 2px 10px rgba(0,0,0,0.08); transition: all 0.3s; }
.theme-float-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }

/* ---- Page Hero ---- */
.page-hero { position: relative; padding-top: 112px; padding-bottom: 56px; overflow: hidden; }
@media(min-width:1024px) { .page-hero { padding-top: 128px; padding-bottom: 72px; } }

/* ---- Filter Tabs ---- */
.filter-tab { padding: 8px 16px; border-radius: 9999px; font-size: 12px; font-weight: 600; white-space: nowrap; transition: all 0.3s; }
.filter-tab.active { background: var(--primary); color: var(--primary-foreground); }
.filter-tab:not(.active) { background: var(--muted); color: var(--muted-foreground); }
.filter-tab:not(.active):hover { color: var(--foreground); background: var(--muted); opacity: 0.8; }

/* ---- Utility ---- */
.icon-box { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-box-sm { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content; center; flex-shrink: 0; }
.bg-primary-10 { background: rgba(7, 59, 119, 0.1); }
.dark .bg-primary-10 { background: rgba(7, 59, 119, 0.2); }
.bg-primary-5 { background: rgba(7, 59, 119, 0.05); }
.dark .bg-primary-5 { background: rgba(7, 59, 119, 0.1); }
.text-primary { color: var(--primary); }
.text-muted { color: var(--muted-foreground); }
.text-white { color: #ffffff; }

/* ---- Responsive Grid Helpers ---- */
.grid-1 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media(min-width:640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media(min-width:640px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media(min-width:1024px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid-4 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media(min-width:640px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media(min-width:1024px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }

/* ---- Force responsive on ALL inline grids on mobile ---- */
@media(max-width:639px) {
  div[style*="grid-template-columns"], section > .container > div[style*="display:grid"], section > .container > div[style*="display: grid"] {
    grid-template-columns: 1fr !important;
  }
  .hero-dashboard [style*="grid-template-columns:repeat(3"],
  .hero-dashboard [style*="grid-template-columns: repeat(3"] {
    grid-template-columns: 1fr 1fr !important;
  }
}
@media(max-width:374px) {
  .hero-dashboard [style*="grid-template-columns:repeat(3"],
  .hero-dashboard [style*="grid-template-columns: repeat(3"] {
    grid-template-columns: 1fr !important;
  }
}

/* ---- Contact Grid ---- */
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 3rem; }
@media(min-width:1024px) { .contact-grid { grid-template-columns: 1fr 1fr; align-items: start; } }

/* ---- Form Row (responsive 2-col) ---- */
.form-row { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media(min-width:640px) { .form-row { grid-template-columns: 1fr 1fr; } }

/* ---- Success/Error Messages ---- */
.msg-success { text-align: center; padding: 48px 0; }
.msg-error { margin-bottom: 16px; padding: 12px; border-radius: 12px; background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); color: #ef4444; font-size: 14px; }

/* ---- Spin Animation for Loading ---- */
@keyframes spin { to { transform: rotate(360deg); } }

/* Social icon circle */
.social-circle { width: 32px; height: 32px; border-radius: 50%; background: var(--muted); display: flex; align-items: center; justify-content: center; color: var(--muted-foreground); transition: all 0.3s; }
.social-circle:hover { color: var(--primary); background: rgba(7, 59, 119, 0.1); }

/* ---- Footer Layout ---- */
.footer-container { max-width: 1280px; margin: 0 auto; padding: 48px 1.25rem; display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media(min-width:640px) { .footer-container { grid-template-columns: repeat(2, 1fr); } }
@media(min-width:1024px) { .footer-container { grid-template-columns: repeat(4, 1fr); gap: 3rem; padding: 64px 2rem; } }
.footer-logo img { height: 48px; width: auto; object-fit: contain; margin-bottom: 16px; }
.footer-tagline { font-size: 14px; color: var(--muted-foreground); line-height: 1.7; margin-bottom: 20px; }
.footer-social { display: flex; gap: 12px; }
.footer-heading { font-size: 14px; font-weight: 700; color: var(--foreground); margin-bottom: 16px; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-contact { display: flex; flex-direction: column; gap: 12px; }
.footer-contact-item { display: flex; align-items: flex-start; gap: 10px; color: var(--muted-foreground); font-size: 14px; }
.footer-contact-item svg { flex-shrink: 0; margin-top: 2px; }
.footer-bottom { border-top: 1px solid var(--border); max-width: 1280px; margin: 0 auto; padding: 20px 1.25rem; display: flex; flex-direction: column; align-items: center; gap: 12px; }
@media(min-width:640px) { .footer-bottom { flex-direction: row; justify-content: space-between; padding: 20px 2rem; } }
.footer-bottom p { font-size: 12px; color: var(--muted-foreground); }
.footer-bottom-links { display: flex; gap: 20px; }

/* Hamburger X toggle */
.hamburger-btn .menu-icon { display: block; }
.hamburger-btn .close-icon { display: none; }
.hamburger-btn.open .menu-icon { display: none; }
.hamburger-btn.open .close-icon { display: block; }

/* ============================================= */
/* COMPREHENSIVE MOBILE RESPONSIVE               */
/* ============================================= */

/* ---- Page Hero mobile padding ---- */
.page-hero { padding-top: 80px !important; padding-bottom: 40px !important; }
@media(min-width:1024px) { .page-hero { padding-top: 128px !important; padding-bottom: 72px !important; } }

/* ---- Hero section mobile ---- */
@media(max-width:1023px) {
  .hero-section { min-height: auto !important; padding-top: 64px !important; padding-bottom: 32px !important; }
  .hero-dashboard { padding: 14px !important; }
}

/* ---- Hide floating widgets on mobile ---- */
@media(max-width:767px) {
  .hero-widget { display: none !important; }
}

/* ---- Contact form mobile stacking ---- */
@media(max-width:639px) {
  .form-row { grid-template-columns: 1fr !important; }
}

/* ---- FAQ mobile padding ---- */
@media(max-width:639px) {
  .faq-btn { padding: 16px 16px !important; font-size: 14px !important; }
  .faq-content { padding: 0 16px 16px !important; }
}

/* ---- Stats section mobile padding ---- */
@media(max-width:639px) {
  .stats-bg { padding: 40px 0 !important; }
}

/* ---- CTA section mobile ---- */
@media(max-width:639px) {
  .cta-card { padding: 32px 20px !important; }
}

/* ---- Service card mobile ---- */
@media(max-width:639px) {
  .service-card { padding: 20px !important; }
}

/* ---- Portfolio card mobile ---- */
@media(max-width:639px) {
  .project-card > div:first-child { padding: 24px 20px !important; }
  .project-card > div:last-child { padding: 20px !important; }
}

/* ---- Footer mobile ---- */
@media(max-width:639px) {
  .footer-contact-item { font-size: 13px !important; }
  .footer-contact-item span { font-size: 13px !important; }
}

/* ---- Mobile touch improvements ---- */
@media(max-width:1023px) {
  button, a, .service-card, .glass-card, .feature-box { -webkit-tap-highlight-color: transparent; }
}

/* ---- ALL section padding mobile override ---- */
@media(max-width:639px) {
  section { padding-left: 0 !important; padding-right: 0 !important; }
  section[style*="padding:56px"],
  section[style*="padding: 56px"],
  section[style*="padding:5rem"],
  section[style*="padding: 5rem"],
  section[style*="padding:80px"],
  section[style*="padding: 80px"] {
    padding-top: 40px !important;
    padding-bottom: 40px !important;
  }
}

/* Tablet section padding */
@media(min-width:640px) and (max-width:1023px) {
  section[style*="padding:80px"],
  section[style*="padding: 80px"],
  section[style*="padding:5rem"],
  section[style*="padding: 5rem"] {
    padding-top: 56px !important;
    padding-bottom: 56px !important;
  }
}

/* ---- Safe area for notched phones ---- */
@supports(padding: max(0px)) {
  body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
}

/* ---- Mobile theme button fix ---- */
.mobile-theme-btn svg { width: 18px !important; height: 18px !important; }
.mobile-theme-btn .sun-icon.is-dark { opacity: 0; transform: rotate(90deg) scale(0); }
.mobile-theme-btn .moon-icon:not(.is-dark) { opacity: 0; transform: rotate(-90deg) scale(0); }
.mobile-theme-btn .sun-icon { transition: all 0.3s; }
.mobile-theme-btn .moon-icon { transition: all 0.3s; }

/* ---- Logo text mobile size ---- */
@media(max-width:1023px) {
  .navbar-logo-text { font-size: 1.25rem !important; }
}

/* ---- Marquee mobile ---- */
@media(max-width:639px) {
  .marquee-section { padding: 14px 0 !important; }
  .marquee-track span { font-size: 0.8rem !important; padding: 0 1.2rem !important; }
}

/* ---- Process section mobile ---- */
@media(max-width:639px) {
  .process-section .grid-4 { grid-template-columns: 1fr 1fr !important; gap: 20px !important; text-align: center; }
}
@media(max-width:374px) {
  .process-section .grid-4 { grid-template-columns: 1fr !important; }
}

/* ---- Stats grid on portfolio page ---- */
@media(max-width:767px) {
  #stats-grid { grid-template-columns: 1fr 1fr !important; }
}

/* ---- Back to top mobile position ---- */
@media(max-width:639px) {
  .back-to-top { bottom: 16px !important; right: 16px !important; }
}

/* ---- Office locations section ---- */
@media(max-width:639px) {
  .cta-card { padding: 24px 20px !important; }
}

/* ---- General text overflow prevention ---- */
h1, h2, h3, h4, p, span, a, li {
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

/* ---- Feature box mobile ---- */
@media(max-width:639px) {
  .feature-box { padding: 16px !important; }
}

/* ---- Select/Input mobile ---- */
@media(max-width:639px) {
  select.nafsol-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    padding-right: 36px !important;
  }
}

/* ---- Feature grid responsive (used in services) ---- */
.feature-grid-2x2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media(max-width:639px) { .feature-grid-2x2 { grid-template-columns: 1fr !important; } }

/* ---- Additional Mobile Improvements ---- */

/* Mobile container padding */
@media(max-width:639px) {
  .container { padding-left: 1rem !important; padding-right: 1rem !important; }
}

/* Mobile heading sizes */
@media(max-width:639px) {
  h1 { font-size: 1.75rem !important; }
  h2 { font-size: 1.5rem !important; }
}

/* Mobile glass-card padding */
@media(max-width:639px) {
  .glass-card { padding: 20px !important; }
}

/* Mobile service grid gap */
@media(max-width:639px) {
  .grid-3 { gap: 16px !important; }
  .grid-2 { gap: 16px !important; }
}

/* Mobile section headers - reduce margin */
@media(max-width:639px) {
  div[style*="margin-bottom:48px"] { margin-bottom: 32px !important; }
  div[style*="margin-bottom:56px"] { margin-bottom: 32px !important; }
}

/* Mobile contact form container */
@media(max-width:639px) {
  .contact-grid { gap: 2rem !important; }
}

/* Mobile hero inner spacing */
@media(max-width:639px) {
  .hero-section .container > div > div { gap: 32px !important; }
}

/* Mobile stats text */
@media(max-width:639px) {
  .stats-count { font-size: 2rem !important; }
}

/* Mobile CTA buttons full width on small screens */
@media(max-width:374px) {
  .btn-primary, .btn-outline { padding: 10px 16px !important; font-size: 13px !important; }
}

/* Mobile footer container */
@media(max-width:639px) {
  .footer-container { padding: 32px 1rem !important; gap: 1.5rem !important; }
}

/* Mobile FAQ section */
@media(max-width:639px) {
  .faq-item { border-radius: 12px !important; }
}

/* Portfolio project card mobile fix */
@media(max-width:639px) {
  .project-card { border-radius: 14px !important; }
  .project-card > div:first-child { border-radius: 14px 14px 0 0 !important; }
}

/* Filter tabs horizontal scroll on mobile */
@media(max-width:639px) {
  section .container[style*="display:flex"] {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 4px !important;
  }
  .filter-tab { flex-shrink: 0 !important; }
}

/* Mobile breadcrumb fix */
@media(max-width:639px) {
  .page-hero nav { margin-bottom: 16px !important; }
}

/* Team member cards mobile */
@media(max-width:639px) {
  .glass-card[style*="padding:32px"] { padding: 24px !important; }
}

/* Office location cards */
@media(max-width:639px) {
  .office-card { padding: 24px 20px !important; }
}

/* Map placeholder mobile */
@media(max-width:639px) {
  div[style*="height: 280px"] { height: 200px !important; }
}

/* CTA banner buttons mobile */
@media(max-width:639px) {
  div[style*="justify-content:center"][style*="gap:12px"] {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  div[style*="justify-content:center"][style*="gap:12px"] a {
    text-align: center !important;
    justify-content: center !important;
  }
}
