/**
 * SolarEnergyA.com - Main Stylesheet
 * Optimized for Google PageSpeed Insights
 * Single CSS file for entire website
 */

/* ========================================
   1. CSS VARIABLES & RESET
   ======================================== */

:root {
    /* Colors */
    --color-primary: #1a5490;
    --color-secondary: #fbbf24;
    --color-accent: #10b981;
    --color-dark: #1a1a2e;
    --color-darker: #111;
    --color-light: #f8f9fa;
    --color-white: #ffffff;

    /* Text Colors */
    --color-text: #333;
    --color-text-light: #666;
    --color-text-lighter: #999;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;

    /* Typography */
    --font-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-size-base: 16px;
    --line-height-base: 1.6;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-base);
    color: var(--color-text);
    line-height: var(--line-height-base);
    background: var(--color-white);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-secondary);
}

/* ========================================
   2. LAYOUT & CONTAINERS
   ======================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

.section {
    padding: var(--spacing-xl) 0;
}

.section-sm {
    padding: var(--spacing-lg) 0;
}

/* ========================================
   3. TYPOGRAPHY
   ======================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
    color: var(--color-dark);
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

p {
    margin-bottom: var(--spacing-sm);
}

.text-center {
    text-align: center;
}

.text-light {
    color: var(--color-text-light);
}

/* ========================================
   4. HEADER & NAVIGATION
   ======================================== */

.header {
    background: var(--color-white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
    align-items: center;
}

.nav-menu a {
    color: var(--color-text);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.nav-menu a:hover {
    color: var(--color-primary);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--color-dark);
    transition: var(--transition-fast);
}

/* Dropdown Navigation */
.nav-dropdown {
    position: relative;
    padding-bottom: 0.5rem;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
}

.nav-arrow {
    font-size: 0.7rem;
    transition: transform var(--transition-fast);
}

.nav-dropdown:hover .nav-arrow {
    transform: rotate(180deg);
}

.nav-submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    min-width: 250px;
    padding: 0.5rem 0;
    list-style: none;
    z-index: 1000;
    margin-top: 0;
}

.nav-dropdown:hover .nav-submenu {
    display: block;
}

.nav-submenu li {
    padding: 0;
}

.nav-submenu a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--color-text);
    transition: background-color var(--transition-fast), color var(--transition-fast);
    white-space: nowrap;
}

.nav-submenu a:hover {
    background-color: var(--color-light);
    color: var(--color-primary);
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-white);
        flex-direction: column;
        padding: var(--spacing-md);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: var(--transition-normal);
        gap: 0;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    .nav-menu>li {
        width: 100%;
        border-bottom: 1px solid var(--color-light);
    }

    .nav-menu>li:last-child {
        border-bottom: none;
    }

    .nav-menu>li>a {
        display: block;
        padding: 1rem;
    }

    /* Mobile Dropdowns */
    .nav-dropdown-toggle {
        width: 100%;
        justify-content: space-between;
        padding: 1rem;
    }

    .nav-submenu {
        position: static;
        box-shadow: none;
        border-radius: 0;
        margin-top: 0;
        padding: 0;
        background: var(--color-light);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .nav-dropdown.active .nav-submenu {
        display: block;
        max-height: 500px;
    }

    .nav-dropdown.active .nav-arrow {
        transform: rotate(180deg);
    }

    .nav-submenu a {
        padding: 0.875rem 2rem;
        font-size: 0.95rem;
    }
}

/* ========================================
   5. BUTTONS & CTAs
   ======================================== */

.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    background: var(--color-primary);
    color: var(--color-white);
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn:hover {
    background: var(--color-dark);
    color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-whatsapp {
    background-color: #25d366;
    color: white;
}

.btn-whatsapp:hover {
    background-color: #128c7e;
    color: white;
}

.btn-secondary {
    background: var(--color-secondary);
    color: var(--color-dark);
}

.btn-secondary:hover {
    background: #f59e0b;
    color: var(--color-dark);
}

.btn-lg {
    padding: 1.25rem 3rem;
    font-size: 1.125rem;
}

.btn-nav {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
}

/* Fixed CTA Button */
.fixed-cta {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 999;
}

.btn-cta {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(26, 84, 144, 0.4);
    display: inline-block;
}

.btn-cta:hover {
    background: var(--color-dark);
    color: var(--color-white);
    transform: scale(1.05);
}

/* WhatsApp Float */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: transform var(--transition-fast);
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

/* ========================================
   6. HERO SECTION
   ======================================== */

.hero {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-white);
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.4) 0%, rgba(26, 84, 144, 0.3) 100%);
    z-index: -1;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
}

.hero h1 {
    color: var(--color-white);
    margin-bottom: var(--spacing-md);
}

.hero-lead {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-lg);
    opacity: 0.95;
}

/* ========================================
   7. GRID SYSTEMS
   ======================================== */

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

/* ========================================
   8. CARDS & BOXES
   ======================================== */

