/* ==========================================================================
   LOADING SCREEN STYLES
   ========================================================================== */

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, var(--deep-charcoal-grey) 0%, #0a0a0a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-container {
    text-align: center;
}

.loader {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(192, 159, 15, 0.2);
    border-top-color: var(--warm-ochre);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

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

.loading-text {
    color: var(--off-white);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 1px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ==========================================================================
   HERO SECTION ANIMATIONS
   ========================================================================== */

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideUpFromBottom {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   1. GENERAL STYLES & SETUP
   ========================================================================== */

/* --- Root Variables --- */
:root {
    /* Primary Colors */
    --moss-green: #3c5e3ddb;
    --warm-ochre: #C29F0F;
    --deep-tech-blue: #132947;
    --mid-tone-sky-blue: #5998C5;

    /* Neutral Colors */
    --deep-charcoal-grey: #171616e1;
    --off-white: #F0F0F0;
    --mid-grey: #A0A0A0;
}

/* --- Base & Reset Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    font-family: 'Poppins', sans-serif;
    color: var(--off-white);
    background-color: var(--deep-charcoal-grey);
    overflow-x: hidden;
    overflow-y: auto;
    scroll-behavior: smooth;
    scrollbar-width: none; /* For Firefox */
    -ms-overflow-style: none; /* For IE/Edge */
}

body::-webkit-scrollbar {
    display: none; /* For Chrome/Safari */
}

/* ==========================================================================
   2. REUSABLE COMPONENTS
   ========================================================================== */

.fullscreen-section {
    height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.video-background-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.video-background-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   3. PAGE STRUCTURE & SECTIONS (Order of Appearance)
   ========================================================================== */

/* --- 3.1 Header & Navigation --- */
header {
    padding-top: 0;
    margin: 0;
    animation: fadeInDown 1s ease-out;
    width: 100%;
    position: fixed; 
    top: 0;
    z-index: 3;
    transition: transform 0.3s ease-in-out;
}

header.header-hidden {
    transform: translateY(-100%);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background-color: rgba(15, 16, 15, 0.7);
    border-radius: 0;
    padding: 0.5rem 5%;
    backdrop-filter: blur(6px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}


.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
}

.logo img {
    height: 60px;
    width: auto;
}

.logo span {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--off-white);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--off-white);
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 600;
    padding-bottom: 5px;
    position: relative;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--warm-ochre);
    transition: width 0.3s ease;
}

.nav-menu a.active {
    color: var(--warm-ochre);
}

.nav-menu a:hover {
    color: var(--warm-ochre);
}

.nav-menu a:hover::after {
    width: 100%;
}

.icon-small {
    font-size: 0.8em;
}

/* --- 3.1.1 Desktop Dropdown Menu Styles --- */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: rgba(23, 22, 22, 0.85);
    backdrop-filter: blur(5px);
    min-width: 220px;
    border-radius: 8px;
    padding: 0.5rem 0;
    z-index: 10;
    list-style: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu li a {
    color: var(--off-white);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 400;
    white-space: nowrap;
}

.dropdown-menu li a:hover {
    background-color: var(--warm-ochre);
    color: var(--deep-charcoal-grey);
}

.dropdown-menu li a::after,
.dropdown > a::after {
    display: none;
}

