/* =========================================
   1. පාලන විචල්‍යයන් (CSS Variables)
   ========================================= */
:root {
    --white: #FFFFFF;      /* Primary */
    --black: #121212;      /* Secondary */
    --dark-gold: #996515;  /* Accent */
    --light-grey: #f4f4f4;
    --text-grey: #666;
}

/* =========================================
   2. මූලික සැකසුම් (Global Resets)
   ========================================= */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Poppins', sans-serif; 
}

body { 
    background-color: var(--white); 
    color: var(--black); 
    line-height: 1.6; 
    overflow-x: hidden; 
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.section-padding { padding: 80px 0; }

/* Scroll Animation (Reveal) */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.9s ease-out;
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   3. Navigation & Header
   ========================================= */
.top-bar { background: var(--black); color: var(--white); padding: 12px 0; font-size: 14px; }
.top-info span { margin-right: 20px; }

.top-social a { 
    color: var(--white); 
    margin-left: 18px; 
    font-size: 15px;
    transition: 0.3s ease; 
    display: inline-block;
}
.top-social a:hover { 
    color: var(--dark-gold); 
    transform: translateY(-3px);
}

.main-nav { 
    background: var(--white); 
    padding: 25px 0; 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); 
}
.logo { font-size: 22px; font-weight: 800; color: var(--black); letter-spacing: 1px; }
.gold-icon { color: var(--dark-gold); }

.nav-links { list-style: none; display: flex; }
.nav-links li a { 
    text-decoration: none; 
    color: var(--black); 
    font-weight: 600; 
    padding: 10px 15px; 
    font-size: 14px; 
    transition: 0.3s; 
}
.nav-links li a:hover, .nav-links li a.active { color: var(--dark-gold); }

/* =========================================
   4. Hero Slider
   ========================================= */
.hero-slider {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    background-color: #000;
}

.hero-slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease-in-out, visibility 1s;
    z-index: 1;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.hero-content { color: var(--white); max-width: 900px; padding: 0 20px; }
.hero-content h1 { font-size: 65px; font-weight: 700; margin: 20px 0; line-height: 1.1; }
.hero-content h4 { font-size: 20px; letter-spacing: 3px; text-transform: uppercase; }

.hero-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}
.hero-slide.active .hero-reveal { opacity: 1; transform: translateY(0); }