.card {
    background: var(--color-white);
    border-radius: 12px;
    padding: var(--spacing-md);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.feature-box {
    background: var(--color-white);
    border-radius: 12px;
    padding: var(--spacing-md);
    border: 1px solid #e5e7eb;
    transition: border-color var(--transition-fast);
}

.feature-box:hover {
    border-color: var(--color-primary);
}

/* ========================================
   9. FORMS
   ======================================== */

.form-control {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-base);
    transition: border-color var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(26, 84, 144, 0.1);
}

.form-group {
    margin-bottom: var(--spacing-sm);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-text);
}

/* ========================================
   10. UTILITIES
   ======================================== */

.mb-1 {
    margin-bottom: var(--spacing-xs);
}

.mb-2 {
    margin-bottom: var(--spacing-sm);
}

.mb-3 {
    margin-bottom: var(--spacing-md);
}

.mb-4 {
    margin-bottom: var(--spacing-lg);
}

.mt-1 {
    margin-top: var(--spacing-xs);
}

.mt-2 {
    margin-top: var(--spacing-sm);
}

.mt-3 {
    margin-top: var(--spacing-md);
}

.mt-4 {
    margin-top: var(--spacing-lg);
}

.bg-light {
    background: var(--color-light);
}

.bg-dark {
    background: var(--color-dark);
    color: var(--color-white);
}

.bg-primary {
    background: var(--color-primary);
    color: var(--color-white);
}

/* ========================================
   11. RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .section {
        padding: var(--spacing-lg) 0;
    }

    .hero {
        min-height: 500px;
    }

    .fixed-cta {
        bottom: 70px;
        right: 10px;
    }

    .btn-cta {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }

    .whatsapp-float {
        width: 50px;
        height: 50px;
    }
}

/* ========================================
   12. PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Lazy loading placeholder */
img[loading="lazy"] {
    background: var(--color-light);
}

/* Print styles */
@media print {

    .header,
    .footer,
    .whatsapp-float,
    .fixed-cta {
        display: none;
    }
}

/* ========================================
   12. CASE STUDY PAGES
   ======================================== */

.hero-case {
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-primary) 100%);
    color: white;
    padding: var(--spacing-xl) 0;
    text-align: center;
    min-height: 400px;
    display: flex;
    align-items: center;
    position: relative;
}

.hero-case h1 {
    color: white;
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hero-case .subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    max-width: 800px;
    margin: 0 auto;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.case-content {
    padding: var(--spacing-xl) 0;
}

.case-block {
    background: var(--color-white);
    border-radius: 12px;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.case-block h2 {
    color: var(--color-primary);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-light);
}

.case-block ul {
    list-style: none;
    padding: 0;
}

.case-block ul li {
    padding: 0.75rem 0;
    padding-left: 2rem;
    position: relative;
    line-height: 1.6;
}

.case-block ul li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--color-accent);
    font-weight: 700;
    font-size: 1.25rem;
}

.cta-case {
    background: var(--color-light);
    padding: var(--spacing-xl) 0;
    text-align: center;
}

.cta-case h2 {
    margin-bottom: var(--spacing-sm);
}

.cta-case p {
    font-size: 1.125rem;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-md);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   13. SCROLL REVEAL ANIMATIONS
   ======================================== */

/* Base animation classes */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
}

/* Fade in */
.fade-in {
    opacity: 0;
}

.fade-in.animated {
    opacity: 1;
}

/* Slide up */
.slide-up {
    opacity: 0;
    transform: translateY(50px);
}

.slide-up.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Slide left */
.slide-left {
    opacity: 0;
    transform: translateX(50px);
}

.slide-left.animated {
    opacity: 1;
    transform: translateX(0);
}

/* Slide right */
.slide-right {
    opacity: 0;
    transform: translateX(-50px);
}

.slide-right.animated {
    opacity: 1;
    transform: translateX(0);
}

/* Scale in */
.scale-in {
    opacity: 0;
    transform: scale(0.9);
}

.scale-in.animated {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delay for grid items */
.stagger-1 {
    transition-delay: 0.1s;
}

.stagger-2 {
    transition-delay: 0.2s;
}

.stagger-3 {
    transition-delay: 0.3s;
}

.stagger-4 {
    transition-delay: 0.4s;
}

.stagger-5 {
    transition-delay: 0.5s;
}

.stagger-6 {
    transition-delay: 0.6s;
}

/* Hero content animation */
.hero-content>* {
    animation: fadeInUp 1s ease forwards;
    opacity: 0;
}

.hero-content>*:nth-child(1) {
    animation-delay: 0.2s;
}

.hero-content>*:nth-child(2) {
    animation-delay: 0.4s;
}

.hero-content>*:nth-child(3) {
    animation-delay: 0.6s;
}

.hero-content>*:nth-child(4) {
    animation-delay: 0.8s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulse animation for CTAs */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.btn-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Float animation for icons */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.float-icon {
    animation: float 3s ease-in-out infinite;
}

/* ========================================
   14. MODAL
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 1000px;
    height: 80vh;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    color: #333;
    background: white;
    border: none;
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.modal-close:hover {
    transform: rotate(90deg);
    color: var(--color-primary);
}

#modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
}