.hamburger-menu, .close-menu {
    display: none;
    background: none;
    border: none;
    color: var(--deep-charcoal-grey);
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    /* Ensure the mobile nav overlays any page content, including hero and popups */
    z-index: 100000; /* very high to avoid conflicts */
    /* create its own stacking context to prevent descendant z-index issues */
    transform: translateZ(0);
    transition: right 0.5s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.mobile-nav.is-open {
    right: 0;
}

.mobile-nav .close-menu {
    display: block;
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 2rem;
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    width: 80%;
}

.mobile-nav ul li {
    margin: 1.5rem 0;
    text-align: center;
}

.mobile-nav ul li a {
    color: var(--deep-charcoal-grey);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

/* --- 3.1.3 Mobile Dropdown Menu Styles --- */
.mobile-dropdown-menu {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    display: none;
    overflow: hidden;
}

.mobile-dropdown-menu.is-open {
    display: block;
}

.mobile-dropdown-menu li {
    margin: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.mobile-dropdown-menu li:last-child {
    border-bottom: none;
}

.mobile-dropdown-menu li a {
    font-size: 1.1rem;
    font-weight: 400;
    padding: 0.75rem;
}

/* --- 3.2 Hero Section (#hero) --- */
#hero {
    justify-content: flex-start;
    background-image: url(../images/home-bgr2.jpeg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.134);
    z-index: 1;
}

.hero-content {
    position: absolute;
    bottom: 9rem;
    left: 5%;
    z-index: 2;
    max-width: 580px;
    text-align: left;
    padding: 1rem 3rem;
    border-radius: 10px;
    background-color: rgba(15, 16, 15, 0.589);
    
    /* Animation properties */
    opacity: 0;
    animation: slideInFromLeft 1s ease-out forwards;
}

.hero-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    padding-bottom: 0.9rem;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
    line-height: 1.2;
    padding-bottom: 1.1rem;
}

/* --- 3.2.1 Hero Bullet Points --- */
.hero-bullets {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 5%;
    background-color: rgba(15, 16, 15, 0.9);
    z-index: 2;
    
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 1rem;
    
    color: var(--off-white);
    
    /* Animation properties */
    opacity: 0;
    animation: slideUpFromBottom 1s ease-out forwards;
    animation-delay: 0.3s;
}

.bullet-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.bullet-item i {
    color: var(--warm-ochre);
    font-size: 1.5rem;
}

/* --- 3.3 About Us Section (#about) --- */

#about .logo-card {
    backdrop-filter: blur(2px);
    background-color: rgba(15, 16, 15, 0.7);
    border-radius: 10px;
    padding: 1rem;
    position: absolute;
    bottom: 5rem;
    left: 5%;
    z-index: 2;
    max-width: 500px;
    text-align: left;

    /* Initial state - hidden */
    opacity: 0;
    transform: translateX(-100px);
}

#about .logo-card.animate {
    animation: slideInFromLeft 1s ease-out forwards;
}

#about .logo-card span {
    display: block;
    text-align: center;
    color: var(--warm-ochre);
    margin-top: 1rem;
    font-weight: 600;
}

.logo-card h3 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.logo-card p {
    font-size: 1rem;
    line-height: 1.4;
    padding-bottom: 0.5rem;
}

/* --- 3.4 Services Section (#services-home) --- */
#services-home {
    background-color: var(--deep-charcoal-grey);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding-top: 6rem;
    overflow: visible;
}

.section-title {
    font-size: 2.2rem;
    position: absolute;
    left: 8%;
    top: 7%;
    /* Initial state */
    opacity: 0;
    transform: translateX(-100px);
}

.section-title.animate {
    animation: slideInFromLeft 1s ease-out forwards;
}

.card-container {
    display: flex;
    justify-content: center;
    align-self: center;
    gap: 3rem;
    width: 100%;
    margin-top: 5rem;
    padding: 0 2rem;
}

/* Service cards scale animation */
@keyframes scaleIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    70% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.service-card {
    width: 350px;
    height: 550px;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    /* Visible by default; animations run when .animate is added */
    opacity: 1;
    transform: none;
    transition: transform 0.4s ease-out;
}

.service-card.animate {
    opacity: 1;
    transform: scale(1);
    animation: scaleIn 0.8s ease-out;
}

#card-1.animate {
    animation-delay: 0s;
}

#card-2.animate {
    animation-delay: 0.15s;
}

#card-3.animate {
    animation-delay: 0.3s;
}

.service-card.animate:hover {
    transform: scale(1.05);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 15px;
    border: 4px solid transparent;
    filter: blur(7px);
    opacity: 0;
    transition: opacity 0.4s ease-out, border-color 0.4s ease-out;
}

.service-card:hover::before {
    opacity: 1;
}

.carousel-nav {
    display: none;
    justify-content: center;
    align-self: center;
    gap: 1rem;
    margin-top: 2rem;
}

.nav-cube {
    width: 12px;
    height: 12px;
    background-color: var(--mid-grey);
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.nav-cube.active {
    background-color: var(--warm-ochre);
}

.service-card .card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    color: var(--off-white);
    background-color: rgba(15, 16, 15, 0.7);
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    z-index: 2;
    backdrop-filter: blur(3px);
}

