/* ------------------- */
/* RESET & BASIC SETUP */
/* ------------------- */
:root {
    --color-primary: #6c74e6;        /* 500 */
    --color-primary-dark: #4d4cdb;   /* 600 */
    --color-secondary: #FFFFFF;
    --color-bg-dark: #2c2989;         /* 900 */
    --color-bg-light: #f4f6fe;       /* 50 */
    --color-bg-testimonial: #ebeefc;  /* 100 */
    --color-text-dark: #1d1e6c;       /* 950 */
    --color-text-light: #96a0ef;      /* 400 */
    --color-border: #dae0fa;         /* 200 */
    --font-primary: 'Poppins', sans-serif;
    --container-width: 1200px;
    --section-padding: 100px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-primary);
    background-color: var(--color-secondary);
    color: #4A5568; /* Default text color */
    line-height: 1.7;
    font-size: 16px;
    overflow-x: hidden;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4 {
    color: var(--color-text-dark);
    font-weight: 700;
    line-height: 1.3;
}

h1 { font-size: 3.25rem; } /* 52px */
h2 { font-size: 2.5rem; } /* 40px */
h3 { font-size: 1.5rem; } /* 24px */
h4 { font-size: 1.125rem; font-weight: 600; } /* 18px */

a {
    text-decoration: none;
    color: var(--color-text-dark);
    transition: color 0.3s ease;
}

ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-subtitle {
    max-width: 600px;
    margin-bottom: 3.5rem;
    color: #4A5568;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn--primary {
    background-color: var(--color-primary);
    color: var(--color-secondary);
    border-color: var(--color-primary);
}
.btn--primary:hover {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
}

.btn--secondary {
    background-color: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}
.btn--secondary:hover {
    background-color: var(--color-primary);
    color: var(--color-secondary);
}

.btn--tertiary {
    background-color: transparent;
    color: var(--color-secondary);
    font-weight: 500;
    padding: 0.75rem 0;
}
.btn--tertiary:hover { color: #CBD5E0; }

/* ------------------- */
/* HEADER */
/* ------------------- */
.header {
    background-color: var(--color-secondary);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header__logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1.5rem;
}
.header__logo img { height: 40px; }
.header__nav ul { display: flex; gap: 2.5rem; }
.header__nav a { color: #4A5568; font-weight: 500; }
.header__nav a:hover, .header__nav a.active { color: var(--color-primary); }
.header__menu-toggle { display: none; }


/* ------------------- */
/* HERO */
/* ------------------- */
/* ------------------- */
/* HERO - UPDATED      */
/* ------------------- */

/* This keyframe animation handles the slideshow and motion effect */
@keyframes hero-slideshow {
    0%, 30% {
        background-image: url('../constructions/cons1.jpg');
       
    }
    33%, 63% {
        background-image: url('../constructions/cons2.jpg');
        
    }
    66%, 97% {
        background-image: url('../constructions/cons3.jpg');
       
    }
    100% {
        background-image: url('../constructions/cons4.jpg');
        
    }
}

.hero {
    position: relative; /* Needed to position the overlay */
    overflow: hidden;   /* Hides parts of the image that zoom outside the box */
    padding: 6rem 0;
    color: #E2E8F0;
    
    /* --- Background Slideshow & Motion --- */
    background-size: cover;
    background-position: center;
    animation: hero-slideshow 20s linear infinite; /* 20s duration, loops forever */
}

/* This creates the dark, blurred overlay */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* Dark overlay color, derived from your --color-bg-dark variable */
    background-color: rgba(44, 41, 137, 0.7); 
    
    /* This applies the blur effect to the background */
    
    z-index: 1; /* Places the overlay above the background image */
}

.hero__container {
    position: relative; /* Needed to place content above the overlay */
    z-index: 2;         /* Places the content above the overlay */
    display: flex;
    align-items: center;
    gap: 4rem;
}

.hero__content { 
    flex: 1.5; /* Gives the text content a bit more space */
}

.hero__content h1 { 
    color: var(--color-secondary); 
    margin-bottom: 1.5rem; 
    text-shadow: 0px 2px 10px rgba(0, 0, 0, 0.3); /* Adds a subtle shadow to text for readability */
}

.hero__content > p { 
    margin-bottom: 2rem; 
    max-width: 550px; 
    font-size: 1.1rem;
    line-height: 1.8;
}

.hero__buttons { 
    display: flex; 
    align-items: center; 
    gap: 1.5rem; 
    margin-bottom: 4rem; 
    flex-wrap: wrap; 
}

/* Styling for the small showcase box */
.hero__showcase {
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 0.5rem;
    padding-right: 1.5rem;
    max-width: max-content;
    background-color: rgba(0, 0, 0, 0.2); /* Semi-transparent background */
    backdrop-filter: blur(5px); /* Further blurs just this element's background */
}

.hero__showcase img { 
    height: 60px; 
    width: 60px; 
    border-radius: 50%; 
    object-fit: cover; 
}

.hero__showcase h4 { 
    color: var(--color-secondary); 
    font-size: 1rem; 
}
.hero__showcase p { 
    font-size: 0.875rem; 
    line-height: 1.2; 
    color: #CBD5E0;
}

/* We hide the original hero image container as it's no longer needed */
.hero__image { 
    display: none; 
}

/* Responsive adjustments for the new hero section */
@media (max-width: 768px) {
    .hero__container {
        flex-direction: column;
        text-align: center;
    }
    .hero__content {
        flex-basis: auto; /* Reset flex basis */
    }
    .hero__buttons {
        justify-content: center;
    }
     .hero__showcase {
        margin: 0 auto; /* Center the showcase box */
    }
}

/* Counters Section - Highly Improved Design (More Compact) */
.counters-section {
    background-color: var(--color-bg-light);
    padding: var(--section-padding) 0; /* Uses existing section padding */
    text-align: center;
    overflow: hidden; /* Ensures no animation overflow issues */
}

.counters__container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Center items for better visual balance */
    gap: 1.8rem; /* Slightly reduced gap between cards for compactness */
    max-width: var(--container-width);
    margin: 0 auto;
}

