/* 
   Hidropower SA - Design System 
   Theme: Premium Corporate, Clean Energy, Infrastructure
*/

:root {
    /* Color Palette */
    --color-primary: #0f172a;
    /* Slate 900 - Keeps Primary Dark Blue for accents/footer/logo */
    --color-primary-dark: #ffffff;
    /* Changed to pure white for main background */
    --color-accent: #0ea5e9;
    /* Sky 500 - Electric Blue */
    --color-accent-hover: #38bdf8;
    /* Sky 400 */
    --color-secondary: #10b981;
    /* Emerald 500 - Sustainable Green */

    --color-text-main: #0f172a;
    /* Inverted: Slate 900 (Dark) */
    --color-text-muted: #475569;
    /* Inverted: Slate 600 */

    --color-surface: rgb(228, 222, 222);
    /* Glassy White */
    --color-surface-hover: rgba(255, 255, 255, 0.9);
    --color-border: rgba(15, 23, 42, 0.1);
    /* Darker border for light bg */

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --container-width: 1200px;
    --header-height: 80px;

    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --backdrop-blur: blur(12px);
    --transition: all 0.3s ease;
}

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-primary-dark);
    color: var(--color-text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.bg-darker {
    background-color: rgba(0, 0, 0, 0.2);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.75rem;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-secondary) 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-accent);
    color: var(--color-text-main);
}

.btn-outline:hover {
    background: rgba(14, 165, 233, 0.1);
    transform: translateY(-2px);
}

.section-padding {
    padding: 6rem 0;
}

.section-header {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    color: var(--color-primary);
    /* Changed to dark primary */
}

.section-line {
    width: 60px;
    height: 4px;
    background: var(--color-accent);
    margin-top: 1rem;
    border-radius: 2px;
}

.center-btn {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    height: var(--header-height);
    background: #ffffff;
    /* pure white */
    border-bottom: 1px solid var(--color-border);
    /* overflow: hidden; Removed to allow dropdowns */
    /* Prevent mobile menu/content leak */
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--color-primary);
    /* HIDRO becomes Dark Blue */
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 4px;
}

.logo span {
    color: var(--color-accent);
    /* POWER becomes blue */
}

/* Ensure HIDRO wrapper (first span) is dark if wrapped */
.logo span:first-child {
    color: var(--color-primary);
}

.logo span:last-child {
    color: var(--color-accent);
}

.nav-menu {
    display: flex;
    /* Ensure horizontal */
    gap: 2rem;
    flex-direction: row;
    /* Force row */
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-muted);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-accent);
    /* Highlight with blue instead of white/invisible */
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Dropdown */
.nav-item {
    position: relative;
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-primary);
    border: 1px solid var(--color-border);
    min-width: 240px;
    padding: 1rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    border-radius: 4px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

.nav-item:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-link {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #cbd5e1;
    /* Lighter color for better readability on dark bg */
    font-size: 0.85rem;
    border-left: 2px solid transparent;
}

.dropdown-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.03);
    border-left-color: var(--color-accent);
}

/* Language Switcher */
.lang-switch {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    border-left: 1px solid var(--color-border);
    padding-left: 1.5rem;
    margin-left: 0.5rem;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
}

.lang-btn:hover,
.lang-btn.active {
    color: var(--color-accent);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: var(--header-height);
    /* Base Image Layer */
    background-image: url('../images/hero-worker.jpg');
    background-size: cover;
    background-position: center;
    /* background-attachment: fixed; */
    /* Removed to allow natural scroll */
    background-attachment: scroll;
    overflow: hidden;
}

/* White Blur Overlay + Color Tints */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        /* Color Tints */
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.2), transparent 60%),
        radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.15), transparent 60%),
        /* White Glass Overlay */
        rgba(255, 255, 255, 0.3);
    /* Slightly more transparent for clarity */
    backdrop-filter: blur(3px);
    /* Reduced blur for clarity */
    z-index: 1;
}

.hero-content {
    max-width: 900px;
    position: relative;
    z-index: 10;
}

.section-subtitle {
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: block;
}

.hero h1 {
    font-size: 4.5rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--color-primary), #334155);
    /* Dark gradient */
    -webkit-background-clip: text;
    background-clip: text;
    /* Fix lint */
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.hero p {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    margin-bottom: 3rem;
    max-width: 650px;
}

/* Stats Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-card {
    padding: 2rem;
    background: var(--color-surface);
    border: 1px solid rgba(15, 23, 42, 0.2);
    /* More visible border */
    border-radius: 8px;
    backdrop-filter: blur(5px);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    /* Subtle shadow for depth */
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(14, 165, 233, 0.3);
}

.stat-number {
    font-size: 3rem;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Features/Sectors Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: #f1f5f9;
    /* Grey background */
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.feature-card.compact {
    padding: 1.5rem 2rem;
    background-color: #ffffff !important;
}

.feature-card:hover {
    background: var(--color-surface-hover);
    transform: translateY(-8px);
    border-color: rgba(16, 185, 129, 0.3);
    /* Green hint on hover */
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-primary);
}

.feature-card p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--color-primary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.project-image-placeholder {
    height: 220px;
    width: 100%;
}

.project-content {
    padding: 2rem;
}

