/* Custom styles for Thermal Energy Solutions */

/* CSS Variables for Green Color Palette */
:root {
    --deep-green: #0d4b2a;
    --forest-green: #15803d;
    --primary-green: #2e7d32;
    --emerald: #10b981;
    --mint-green: #6ee7b7;
    --soft-mint: #d1fae5;
    --light-mint: #ecfdf5;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #2e7d32;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1b5e20;
}

/* Header scroll effect */
.header-scrolled {
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Hero section animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-animate {
    animation: fadeInUp 0.8s ease-out forwards;
}

.hero-animate-delay-1 {
    animation-delay: 0.2s;
}

.hero-animate-delay-2 {
    animation-delay: 0.4s;
}

.hero-animate-delay-3 {
    animation-delay: 0.6s;
}

/* Bounce animation for scroll indicator */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-10px) translateX(-50%);
    }
    60% {
        transform: translateY(-5px) translateX(-50%);
    }
}

/* Card hover effects */
.benefit-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.benefit-card:hover {
    transform: translateY(-5px);
}

/* Form focus states */
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

/* Button press effect */
button:active {
    transform: scale(0.98);
}

/* Loading spinner for form submission */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(135deg, #2e7d32 0%, #81c784 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Image overlay effect on hover */
.image-hover-zoom {
    overflow: hidden;
}

.image-hover-zoom img {
    transition: transform 0.5s ease;
}

.image-hover-zoom:hover img {
    transform: scale(1.05);
}

/* Section reveal animation */
@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal-on-scroll {
    opacity: 0;
}

.reveal-on-scroll.revealed {
    animation: reveal 0.6s ease-out forwards;
}

/* Stat counter animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile menu animation */
.mobile-menu-enter {
    animation: slideDown 0.3s ease-out forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tooltip styles */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #1f2937;
    color: white;
    font-size: 14px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Focus visible styles for accessibility */
*:focus-visible {
    outline: 2px solid #2e7d32;
    outline-offset: 2px;
}

/* Reduced motion preference */
@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;
    }
}

/* Print styles */
@media print {
    header,
    footer,
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: black;
        background: white;
    }

    a[href]::after {
        content: " (" attr(href) ")";
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-primary {
        background-color: #1b5e20 !important;
    }

    .text-gray-600 {
        color: #374151 !important;
    }
}

/* Dark mode support (optional - can be enabled later) */
/*
@media (prefers-color-scheme: dark) {
    body {
        background-color: #111827;
        color: #f9fafb;
    }
}
*/

/* ========================================
   CREATIVE GREEN BACKGROUNDS & SHAPES
   ======================================== */

/* Hero Section - Green Gradient Overlay */
#home {
    position: relative;
    overflow: hidden;
}

#home::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(16, 185, 129, 0.15) 50%, rgba(110, 231, 183, 0.2) 100%);
    clip-path: polygon(30% 0%, 100% 0%, 100% 100%, 0% 100%);
    z-index: 1;
    pointer-events: none;
}

/* Why Choose Us Section - Diagonal Triangle Shapes */
#why-us {
    position: relative;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 30%, #a7f3d0 100%);
}

#why-us::before {
    content: '';
    position: absolute;
    top: -80px;
    left: 0;
    right: 0;
    height: 150px;
    background: white;
    clip-path: polygon(0 0, 100% 0, 100% 40%, 0 100%);
    z-index: 1;
}

#why-us::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 30%, #a7f3d0 100%);
    clip-path: polygon(0 60%, 100% 0, 100% 100%, 0 100%);
    z-index: 1;
}

/* Residential Section - Soft Green Accent Shapes */
.residential-section {
    position: relative;
    background: linear-gradient(to bottom, white 0%, #f0fdf4 100%);
    overflow: hidden;
}

.residential-section::before {
    content: '';
    position: absolute;
    top: 10%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
}

.residential-section::after {
    content: '';
    position: absolute;
    bottom: 5%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, rgba(110, 231, 183, 0.1) 0%, transparent 70%);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    z-index: 0;
}

/* Commercial Section - Industrial Accent with Angular Shapes */
.commercial-section {
    position: relative;
    overflow: hidden;
}

.commercial-section::before {
    content: '';
    position: absolute;
    top: -100px;
    left: -100px;
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, transparent 70%);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    z-index: 0;
    opacity: 0.5;
}

.commercial-section::after {
    content: '';
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 500px;
    height: 500px;
    background: linear-gradient(225deg, rgba(251, 191, 36, 0.08) 0%, transparent 70%);
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
    z-index: 0;
}