.counter-item {
    flex: 0 0 calc(25% - 1.8rem); /* Adjust flex basis to account for reduced gap */
    min-width: 190px; /* Reduced minimum width for cards */
    padding: 1.8rem 1.0rem; /* More compact padding inside cards */
    background-color: var(--color-secondary); /* White background for cards */
    border-radius: 12px; /* Slightly reduced border-radius for a tighter feel */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08); /* Softer, slightly less prominent shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: fadeInScale 0.8s ease-out forwards; /* Initial animation */
    opacity: 0; /* Hidden by default for initial animation */
}

/* Staggered animation delay for each counter item */
.counter-item:nth-child(1) { animation-delay: 0.1s; }
.counter-item:nth-child(2) { animation-delay: 0.2s; }
.counter-item:nth-child(3) { animation-delay: 0.3s; }
.counter-item:nth-child(4) { animation-delay: 0.4s; }


.counter-item:hover {
    transform: translateY(-8px) scale(1.01); /* Slightly less pronounced lift on hover */
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12); /* Slightly stronger shadow on hover */
}

.counter-icon {
    width: 65px; /* Reduced size for circular background */
    height: 65px;
    border-radius: 50%; /* Remains a perfect circle */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.2rem; /* Reduced space between icon and number */
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15); /* Slightly smaller inner shadow */
    transition: background-color 0.3s ease, transform 0.3s ease;
}
.counter-icon img{
    width: 45px; /* Reduced size for circular background */
    height: 45px;
}

/* Specific background colors for each icon (from previous step, added to :root) */
.counter-icon.icon-projects {
    background-color: #cbd6fa;
    border: 1px solid #acbbf5;
}
.counter-icon.icon-value {
    background-color: #cbd6fa;
    border: 1px solid #acbbf5;
}
.counter-icon.icon-organizations {
    background-color: #cbd6fa;
    border: 1px solid #acbbf5;
}
.counter-icon.icon-established {
    background-color: #cbd6fa;
    border: 1px solid #acbbf5;
}

.counter-icon svg {
    width: 55%; /* SVG icon size within its container */
    height: 55%;
    stroke: var(--color-secondary); /* White color for the SVG icon */
    stroke-width: 1.8; /* Stroke width remains the same for clarity */
    transition: transform 0.3s ease;
}

.counter-item:hover .counter-icon svg {
    transform: scale(1.08); /* Slight grow on icon when hovering card */
}

.counter__number {
    font-size: 3.0rem; /* Reduced number font size for compactness */
    font-weight: 700;
    color: var(--color-text-dark); /* Dark text color for strong contrast */
    margin-bottom: 0.4rem; /* Reduced margin */
    line-height: 1.1; /* Tighter line height for numbers */
}