.project-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--color-secondary);
    color: #020617;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 50px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.project-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    color: white;
    /* Ensure visibility on dark background */
}

.project-card p {
    color: #cbd5e1;
    /* Lighter color for readability on dark background */
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.read-more {
    color: var(--color-accent);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.read-more:hover {
    gap: 0.75rem;
}

/* Partners */
.partners-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4rem;
    align-items: center;
    opacity: 0.7;
}

.partner-logo {
    padding: 1rem 2rem;
    border-radius: 12px;
    background: #f1f5f9;
    /* Grey background */
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    min-width: 220px;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.partner-logo img {
    max-height: 80px;
    max-width: 100%;
    object-fit: contain;
    transition: var(--transition);
}

.partner-logo:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Partner Carousel (Marquee) */
.partners-marquee {
    overflow: hidden;
    position: relative;
    width: 100%;
    padding: 2rem 0;
    /* Edge Fades */
}

.partners-marquee::before,
.partners-marquee::after {
    content: "";
    position: absolute;
    top: 0;
    width: 150px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.partners-marquee::before {
    left: 0;
    background: linear-gradient(to right, var(--color-primary-dark), transparent);
}

.partners-marquee::after {
    right: 0;
    background: linear-gradient(to left, var(--color-primary-dark), transparent);
}

.marquee-content {
    display: flex;
    gap: 4rem;
    width: max-content;
    animation: scroll 30s linear infinite;
}

/* Team Section */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.team-card {
    display: flex;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.team-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-accent);
}

.team-img-wrapper {
    flex: 0 0 140px;
    background: linear-gradient(45deg, #0f172a, #1e293b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.1);
}

.team-info {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.team-name {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: white;
    margin-bottom: 0.25rem;
}

.team-role {
    color: var(--color-accent);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.team-bio {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .team-grid {
        grid-template-columns: 1fr;
    }

    .team-card {
        flex-direction: column;
    }

    .team-img-wrapper {
        height: 180px;
        flex: none;
    }
}

.marquee-content:hover {
    animation-play-state: paused;
}

@keyframes scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(calc(-50% - 2rem));
    }
}

/* Footer */
footer {
    background: var(--color-primary-dark);
    /* White Background */
    color: var(--color-text-muted);
    /* Dark Text */
    border-top: 1px solid var(--color-border);
    padding: 5rem 0 2rem;
}

/* Footer Headers need to be dark */
.footer-col h4 {
    color: var(--color-primary);
}

/* Override footer specific text colors (reset to default muted) */
.footer-col p,
.footer-col ul li a {
    color: var(--color-text-muted);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-col h4 {
    margin-bottom: 1.5rem;
    color: white;
}

.footer-col ul li {
    margin-bottom: 0.75rem;
}

.footer-col ul li a {
    color: var(--color-text-muted);
    transition: var(--transition);
}

.footer-col ul li a:hover {
    color: var(--color-primary);
    /* Dark Blue on Hover */
    font-weight: 600;
}

.footer-col p {
    color: var(--color-text-muted);
    margin-top: 1rem;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid var(--color-border);
    padding: 2rem 0;
    color: #94a3b8;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

/* Animation Utilities */
.fade-in {
    opacity: 0;
    animation: fadeIn 1s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1002;
}

.bar {
    width: 26px;
    height: 2px;
    background-color: var(--color-primary);
    /* Dark bars for light bg */
    transition: var(--transition);
}

@media (max-width: 900px) {
    .hero h1 {
        font-size: 3.5rem;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: #020617;
        flex-direction: column;
        padding: 5rem 2rem;
        transform: translateX(100%);
        transition: transform 0.4s ease-in-out;
        z-index: 1001;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }
}

/* Logo Video */
.logo video {
    height: 32px;
    width: 32px;
    vertical-align: middle;
    margin: 0 4px;
    object-fit: cover;
    border-radius: 4px;
}

/* Removed CSS Animation - Video provides movement */

/* Logo Animation */
.logo-icon {
    height: 32px;
    width: 32px;
    object-fit: contain;
    /* Ensures square aspect ratio to prevent wobble */
    vertical-align: middle;
    margin: 0;
    transform-origin: center center;
    border-radius: 50%;
    /* Optional */
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Search Bar */
.search-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    margin-right: 1rem;
}

.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.search-btn:hover {
    color: var(--color-accent);
}

.search-btn svg {
    width: 20px;
    height: 20px;
}

.search-input-wrapper {
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    display: none;
    /* Hidden by default */
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    min-width: 250px;
    margin-top: 5px;
}

.search-input-wrapper.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.search-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.9rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* Carousel & Fade Animations */
.project-image-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.project-image-carousel img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    animation: fadeLoop 16s infinite;
    z-index: 1;
}

.project-image-carousel img:nth-child(1) {
    animation-delay: 0s;
}

.project-image-carousel img:nth-child(2) {
    animation-delay: 4s;
}

.project-image-carousel img:nth-child(3) {
    animation-delay: 8s;
}

.project-image-carousel img:nth-child(4) {
    animation-delay: 12s;
}

.carousel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2;
}

@keyframes fadeLoop {
    0% {
        opacity: 0;
    }

    6% {
        opacity: 1;
    }

    25% {
        opacity: 1;
    }

    31% {
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}

.status-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-development {
    background: var(--color-accent);
    color: white;
}