/* Technology Section - Layered Green Gradients */
#technology {
    position: relative;
    background: linear-gradient(to bottom, #d1fae5 0%, #ecfdf5 50%, #f0fdf4 100%);
    overflow: hidden;
}

#technology::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 0;
    right: 0;
    height: 200px;
    background: white;
    clip-path: polygon(0 50%, 100% 0, 100% 100%, 0 100%);
    z-index: 0;
}

#technology::after {
    content: '';
    position: absolute;
    bottom: -100px;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to bottom, #d1fae5 0%, #ecfdf5 100%);
    clip-path: polygon(0 0, 100% 0, 100% 50%, 0 100%);
    z-index: 0;
}

/* Contact Section - Mint Green Accent */
#contact {
    position: relative;
    background: linear-gradient(135deg, white 0%, #ecfdf5 50%, #d1fae5 100%);
    overflow: hidden;
}

#contact::before {
    content: '';
    position: absolute;
    top: -120px;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to bottom, #d1fae5 0%, #ecfdf5 100%);
    clip-path: polygon(0 60%, 100% 0, 100% 100%, 0 100%);
    z-index: 0;
}

#contact::after {
    content: '';
    position: absolute;
    bottom: 10%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
    clip-path: polygon(30% 0%, 100% 0%, 100% 100%, 0% 100%);
    z-index: 0;
}

/* Ensure content stays above decorative shapes */
#why-us > div,
.residential-section > div,
.commercial-section > div,
#technology > div,
#contact > div {
    position: relative;
    z-index: 2;
}

/* Enhanced gradient overlays for cards */
.benefit-card {
    background: linear-gradient(135deg, white 0%, rgba(240, 253, 244, 0.5) 100%);
}

.benefit-card:hover {
    background: linear-gradient(135deg, white 0%, rgba(236, 253, 245, 0.8) 100%);
}

/* ========================================
   HOW SYSTEMS WORK TOGETHER – ICONS
   ======================================== */

.system-icon-wrap {
    position: relative;
    width: 96px;
    height: 96px;
}

.system-icon {
    width: 100%;
    height: 100%;
    border-radius: 18px;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.18);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.system-icon-wrap:hover .system-icon {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(46, 125, 50, 0.28);
}

/* numbered step badge – bottom-right corner */
.system-step-badge {
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 26px;
    height: 26px;
    line-height: 26px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: #2e7d32;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
    z-index: 2;
}

/* responsive: shrink on mobile */
@media (max-width: 639px) {
    .system-icon-wrap {
        width: 76px;
        height: 76px;
    }
}

/* ========================================
   OVERLAY LOGO + HEADER LOGO SCROLL
   ======================================== */

/* ── Logo sizing variables ── */
:root {
    --hero-logo-scale: 1.66;  /* Current: +66% (was 1.44, increased by another 15%) */
    --header-logo-height: 55px;
    --header-logo-height-mobile: 44px;
}

/* Overlay logo – large, top-left of hero */
.overlay-logo-link {
    position: absolute;
    top: 100px;
    left: 32px;
    z-index: 5; /* above bg (z-0), below text (z-10) */
    transition: opacity 0.45s ease, transform 0.45s ease;
    transform: scale(var(--hero-logo-scale));
    transform-origin: top left;
}

.overlay-logo {
    height: 207px;
    width: auto;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.40));
}

/* Header logo – hidden at page top, fades in on scroll */
.header-logo-link {
    display: flex;
    align-items: center;
}

.header-logo {
    height: var(--header-logo-height);
    width: auto;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

/* ── scrolled state ── */
body.scrolled .overlay-logo-link {
    opacity: 0;
    transform: scale(calc(var(--hero-logo-scale) * 0.5));
    pointer-events: none;
}

body.scrolled .header-logo {
    opacity: 1;
    transform: scale(1);
}

/* ── mobile ── */
@media (max-width: 639px) {
    .overlay-logo-link {
        top: 78px;
        left: 20px;
    }

    .overlay-logo {
        height: 138px;
    }

    .header-logo {
        height: var(--header-logo-height-mobile);
    }
}

/* ========================================
   BACK-TO-TOP BUTTON
   ======================================== */

.back-to-top-btn {
    position: fixed;
    bottom: 64px;
    right: 24px;
    z-index: 40;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2e7d32;
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(46, 125, 50, 0.40);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.2s ease;
}

.back-to-top-btn:hover {
    background: #1b5e20;
    transform: translateY(0) scale(1.08);
}

.back-to-top-btn:focus-visible {
    outline: 3px solid #81c784;
    outline-offset: 3px;
}

body.show-top-btn .back-to-top-btn {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