.counter__label {
    font-size: 1.05rem; /* Reduced label font size */
    color: var(--color-text-dark); /* Consistent dark text */
    font-weight: 500;
    opacity: 0.9;
}

/* Keyframes for initial fade-in and scale animation */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95); /* Slightly less vertical movement and scale */
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive adjustments (further refined for compactness) */
@media (max-width: 1024px) {
    .counters__container {
        gap: 1.5rem; /* Further reduced gap on tablets */
    }
    .counter-item {
        flex: 0 0 calc(50% - 1.5rem); /* 2 items per row on tablets, accounting for new gap */
        min-width: 180px; /* Allow items to be slightly smaller on tablets */
        padding: 1.5rem 0.8rem; /* More compact padding on tablets */
    }
    .counter__number {
        font-size: 2.8rem;
    }
    .counter__label {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .counters__container {
        gap: 1rem; /* Even smaller gap on medium mobiles */
    }
    .counter-item {
        flex: 0 0 100%; /* 1 item per row on smaller mobiles */
        max-width: 280px; /* Constrain width for single column */
        padding: 1.5rem 0.8rem;
    }
    .counter-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }
    .counter-icon svg {
        width: 50%;
        height: 50%;
    }
    .counter__number {
        font-size: 2.5rem;
    }
    .counter__label {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .counters-section {
        padding: 60px 0; /* Adjust section padding for very small screens */
    }
    .counter-item {
        padding: 1.2rem 0.6rem; /* Minimal padding on very small screens */
    }
    .counter__number {
        font-size: 2.2rem;
    }
    .counter__label {
        font-size: 0.9rem;
    }
}
/* ------------------- */
/* SERVICES */
/* ------------------- */
.services { padding: var(--section-padding) 0; }

.service-item {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    background-color: var(--color-secondary);
}
.service-item--horizontal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    gap: 2rem;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.04);
}
.service-item--horizontal .service-item__text a {
    color: var(--color-primary);
    font-weight: 500;
    margin-top: 1rem;
    display: inline-block;
}
.service-item--horizontal .service-item__text p { margin: 0.5rem 0; max-width: 400px; }
.service-item--horizontal .service-item__image { max-width: 200px; flex-shrink: 0; }

.service-item--accordion { cursor: pointer; }
.service-item--accordion .service-item__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
}
.service-item__toggle {
    font-size: 2rem;
    color: var(--color-primary);
    transition: transform 0.3s ease;
}
.service-item__content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease-out, opacity 0.4s ease-out, padding 0.4s ease-out;
    padding: 0 2rem;
}
.service-item--accordion.active .service-item__content {
    max-height: 200px;
    opacity: 1;
    padding: 0 2rem 1.5rem 2rem;
}
.service-item--accordion.active .service-item__toggle { transform: rotate(45deg); }

/* ------------------- */
/* PROJECTS */
/* ------------------- */
.projects {
    padding: var(--section-padding) 0;
    background-color: var(--color-bg-light);
}
.projects__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}
.project-card {
    background-color: var(--color-secondary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}
.project-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    object-position: center;
}
.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.07);
}
.project-card__content {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-grow: 1;
}
.project-card__content div { flex-grow: 1; }
.project-card__content p { font-size: 0.875rem; }
.project-card__arrow {
    background-color: #E2E8F0;
    color: #4A5568;
    height: 36px;
    width: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 1.5rem;
    flex-shrink: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin-left: 1rem;
}
.project-card:hover .project-card__arrow {
    background-color: var(--color-primary);
    color: var(--color-secondary);
}

/* ------------------- */
/* TEAM */
/* ------------------- */
.team { padding: var(--section-padding) 0; }
.team__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}
.team-member { text-align: center; }
.team-member img { 
    border-radius: 12px; 
    margin: 0 auto 1rem auto; 
    width: 180px;
    height: 180px;
    object-fit: cover;
}
.team-member h3 { margin-bottom: 0.25rem; }

/* ------------------- */
/* TESTIMONIAL */
/* ------------------- */
.testimonial {
    background-color: var(--color-bg-testimonial);
    padding: var(--section-padding) 0;
    text-align: center;
}
.testimonial__text {
    max-width: 800px;
    margin: 0 auto 2.5rem auto;
    font-size: 1.25rem;
    font-style: italic;
    color: var(--color-text-dark);
}
.testimonial__author {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
}
.testimonial__author img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }
.testimonial__author div { text-align: left; }

