/* =========== VARIABLES & GLOBAL STYLES =========== */
:root {
    --primary-blue: #005A9C;
    --primary-orange: #F37F21;
    --light-blue: #00A9E0;
    --dark-text: #1E1E1E;
    --light-text: #FFFFFF;
    --background-gray: #F5F5F5;
    --font-family: 'Poppins', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--dark-text);
    background-color: var(--light-text);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 6rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-title p {
    font-size: 1.1rem;
    color: #666;
}

.title-underline {
    width: 80px;
    height: 4px;
    background-color: var(--primary-orange);
    margin: 0.5rem auto 0;
}

.title-underline.left {
    margin-left: 0;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-orange);
    color: var(--light-text);
    border: 2px solid var(--primary-orange);
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-secondary:hover {
    background-color: var(--primary-blue);
    color: var(--light-text);
}

.section-cta {
    text-align: center;
    margin-top: 3rem;
}

.section-cta.left {
    text-align: left;
}

.bg-gray {
    background-color: var(--background-gray);
}

/* =========== HEADER =========== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
    background-color: var(--primary-blue);
    color: var(--light-text);
}

body.home-page .header:not(.scrolled) {
    background-color: transparent;
    border-bottom: none;
}

.header.scrolled {
    background-color: var(--primary-blue);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* On non-home pages, text should be dark if the header is not scrolled and solid */
.header:not(.scrolled) .nav-link {
    color: var(--light-text);
}
body:not(.home-page) .header:not(.scrolled) .nav-link {
    color: var(--light-text);
}
body:not(.home-page) .header:not(.scrolled) .header-contact-link {
    color: var(--light-text);
}


.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    position: relative;
}

.header-logo img {
    height: 40px;
    transition: filter 0.3s ease;
}

.header-contact {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-contact-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--light-text);
    transition: color 0.3s ease;
}
.header-contact-link:hover {
    color: var(--primary-orange);
}

.header-contact-link svg {
    color: var(--primary-orange);
    width: 18px;
    height: 18px;
}

.btn-small {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
}

.header-nav {
    display: flex;
    gap: 2.5rem;
}

.nav-link {
    position: relative;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 5px;
    color: var(--light-text);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: var(--primary-orange);
    transition: width 0.3s ease;
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.header-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 102;
}

.hamburger-icon {
    width: 30px;
    height: 30px;
    color: var(--light-text);
}

.hamburger-icon.close {
    display: none;
}

.header-menu-toggle.active .hamburger-icon.open {
    display: none;
}

.header-menu-toggle.active .hamburger-icon.close {
    display: block;
}


/* =========== HERO SECTION =========== */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    color: var(--light-text);
    overflow: hidden;
}

.hero-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.hero-slide.active {
    opacity: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 600px;
}

.hero-content h1 {
    font-size: clamp(2.2rem, 7vw, 3.5rem); /* Fluid typography */
    font-weight: 700;
    line-height: 1.2;
}

.hero-content p {
    font-size: clamp(1rem, 4vw, 1.2rem); /* Fluid typography */
    margin: 1.5rem 0;
    transition: opacity 0.5s ease-in-out;
}

.hero-scroll-down {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    animation: bounce 2s infinite;
}

.hero-scroll-down svg {
    width: 30px;
    height: 30px;
    color: var(--light-text);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7));
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translate(-50%, 0); }
    40% { transform: translate(-50%, -15px); }
    60% { transform: translate(-50%, -5px); }
}

/* =========== SERVICES SECTION =========== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background-color: #ccc;
    overflow: hidden;
}

.service-card {
    position: relative;
    height: 400px;
    display: flex;
    align-items: flex-end; /* Align content to the bottom */
    justify-content: center;
    text-align: center;
    color: var(--light-text);
    overflow: hidden;
    background-size: cover;
    background-position: center;
    transition: all 0.4s ease;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    transition: background 0.4s ease;
}

.service-card:hover::before {
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.2));
}

.service-card-content {
    position: relative;
    z-index: 1;
    padding: 2rem 1.5rem;
    width: 100%;
}

