/* ============================================
   CENTRIX SOLAR — GLOBAL STYLES (style.css)
   Shared across ALL pages: variables, reset,
   header, footer, utilities, animations
   ============================================ */

/* ── CSS Variables ───────────────────────── */
:root {
  /* Brand Colors */
  --primary: #1a5f2a;
  --primary-light: #2e7d32;
  --accent: #f4a261;
  --accent-hover: #e76f51;

  /* Blue Header/Footer Theme */
  --blue-primary: #0A1628;
  --blue-light: #1C3260;
  --blue-accent: #3B82F6;
  --sun: #3B82F6;

  /* Background & Text */
  --bg-dark: #0a0a0a;
  --bg-card: #111111;
  --bg-card-hover: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --text-muted: #6b6b6b;
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.15);

  /* Effects */
  --radius: 16px;
  --radius-lg: 20px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(0,0,0,0.5);
  --shadow-hover: 0 30px 80px rgba(0,0,0,0.7);
  --shadow-card: 0 10px 30px rgba(10,22,40,0.08);
  --transition: all 0.3s ease;
  --transition-slow: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Reset ───────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── SPA Page Content Wrapper ────────────── */
#page-content {
  flex: 1;
  min-height: 100vh;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

/* ── Page Fade Animations (used by template.js) ── */
.page-fade-in {
  animation: pageFadeIn 0.35s ease forwards;
}

@keyframes pageFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.page-fade-out {
  animation: pageFadeOut 0.3s ease forwards;
}

@keyframes pageFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ── Header/Footer Z-Index Layering ──────── */
#header { position: relative; z-index: 1000; }
#footer { position: relative; z-index: 100; }

/* ── Shared Container ────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

@media (min-width: 768px) { .container { padding: 0 40px; } }
@media (min-width: 1024px) { .container { padding: 0 60px; } }

/* ============================================
   HEADER — Fixed Blue Theme (All Pages)
   ============================================ */
.site-header {
  background: var(--blue-primary);
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
  min-height: 80px;
}

.site-header .logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  flex-grow: 0;
  width: auto;
  max-width: 180px;
  text-decoration: none;
}

.site-header .logo img {
  height: 60px !important;
  width: auto !important;
  max-width: 180px !important;
  max-height: 60px !important;
  object-fit: contain !important;
  transition: transform 0.3s ease;
  display: block;
}

.site-header .logo img:hover { transform: scale(1.05); }

.main-nav {
  display: flex;
  gap: 30px;
  align-items: center;
}

.main-nav a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.3s ease;
  position: relative;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active { color: var(--blue-accent); }

.main-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--blue-accent);
  border-radius: 2px;
}

.header-cta {
  background: var(--blue-accent);
  color: white;
  padding: 10px 24px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.header-cta:hover {
  background: #2563EB;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 5px;
  z-index: 1001;
}

.mobile-toggle span {
  display: block;
  width: 25px;
  height: 2px;
  background: white;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.mobile-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ============================================
   FOOTER — Blue Theme (All Pages)
   ============================================ */
.site-footer {
  background: var(--blue-primary);
  border-top: 1px solid rgba(59, 130, 246, 0.2);
  padding: 60px 20px 20px;
  margin-top: auto;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
  gap: 40px;
}

.footer-brand img {
  height: 55px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  margin-bottom: 15px;
  transition: transform 0.3s ease;
  display: block;
}

.footer-brand img:hover { transform: scale(1.05); }

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-links h4,
.footer-services h4,
.footer-contact h4 {
  color: white;
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  margin-bottom: 20px;
  font-weight: 700;
}

.footer-links a,
.footer-services a {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 10px;
  transition: color 0.3s ease;
}

.footer-links a:hover,
.footer-services a:hover { color: var(--blue-accent); }

.footer-contact p,
.footer-contact a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-contact a:hover { color: var(--blue-accent); }

.footer-contact i {
  color: var(--blue-accent);
  width: 16px;
  flex-shrink: 0;
}

.social-links {
  display: flex;
  gap: 15px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.social-links a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-accent);
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.social-links a:hover {
  background: var(--blue-accent);
  color: white;
  transform: translateY(-3px);
}

.footer-bottom {
  max-width: 1200px;
  margin: 40px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ============================================
   SHARED COMPONENTS
   ============================================ */

/* Section Label Pill */
.section-label {
  display: inline-block;
  background: linear-gradient(135deg, var(--blue-accent), var(--blue-light));
  color: white;
  padding: 8px 24px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 15px;
  border: 1px solid transparent;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #111;
  padding: 14px 32px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  animation: glow 3s infinite;
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(244, 162, 97, 0.4); }
  50% { box-shadow: 0 0 40px rgba(244, 162, 97, 0.8); }
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: white;
  padding: 14px 32px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid rgba(255,255,255,0.2);
  transition: var(--transition);
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: var(--blue-accent);
  color: var(--blue-accent);
  background: rgba(59, 130, 246, 0.1);
}

/* CTA Section (Shared) */
.cta-section {
  position: relative;
  padding: 100px 20px;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(26, 95, 42, 0.2) 0%, rgba(244, 162, 97, 0.1) 100%);
}

.cta-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, rgba(26, 95, 42, 0.2) 0%, rgba(244, 162, 97, 0.1) 100%);
  pointer-events: none;
}

.cta-glow {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(26, 95, 42, 0.3) 0%, transparent 70%);
  pointer-events: none;
}

.cta-section .container { position: relative; z-index: 2; }

.cta-section h2 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  margin-bottom: 15px;
}

.cta-section p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 35px;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: var(--bg-dark);
  padding: 16px 40px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 10px 40px rgba(244, 162, 97, 0.3);
  border: none;
  cursor: pointer;
}

.cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 60px rgba(244, 162, 97, 0.5);
}

.cta-btn i { font-size: 1.1rem; }

/* Fade Up Animation */
.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Background Mesh (Shared) */
.bg-mesh {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-mesh::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(26, 95, 42, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(244, 162, 97, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(46, 125, 50, 0.05) 0%, transparent 60%);
  animation: meshMove 20s ease-in-out infinite;
}

@keyframes meshMove {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(2%, 2%) rotate(2deg); }
  66% { transform: translate(-1%, 1%) rotate(-1deg); }
}

.bg-mesh::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) {
  .footer-container {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .footer-brand { grid-column: 1 / -1; }
}

/* Mobile (767px and below) */
@media (max-width: 767px) {
  .site-header { padding: 0 15px; }

  .header-container {
    min-height: 70px;
    padding: 10px 0;
  }

  .site-header .logo { max-width: 140px; }
  .site-header .logo img {
    height: 50px !important;
    max-height: 50px !important;
    max-width: 140px !important;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--blue-primary);
    flex-direction: column;
    padding: 20px;
    gap: 15px;
    border-top: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  }

  .main-nav.open { display: flex; }
  .main-nav a { font-size: 1rem; padding: 8px 0; }

  .mobile-toggle { display: flex; }
  .header-cta { display: none; }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .cta-section { padding: 60px 20px; }
  .cta-section h2 { font-size: 1.8rem; }

  .btn-primary, .btn-secondary {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
  .site-header .logo { max-width: 120px; }
  .site-header .logo img {
    height: 45px !important;
    max-height: 45px !important;
    max-width: 120px !important;
  }

  .header-container { min-height: 65px; }

  .section-label { font-size: 0.7rem; padding: 6px 18px; }

  .cta-section h2 { font-size: 1.5rem; }
  .cta-section p { font-size: 0.95rem; }
}

/* ============================================
   SCROLLBAR & ACCESSIBILITY
   ============================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--blue-accent);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}