.btn-gold { 
    background: var(--dark-gold); 
    border: none; 
    padding: 18px 40px; 
    color: white; 
    font-weight: 700; 
    cursor: pointer; 
    transition: 0.3s; 
}
.btn-gold:hover { background: #000000; color: #FFFFFF; }
.slider-nav {
    position: absolute;
    top: 50%; width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 10;
    transform: translateY(-50%);
}
.slider-nav span {
    width: 50px; height: 50px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; cursor: pointer; transition: 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.slider-nav span:hover { background: var(--dark-gold); border-color: var(--dark-gold); }

/* =========================================
   5. About Us Section (Security Theme)
   ========================================= */
.gold-text {
    color: var(--dark-gold);
    font-size: 14px;
    letter-spacing: 3px;
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

.about-content {
    text-align: center;
    max-width: 850px;
    margin: 0 auto;
}

.about-content p {
    font-size: 16px;
    color: var(--text-grey);
    line-height: 1.8;
    margin-bottom: 50px;
}

.about-features-grid {
    display: flex;
    justify-content: center;
    gap: 60px;
    flex-wrap: wrap;
}

.about-feat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: 0.3s;
}

.feat-icon-box {
    width: 70px;
    height: 70px;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 15px;
    font-size: 24px;
    color: var(--dark-gold);
    transition: 0.4s ease;
}

.about-feat-item h5 {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
}

.about-feat-item:hover .feat-icon-box {
    background: var(--dark-gold);
    color: var(--white);
    border-color: var(--dark-gold);
    transform: translateY(-5px);
}

/* =========================================
   6. Components (Grid, Cards, Stats)
   ========================================= */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.card { border: 1px solid #eee; transition: 0.3s; background: var(--white); }
.card:hover { transform: translateY(-10px); box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.card-img { position: relative; height: 250px; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }

.badge { position: absolute; top: 15px; left: 15px; color: white; padding: 6px 15px; font-size: 11px; font-weight: 700; }
.badge.sale { background: #e74c3c; }
.badge.rent { background: var(--dark-gold); }
.badge.new { background: #f1c40f; color: black; }

.card-body { padding: 25px; }
.price { color: var(--dark-gold); font-size: 24px; margin: 10px 0; font-weight: 700; }
.meta { border-top: 1px solid #eee; padding-top: 10px; font-size: 13px; color: var(--text-grey); }

/* Updated Slim Stats Counter */
.stats { 
    background: var(--black); 
    color: white; 
    padding: 50px 0; 
    text-align: center; 
    border-top: 1px solid rgba(255,255,255,0.05);
}
.stat-item i { font-size: 35px; color: var(--dark-gold); margin-bottom: 10px; }
.stat-item h2 { font-size: 32px; font-weight: 800; margin-bottom: 5px; }
.stat-item p { font-size: 12px; letter-spacing: 2px; color: #999; }

.section-title { text-align: center; margin-bottom: 50px; }
.divider { height: 2px; width: 70px; background: var(--dark-gold); margin: 20px auto; position: relative; }
.divider span { 
    position: absolute; width: 10px; height: 10px; 
    background: var(--dark-gold); top: -4px; left: 50%; 
    transform: translateX(-50%) rotate(45deg); 
}

/* =========================================
   7. Footer & Google Map
   ========================================= */
footer { background: var(--black); color: #999; padding: 80px 0 0; }
.footer-top { padding-bottom: 40px; }
footer h4 { color: white; margin-bottom: 25px; font-size: 18px; position: relative; }
footer h4 span { color: var(--dark-gold); }
footer ul { list-style: none; }
footer ul li { padding: 10px 0; border-bottom: 1px solid #222; cursor: pointer; transition: 0.3s; }
footer ul li:hover { color: var(--dark-gold); padding-left: 1px; }

.f-social { display: flex; gap: 12px; margin-top: 5px; }
.f-social a { 
    background: #222; color: var(--white); width: 38px; height: 38px; 
    display: flex; align-items: center; justify-content: center; 
    border-radius: 4px; transition: 0.3s; text-decoration: none;
}
.f-social a:hover { background: var(--dark-gold); transform: scale(1.1); }

.map-container {
    width: 100%; margin-top: 15px;
    border: 1px solid #333; border-radius: 5px; overflow: hidden;
}

.footer-bottom { background: #000; padding: 25px 0; text-align: center; font-size: 13px; color: #666; }

/* =========================================
   8. Responsive Design (Optimized Mobile)
   ========================================= */
.menu-toggle { display: none; font-size: 26px; cursor: pointer; color: var(--black); }

@media (max-width: 991px) {
    .top-bar { display: none; }
    .main-nav { padding: 12px 0 !important; }
    .logo { font-size: 18px; }
    .menu-toggle { display: block !important; }

    .nav-links {
        position: fixed;
        top: -100%; left: 0; width: 100%;
        background: var(--white);
        transition: 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        z-index: 999;
        flex-direction: column;
        padding: 30px 0;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    }

    .nav-links.active { top: 60px; }
    .nav-links li { margin: 15px 0; }
    .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 20px; }

    /* Reduced spacing for About Us Features on mobile */
    .about-features-grid { 
        gap: 15px !important; 
    }
    .about-content p {
        margin-bottom: 25px !important; 
    }
    .feat-icon-box {
        width: 60px;
        height: 60px;
        font-size: 20px;
        margin-bottom: 8px;
    }

    .section-padding { padding: 40px 0; }
    .hero-slider { height: 70vh; }
}

/* =========================================
   Why Us Section - FAIL PROOF VERSION
   ========================================= */

.why-us-section {
    padding: 40px 0 !important; /* Forces consistent spacing */
    background: var(--white);
    overflow: hidden;
}

.split-layout {
    display: flex;
    align-items: center;
    gap: 60px;
}

.gallery-col {
    flex: 1;
    position: relative;
    height: 500px; /* Forced height for Desktop */
    min-height: 500px;
    border-radius: 8px;
    overflow: hidden;
    background: #000; /* If image fails, box stays black */
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.gallery-slider {
    width: 100%;
    height: 100%;
    position: relative;
}

.gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 1;
    animation: galleryFade 15s infinite ease-in-out;
}

/* Force first image to be visible immediately */
.gallery-slide:first-child { opacity: 1; }

.gallery-slide img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

/* Animation Delays */
.gallery-slide:nth-child(1) { animation-delay: 0s; }
.gallery-slide:nth-child(2) { animation-delay: 5s; }
.gallery-slide:nth-child(3) { animation-delay: 10s; }

@keyframes galleryFade {
    0% { opacity: 0; z-index: 1; }
    5% { opacity: 1; z-index: 2; }
    33% { opacity: 1; z-index: 2; }
    38% { opacity: 0; z-index: 1; }
    100% { opacity: 0; z-index: 1; }
}

.content-col { flex: 1; }
.section-title.left-align { text-align: left; margin-bottom: 20px; }
.divider.left-align { margin: 15px 0; }
.divider.left-align span { left: 0; transform: rotate(45deg); }
.why-list { list-style: none; margin: 20px 0 30px; }
.why-list li { margin-bottom: 12px; display: flex; align-items: center; font-weight: 600; }
.why-list li i { color: var(--dark-gold); margin-right: 12px; }

/* =========================================
   STRICT MOBILE OVERRIDES (Fixed Disappearing)
   ========================================= */
@media (max-width: 991px) {
    .split-layout {
        flex-direction: column !important;
        display: block !important; /* Switch from flex to block for stability */
    }

    .gallery-col {
        display: block !important;
        width: 100% !important;
        height: 300px !important; /* FORCED height on mobile */
        min-height: 300px !important; 
        margin-bottom: 30px;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .content-col {
        text-align: center !important;
        width: 100% !important;
        display: block !important;
    }

    .section-title.left-align { text-align: center; }
    .divider.left-align { margin: 15px auto; }
    .divider.left-align span { left: 50%; transform: translateX(-50%) rotate(45deg); }
    .why-list li { justify-content: center; }

    .btn-gold {
        display: block !important;
        margin: 0 auto !important; /* Centers the button */
        width: fit-content;
    }
}

/* =========================================
   Elite Professional CTA Style
   ========================================= */
.elite-cta-section {
    padding: 100px 0;
    background-color: #ffffff00; /* Deep professional charcoal */
    
}

.elite-cta-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1c1c1c; /* Slightly lighter box for depth */
    padding: 60px;
    position: relative;
    border-left: 5px solid var(--dark-gold); /* The Highlighting Gold Bar */
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.elite-cta-content {
    flex: 1;
    padding-right: 40px;
}

.elite-cta-content h2 {
    color: #fff;
    font-size: 38px;
    font-weight: 700;
    line-height: 1.2;
    margin: 10px 0;
}

.elite-cta-content h2 .highlight {
    color: var(--dark-gold);
}

.elite-cta-content p {
    color: #aaa;
    font-size: 16px;
    max-width: 600px;
    margin-top: 20px;
}

/* Button Styling */
.btn-gold-elite {
    background: var(--dark-gold);
    color: #fff;
    text-decoration: none;
    padding: 22px 45px;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    letter-spacing: 1px;
    border: 1px solid var(--dark-gold);
}

.btn-gold-elite i {
    font-size: 20px;
}

.btn-gold-elite:hover {
    background: transparent;
    color: var(--dark-gold);
    transform: scale(1.05);
}

/* =========================================
   STRICT MOBILE FRIENDLY (Fully Optimized)
   ========================================= */
@media (max-width: 991px) {
    .elite-cta-section {
        padding: 60px 0;
    }

    .elite-cta-wrapper {
        flex-direction: column;
        padding: 40px 25px;
        text-align: center;
        border-left: none;
        border-top: 5px solid var(--dark-gold); /* Moves gold accent to top for mobile */
    }

    .elite-cta-content {
        padding-right: 0;
        margin-bottom: 35px;
    }

    .elite-cta-content h2 {
        font-size: 28px;
    }

    .elite-cta-content p {
        font-size: 15px;
        margin: 15px auto 0;
    }

    .btn-gold-elite {
        width: 100%;
        justify-content: center;
    }

    .divider.left-align {
        margin: 20px auto; /* Centers divider on mobile */
    }
}

/* =========================================
   Professional Client Logo Styles (Seamless)
   ========================================= */
.clients-section {
    background-color: #ffffff;
    padding: 20px 0;
    overflow: hidden;
}

.clients-subtext {
    max-width: 750px;
    margin: 0 auto 50px;
    color: var(--text-grey);
    text-align: center;
    font-size: 16px;
    line-height: 1.7;
}

.logo-slider-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    background: #fff;
}

/* The Track Math: 250px (logo width) * 20 (total logos) = 5000px */
.logo-track {
    display: flex;
    width: 5000px; 
    animation: seamlessForward 35s linear infinite; /* 'linear' is key for no stops */
}

/* Pause on hover is removed as per your request for "always running" */
.client-logo {
    width: 250px; /* Fixed width prevents gaps */
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevents logos from squishing */
}

.client-logo img {
    max-width: 160px;
    height: auto;
    filter: none !important; /* Real colors */
    opacity: 1 !important;    /* Full brightness */
    transition: transform 0.3s ease;
}

.client-logo img:hover {
    transform: scale(1.1);
}

/* The Keyframe Math: Move exactly half the track (10 logos) */
@keyframes seamlessForward {
    0% { transform: translateX(0); }
    100% { transform: translateX(-2500px); } /* 250px * 10 */
}

/* =========================================
   MOBILE RESPONSIVENESS (Fixed Math)
   ========================================= */
@media (max-width: 768px) {
    /* 150px (mobile logo width) * 20 = 3000px */
    .logo-track {
        width: 3000px;
        animation: seamlessMobile 20s linear infinite;
    }
    
    .client-logo {
        width: 150px;
    }

    .client-logo img {
        max-width: 110px;
    }

    @keyframes seamlessMobile {
        0% { transform: translateX(0); }
        100% { transform: translateX(-1500px); } /* 150px * 10 */
    }
    
    .clients-subtext {
        font-size: 14px;
        padding: 0 15px;
    }
}

/* =========================================
   MOBILE HERO TEXT ADJUSTMENTS
   ========================================= */
@media (max-width: 768px) {
    /* Main Large Title */
    .hero-content h1 {
        font-size: 32px !important; /* Reduced from 65px/70px */
        line-height: 1.2;
        letter-spacing: 0;
        margin: 8px 0 20px;
    }

    /* Small Sub-title (Gold Text) */
    .hero-content h4 {
        font-size: 12px !important; /* Reduced from 18px/20px */
        letter-spacing: 2px;
    }

    /* Hero Description (if you have it) */
    .hero-content p {
        font-size: 14px;
        line-height: 1.5;
        max-width: 100%;
        margin-bottom: 25px;
    }

    /* Adjust Button for Mobile */
    .btn-gold {
        padding: 14px 30px;
        font-size: 13px;
    }
    
    /* Ensure the content box doesn't hit screen edges */
    .hero-content {
        padding: 0 15px;
    }
}