.card-content h3 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.card-content p {
    font-size: 1rem;
    line-height: 1.4;
}

#card-1 { 
    background-image: url('../images/agent-card.png'); 
    background-position: 80% center; 
    background-repeat: no-repeat; 
}

#card-2 { 
    background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), url('../images/domain-card.jpg'); 
    background-repeat: no-repeat; 
    background-position: center; 
    background-size: cover; 
}

#card-3 { 
    background-image: url('../images/infra-card.jpeg'); 
    background-repeat: no-repeat; 
}

/* --- 3.6.2 Example --- */

#example {
    background-color: rgba(15, 16, 15, 0.5);
}

.sample-card {
    width: auto;
    max-width: 300px;
    height: auto;
    position: absolute;
    bottom: 4rem;
    left: 5%;
    border-radius: 15px;
    background-color: rgba(15, 16, 15, 0.7);
    padding: 1rem;
    color: var(--off-white);
    z-index: 1;
    /* Initial state */
    opacity: 0;
    transform: translateX(-100px);
}

.sample-card.animate {
    animation: slideInFromLeft 1s ease-out forwards;
}

.sample-card:hover {
    background-color: rgba(15, 16, 15, 0.9);
}

.sample-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.sample-card p {
    font-size: 1rem;
    line-height: 1.4;
}

/* --- 3.7 Footer --- */
footer {
    height: 35vh;
    width: 100%;
    background-color: var(--deep-charcoal-grey);
    color: var(--off-white);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem;
}

.footer-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: stretch;
    width: 100%;
    gap: 2rem;
}

.footer-column {
    padding: 0;
    position: relative;
}

.footer-column:not(:first-child)::before {
    content: '';
    position: absolute;
    left: -6rem;
    top: 50%;
    transform: translateY(-50%);
    height: 80%;
    width: 1px;
    background-color: var(--mid-grey);
}

.footer-column h4 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--off-white);
}

.footer-column ul {
    list-style: none;
    padding: 0;
}

.footer-column ul li {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.footer-column ul li a {
    color: var(--mid-grey);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-column ul li a:hover {
    color: var(--warm-ochre);
}

/* ==========================================================================
   4. RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */

/* --- 4.1 Tablet & Large Mobile (max-width: 1366px) --- */
@media (max-width: 1366px) {
    
    .logo span {
        font-size: 1.3rem;
    }
    .nav-menu {
        gap: 1.5rem;
    }
    .nav-menu a {
        font-size: 1.1rem;
    }

    .hero-content {
        bottom: 6rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }
    .hero-content p {
        font-size: 1rem;
    }

    .logo-card h3 {
        font-size: 1.7rem;
        margin-bottom: 0.5rem;
    }

    .logo-card p {
        font-size: 1rem;
        line-height: 1.4;
    }

    #solutions {
        /* Allow the solutions section to size to its content instead of forcing full-viewport height */
        height: auto !important;
        min-height: auto !important;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }

    #solutions .card-container {
        justify-content: center;
        max-width: 100%; 
        /* allow horizontal scrolling if needed and prevent collapse */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        min-height: 460px;
        scroll-snap-type: none;
        gap: 1.5rem;
        padding: 1rem 2rem;
        margin-top: 5rem;
        -ms-overflow-style: auto;
        scrollbar-width: auto;
    }

    #solutions .service-card {
        width: 300px;
        min-width: 260px;
        height: 450px;
        flex-shrink: 0;
        scroll-snap-align: none;
    }

    .service-card:hover {
        transform: scale(1.05);
    }

    #solutions .card-container .service-card:first-child {
        margin-left: 0;
    }
    #solutions .card-container .service-card:last-child {
        margin-right: 0;
    }

    .carousel-nav {
        display: none;
    }

    .card-content h3 {
        margin-bottom: 0.5rem;
        font-size: 1.2rem;
    }

    .card-content p {
        font-size: 0.8rem;
        line-height: 1.3;
    }
    
    footer {
        height: auto;
        padding: 2rem 1rem;
    }
    .footer-column:not(:last-child) {
        border-right: none;
    }
    .footer-column h4 {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }
    .footer-column ul li {
        font-size: 0.8rem;
    }
    .footer-social a i {
        font-size: 18px;
    }
}