/* ------------------- */
/* FOOTER */
/* ------------------- */
.footer {
    background-color: var(--color-bg-dark);
    padding: 5rem 0 0;
    color: #A0AEC0;
}
.footer__container {
    display: grid;
    grid-template-columns: 2fr repeat(4, 1fr);
    gap: 3rem;
    padding-bottom: 4rem;
}
.footer__logo {
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--color-secondary);
    margin-bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.footer__logo img { height: 30px; }
.footer__col--about p { max-width: 300px; }
.footer__col h4 {
    color: var(--color-secondary);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}
.footer__col li { margin-bottom: 0.75rem; }
.footer__col a, .footer__col li { color: #A0AEC0; font-size: 0.875rem; }
.footer__col a:hover { color: var(--color-primary); }
.footer__copyright {
    border-top: 1px solid #4A5568;
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.875rem;
}

/* ------------------- */
/* RESPONSIVE STYLES */
/* ------------------- */

/* Medium Desktops & Laptops (e.g. 1200px) */
@media (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
}

/* Tablets & Small Desktops (e.g. 1024px) */
@media (max-width: 1024px) {
    :root {
        --section-padding: 80px;
    }
    h1 { font-size: 2.75rem; }
    h2 { font-size: 2.25rem; }

    .hero__container { 
        flex-direction: column; 
        text-align: center;
        gap: 2rem;
    }
    .hero__image { order: -1; }
    .hero__content > p { margin-left: auto; margin-right: auto; }
    .hero__buttons, .hero__showcase { justify-content: center; margin-left: auto; margin-right: auto; }
    
    .footer__container { 
        grid-template-columns: repeat(3, 1fr); 
        gap: 2rem;
    }
    .footer__col--about { 
        grid-column: 1 / -1; 
        text-align: center;
        margin-bottom: 2rem;
    }
    .footer__col--about p { margin: 0 auto; max-width: 500px; }
    .footer__logo { justify-content: center; }
}

/* Mobile Nav Activation & Common Mobile Styles (e.g. 768px) */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }
    h1 { font-size: 2.25rem; }
    h2 { font-size: 2rem; }
    
    .header__contact { display: none; }
    
    .header__menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 25px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1001; /* Above nav */
    }
    .header__menu-toggle span {
        width: 100%;
        height: 3px;
        background-color: var(--color-text-dark);
        border-radius: 3px;
        transition: all 0.3s ease-in-out;
    }

    .header__nav {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: var(--color-bg-dark);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        clip-path: circle(0% at top right);
        transition: clip-path 0.5s ease-out;
    }
    .header__nav.active { 
        clip-path: circle(150% at top right);
    }
    .header__nav ul { 
        flex-direction: column; 
        gap: 2rem;
    }
    .header__nav a {
        color: var(--color-secondary);
        font-size: 1.5rem;
    }

    .section-header { 
        justify-content: center; 
        text-align: center; 
    }
    .section-subtitle { 
        margin-left: auto; 
        margin-right: auto; 
    }
    .service-item--horizontal { 
        flex-direction: column; 
        text-align: center; 
    }
    .service-item--horizontal .service-item__image {
        max-width: 150px;
    }

    .projects__grid { 
        grid-template-columns: 1fr; 
    }
    
    .team__grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
    }

    .footer__container { 
        grid-template-columns: 1fr 1fr;
        text-align: left;
    }
    .footer__col--about { 
        text-align: left;
        grid-column: 1 / -1; /* Full width */
        margin-bottom: 1rem;
     }
    .footer__logo { 
        justify-content: flex-start; 
    }
}

/* Small Mobile Phones (e.g. 480px) */
@media (max-width: 480px) {
     :root {
        --section-padding: 60px;
    }
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }

    .hero__buttons { 
        flex-direction: column; 
        align-items: stretch;
        gap: 1rem; 
    }
    .hero__showcase {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
        max-width: 100%;
    }

    .service-item--horizontal,
    .service-item--accordion .service-item__header {
        padding: 1.5rem;
    }

    .testimonial__text { font-size: 1.1rem; }
    .testimonial__author {
        flex-direction: column;
        gap: 0.5rem;
    }
    .testimonial__author div { text-align: center; }

    .footer__container { 
        grid-template-columns: 1fr; 
        gap: 2rem;
    }
    .footer__col--about { text-align: center; }
    .footer__col { text-align: center; }
    .footer__logo { justify-content: center; }
    .footer__col h4 { margin-bottom: 1rem; }
}