.service-card h3 {
    font-size: 1.6rem;
    font-weight: 700;
    text-transform: uppercase;
    transition: transform 0.4s ease;
}

.service-card p {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-top: 0.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.service-card:hover h3 {
    transform: translateY(-25px);
}

.service-card:hover p {
    opacity: 1;
    transform: translateY(0);
}

.service-card-link {
    font-weight: 600;
    display: inline-block;
    transition: transform 0.3s ease;
}

.service-card:hover .service-card-link {
    transform: translateX(5px);
}

/* =========== ABOUT SECTION =========== */
.about-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 4rem;
}

.about-text h2 {
    font-size: 2.5rem;
    font-weight: 700;
}

.about-text p {
    font-size: 1.1rem;
    color: #666;
    margin-top: 1.5rem;
}

.about-image img {
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.values-container {
    margin-top: 6rem;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    text-align: center;
}

.value-item h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 1rem;
}

/* =========== PROJECTS SECTION =========== */
.projects-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.filter-btn {
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background-color: #eee;
}

.filter-btn.active {
    background-color: var(--primary-orange);
    color: var(--light-text);
    border-color: var(--primary-orange);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.project-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.project-item.large {
    grid-column: span 2;
}

.project-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-item:hover img {
    transform: scale(1.1);
}

.project-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: var(--light-text);
}

.project-item-overlay h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.project-item-overlay p {
    color: var(--primary-orange);
    font-weight: 600;
}

/* =========== CTA SECTION =========== */
.cta-section {
    position: relative;
    background-image: url('../public/images/slide-4.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--light-text);
    padding: 6rem 0;
    text-align: center;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 90, 156, 0.8);
}

.cta-section .container {
    position: relative;
    z-index: 1;
}

.cta-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
}

.cta-section p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 1rem auto 2rem;
    color: #ddd;
}

/* =========== FOOTER =========== */
.footer {
    background-color: var(--dark-text);
    color: var(--light-text);
    padding: 5rem 0 2rem;
}

.footer-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
}

.footer-logo {
    height: 40px;
    filter: brightness(0) invert(1);
}

.footer-col p {
    margin-top: 1.5rem;
    color: #aaa;
}

.footer-col h4 {
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

.footer-col ul li {
    margin-bottom: 0.8rem;
}

.footer-col a:hover {
    color: var(--primary-orange);
}

.footer-socials {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

.footer-bottom {
    text-align: center;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #333;
    color: #888;
}

/* =========== SERVICE DETAIL PAGE =========== */
.service-detail-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 5rem;
}

.service-detail-item.reverse {
    direction: rtl; /* This will reverse the order of columns */
}

.service-detail-item.reverse > * {
    direction: ltr; /* Reset direction for the content inside */
}

.service-detail-image img {
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
}

.service-detail-text h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.service-detail-text p {
    margin-bottom: 1.5rem;
    color: #555;
}

.service-list {
    list-style: none;
    padding-left: 0;
}

.service-list li {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
}

.service-list li::before {
    content: '✔';
    color: var(--primary-orange);
    font-weight: bold;
    margin-right: 0.75rem;
    margin-top: 2px;
}


/* =========== CONTACT PAGE =========== */
.contact-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: flex-start;
}

.contact-form .form-group, .contact-form .form-group-grid {
    margin-bottom: 1.5rem;
}

.contact-form .form-group-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: var(--font-family);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-orange);
}

.contact-details .contact-info-card {
    background-color: var(--background-gray);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.contact-details .contact-info-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.contact-details .contact-info-card address p {
    margin-bottom: 0.8rem;
}

.contact-map {
    height: 300px;
}


/* =========== VALUE ICONS =========== */
.value-icon {
    color: var(--primary-orange);
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
}

.value-icon svg {
    width: 100%;
    height: 100%;
}


/* =========== HERO SLIDESHOW NAVIGATION =========== */
.hero-nav {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 4; /* Above overlay */
    transform: translateY(-50%);
}

.slide-arrow {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    font-size: 2rem;
    font-weight: 100;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.slide-arrow:hover {
    background-color: rgba(255, 255, 255, 0.4);
}


/* =========== MOBILE MENU OVERLAY =========== */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 90, 156, 0.98); /* primary-blue with transparency */
    z-index: 101;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    margin-bottom: 3rem;
}