/* --- 4.2 Small Mobile (max-width: 768px) --- */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    .logo span {
        font-size: 1rem;
    }
    .hamburger-menu {
        display: block;
        color:var(--off-white);
    }

    .mobile-nav .mobile-dropdown-menu li a {
        font-size: 1rem;
        font-weight: 400;
        padding: 0.5rem;
    }
    #hero {
        background-image: url(../images/home-por.jpeg);
        /* ensure we have a positioned container and enough height for centered content */
        position: relative;
        height: 100vh;
    }
    .hero-content {
        /* Center the hero-content both horizontally and vertically inside #hero */
        position: absolute;
        top: 28%;
        left: auto;
        max-width: 300px;
        max-height: 520px;
        padding: 2rem; /* equal padding all around */
        box-sizing: border-box;
        z-index: 3;
    }
    .hero-content h1 {
        font-size: 1.1rem;
    }
    .hero-content p {
        font-size: 0.85rem;
    }

    .hero-bullets {
        /* Make the bullets act like a horizontal carousel on small screens: one visible at a time, centered */
        flex-direction: row;
        align-items: center;
        padding: 0.75rem 0;
        gap: 0;
        width: 100%;
        overflow: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    
    .bullet-item {
        font-size: 0.9rem;
        margin: 0;
        min-width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        scroll-snap-align: center;
        transition: transform 0.5s ease, opacity 0.5s ease;
        opacity: 0;
        transform: translateX(20px);
    }

    /* visible state for the active bullet */
    .bullet-item.is-active {
        opacity: 1;
        transform: translateX(0);
    }

    .bullet-item i {
        font-size: 1.2rem;
    }

    /* Removed duplicate/incorrect rule that referenced a non-existent image (hero-por.png).
       The mobile #hero background is already set above to '../images/home-por.jpeg'. */

    /* Allow #about and the logo card to size naturally on small screens so text doesn't clip */
    #about {
        position: relative;
        /* give breathing room and allow the card to expand */
        padding: 2.5rem 1rem;
        min-height: auto;
    }

    #about .logo-card {
        /* Put the card back into normal flow so it can grow with its content */
        position: relative;
        top: 5%;
        left: auto;
        transform: none;
        width: calc(100% - 2rem);
        max-width: 420px;
        margin: 0.5rem auto;
        padding: 1.25rem; /* slightly larger padding to improve readability */
        box-sizing: border-box;
        z-index: 2;
    }

    #about .logo-card h3 {
        font-size: 1.4rem;
        margin-bottom: 0.5rem;
    }

    #about .logo-card p {
        font-size: 0.95rem;
        line-height: 1.3;
    }

    #solutions .card-container {
        max-width: 300px;
        margin-top: 8rem;
        justify-content: flex-start;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 0;
        padding: 1rem 0;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    #solutions .card-container::-webkit-scrollbar {
        display: none;
    }

    #solutions .service-card {
        height: 400px;
        width: 100%;
        flex-shrink: 0;
        scroll-snap-align: center;
    }

    .service-card:hover {
        transform: none;
    }
    
    /* On small screens don't offset first/last cards — show them fully */
    #solutions .card-container .service-card:first-child {
        margin-left: 0;
    }

    #solutions .card-container .service-card:last-child {
        margin-right: 0;
    }

    .carousel-nav {
        display: flex;
        margin-top: 0.5rem;
        margin-bottom: 2rem;
    }
   
    #solutions .card-content h3 {
        font-size: 1.3rem;
    }

    #solutions .card-content p {
        font-size: 0.8rem;
    }

    footer {
        padding: 3rem 1rem;
    }
    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 2rem;
    }
    .footer-column {
        padding: 0;
        width: 100%;
    }
    .footer-column:not(:last-child) {
        padding-bottom: 2rem;
        border-bottom: 1px solid var(--mid-grey);
    }

    .footer-social {
        justify-content: center;
    }
    .footer-social a i {
        font-size: 24px;
    }

    /* On small screens: disable service-card animations entirely so they are static */
    #solutions .service-card {
        animation: none !important;
        transform: none !important;
        opacity: 1 !important;
        transition: none !important;
    }
}