.mobile-nav-link {
    color: white;
    font-size: 1.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.mobile-nav-contact {
    text-align: center;
    color: #aaa;
}

.mobile-nav-contact a {
    display: block;
    margin-top: 1rem;
    color: #fff;
    font-size: 1.1rem;
}

/* =========== RESPONSIVE STYLES =========== */
@media (max-width: 1024px) {
    .header-nav, .header-contact, .hero-nav {
        display: none;
    }
    .header-menu-toggle {
        display: block;
    }
}

@media (max-width: 992px) {
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .about-container { grid-template-columns: 1fr; }
    .values-grid { grid-template-columns: repeat(2, 1fr); }
    .projects-grid { grid-template-columns: repeat(2, 1fr); }
    .project-item.large { grid-column: span 1; }
    .team-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-container { grid-template-columns: 1fr 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .service-detail-item,
    .service-detail-item.reverse {
        grid-template-columns: 1fr;
        direction: ltr;
    }
}

@media (max-width: 768px) {
    .hero-content {
        max-width: 90%;
        margin: 0 auto;
        text-align: center;
    }
    .hero-content h1 {
        font-size: 1.9rem !important; /* Force size override */
        word-wrap: break-word; /* Force line break */
    }
    .hero-content p {
        font-size: 1rem !important; /* Force size override */
    }

    .section { padding: 4rem 0; }
    .section-title h2 { font-size: 2rem; }
    .projects-grid { grid-template-columns: 1fr; }
    .footer-container { grid-template-columns: 1fr; }
    .values-grid { grid-template-columns: 1fr; }
    .services-grid { grid-template-columns: 1fr; }
    .team-grid { grid-template-columns: 1fr; }


}

/* Specific override for small mobile to prevent overflow */
@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 1.8rem; /* Smaller font size for small devices */
        line-height: 1.3;  /* Tighter line height for wrapped text */
    }
    .hero-content p {
        font-size: 0.9rem;
    }
}

/* =========== RANDOM POPUP =========== */
.random-popup {
    border: none;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 0;
    max-width: 80vw;
    max-height: 80vh;
    overflow: visible; /* Allow button to be outside */
    margin: auto; /* This ensures the dialog is centered */
}

.random-popup[open] {
    animation: popup-fade-in 0.4s ease forwards;
}

.random-popup::backdrop {
    background-color: rgba(0, 45, 78, 0.5);
    backdrop-filter: blur(5px);
}

.popup-content {
    position: relative;
}

.popup-content img {
    max-height: 80vh;
    max-width: 100%;
    border-radius: 10px;
    display: block;
}

.popup-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.popup-close-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

@keyframes popup-fade-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes popup-fade-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* =========== TEAM PAGE (Mobile-First Architecture) =========== */

/* Default (Mobile) Styles */
.team-grid {
    display: grid;
    grid-template-columns: 1fr; /* 1 column by default */
    gap: 2rem;
}

.team-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    text-align: center;
    /* Animation styles */
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out, box-shadow 0.3s ease;
}

.team-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.team-image-wrapper {
    width: 150px;
    height: 150px;
    margin: 0 auto 1.5rem auto;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.team-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-content {
    padding: 1.5rem;
}

.team-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 0.25rem;
}

.team-title {
    font-size: 0.9rem;
    color: var(--primary-orange);
    font-weight: 500;
    margin-bottom: 1rem;
}

.team-bio {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.team-socials {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.team-socials a {
    color: #ccc;
    transition: color 0.3s ease;
}

/* Tablet and larger screens */
@media (min-width: 768px) {
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .team-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    }

    .team-socials a:hover {
        color: var(--primary-orange);
    }
}

/* Desktop and larger screens */
@media (min-width: 1024px) {
    .team-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
