@import url('https://fonts.googleapis.com/css2?family=Amiri:ital@0;1&family=Lalezar&family=Reem+Kufi:wght@400..700&display=swap');
:root {
    --primary-color: #2e7d32;
    --primary-hover: #1b5e20;
    --accent-color: #e65100;
    --text-main: #2d3748;
    --text-muted: #718096;
    --bg-light: #f7fafc;
    --bg-card: #ffffff;
    --radius-lg: 16px;
    --radius-md: 10px;
    --transition-smooth: all 0.3s ease;
}

body {
    background-color: var(--bg-light);
}

.services-page {
    min-height: 80vh;      /* Ensures the page is tall even with little content */
    padding-bottom: 80px;  /* Forces a physical buffer zone above the footer */
    overflow: hidden;      /* Clears any floating elements that might break layout */
}

/* HERO SECTION */
.services-hero {
    position: relative;
    background: url('../img/hero-bg.jpg') center/cover;
    padding: 80px 20px;
    text-align: center;
    color: #fff;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: var(--secondary-dark);
    z-index: -1;
}

.hero-container a {
    display: inline-block;
    background-color: #ffffff;          /* White button container for high contrast */
    color: var(--secondary-dark);       /* Uses your theme dark color for the text number */
    padding: 12px 30px;
    margin: 15px 8px 0 8px;             /* Spacing on top and separation between the two buttons */
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    border-radius: 8px;                 /* Smooth rounded edges */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;          /* Enables smooth animation on hover */
    direction: ltr;                     /* Ensures phone number formats correctly from left-to-right */
}

/* 🌟 Interactive Hover effect */
.hero-container a:hover {
    background-color: var(--primary-dark); /* Swaps background color on hover */
    color: #ffffff;                        /* Swaps text to white */
    transform: translateY(-3px);           /* Gentle lifting effect */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 15px;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #e2e8f0;
}

/* DASHBOARD LAYOUT */
.services-dashboard {
    max-width: 1300px;
    margin: 40px auto;
    padding: 0 20px;
    display: flex;
    gap: 30px;
    align-items: flex-start !important;
}

/* SIDEBAR TABS */
.services-sidebar {
    flex: 0 0 280px;
    position: sticky;
    top: 20px;
    max-height: calc(150vh - 40px);
    overflow-y: auto;
    overflow-x: hidden; 
}
.service-nav {
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    padding: 20px 15px;
    border-radius: var(--radius-lg);
    background: white !important;
    border: 1px solid #e0e0e0 !important; 
    display: flex;
    flex-direction: column; /* Overrides any mobile horizontal row layouts */
    gap: 10px; /* Adds breathing room between buttons */
    height: auto !important;
}
.tab-btn {
    font-family: 'Lalezar';
    background: var(--primary-dark);
    border: none;
    text-align: center;
    padding: 14px 20px;
    margin: 10px auto;
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0 !important; /* Stops the browser from squishing the buttons into invisibility */
    width: 100%;
    display: block;
}

.tab-btn i {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}


.tab-btn:hover {
    background: #f0fdf4;
    color: var(--primary-color);
    transform: translateY(-5px);
}

.tab-btn.active {
    background: var(--secondary-dark);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(46, 125, 50, 0.2);
}

/* MAIN CONTENT PANELS */
.services-content {
    flex: 1;
    min-width: 0; /* Prevents flex blowout */
}

.service-panel {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.service-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-header {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 25px;
}

.panel-header h2 {
    color: var(--text-main);
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.panel-header p {
    color: var(--text-muted);
    line-height: 1.7;
    text-align: justify;
}

/* GALLERY GRID */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.gallery-item {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.media-wrapper {
    position: relative;
    width: 100%;
    
    /* 🌟 THE FIX: Changed from 16 / 10 (horizontal) to 3 / 4 (vertical/portrait). 
       If they are super tall like Instagram Reels, you can use 9 / 16 instead! */
    aspect-ratio: 3 / 4; 
    
    /* 🌟 THE FIX: Changed from black to white so any empty space blends in cleanly */
    background: #ffffff; 
    cursor: pointer;
}

.media-wrapper img, .media-wrapper video {
    width: 100%;
    height: 100%;
    
    /* 🌟 THE FIX: 'contain' ensures the browser never crops the media, no matter the screen size */
    object-fit: contain; 
    
    transition: transform 0.4s ease;
}

.gallery-item:hover .media-wrapper img, 
.gallery-item:hover .media-wrapper video {
    transform: scale(1.05);
}

.video-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    z-index: 2; /* Ensures it stays clean on top of the video framework */
}

.play-icon {
    width: 60px !important;
    height: 60px !important;
    background: rgba(46, 125, 50, 0.9) !important;
    border-radius: 50% !important;
    color: #fff !important;
    font-size: 2rem !important;
    
    /* 🌟 The ultimate centering combo */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 🌟 Target the FontAwesome glyph directly to nudge it into the optical center */
.play-icon::before {
    margin-right: -4px; /* Nudges the triangle slightly towards its point in RTL */
}

.media-wrapper:hover .play-icon {
    background: var(--accent-color) !important;
    transform: scale(1.1); 
}

/* 🌟 Total disappearance when playing */
.media-wrapper.is-playing .video-overlay {
    opacity: 0 !important;
    visibility: hidden !important; /* Completely removes it from view */
    pointer-events: none !important;
}

/* --- LIGHTBOX MODAL --- */
.lightbox-modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 9999; /* Ensures it sits on top of absolutely everything */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Dark semi-transparent background */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Added via JS to trigger the fade-in */
.lightbox-modal.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content img, 
.lightbox-content video {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain; /* Keeps vertical/horizontal media from cropping */
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 45px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 10000;
}

.lightbox-close:hover {
    color: var(--accent-color); /* Turns orange on hover using your existing variable */
}

/* --- FLOATING BACK TO TOP BUTTON --- */
.back-to-top-btn {
    display: none; /* Hidden on desktop viewports */
    position: fixed;
    bottom: 25px;
    left: 25px;    /* Left side placement is optimal for RTL websites */
    width: 48px;
    height: 48px;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top-btn:active {
    transform: scale(0.9);
}


/* ==========================================================================
   🌟 MOBILE RESPONSIVE FIXES (SPACING & GLOBAL MENU OVERFLOW)
   ========================================================================== */
@media (max-width: 900px) {
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        position: relative !important;
    }

    .services-page {
        /* Forces the container to physically match the phone glass width, no larger */
        width: 100vw !important;
        max-width: 100vw !important;
        overflow-x: hidden !important; 
        box-sizing: border-box !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .services-dashboard {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important; 
        
        /* 🌟 Traps the dashboard strictly inside the screen */
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 15px !important;
        margin: 0 auto !important;
        gap: 0 !important;
    }

    .services-sidebar {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        
        /* 🌟 THE HEIGHT CRUSH: Forces the sidebar container to collapse tightly around 
           your horizontal buttons, eradicating the giant empty space beneath them */
        height: auto !important;
        min-height: 0 !important;
        flex: 0 0 auto !important; 
        
        overflow: hidden !important;
        padding: 0 !important;
        margin: 0 0 10px 0 !important; /* Minimal base gap right before the service card content */
        box-sizing: border-box !important;
    }

    .service-nav {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        
        width: 100% !important;
        max-width: 100% !important;
        white-space: nowrap !important;
        
        /* Restores your exact preferred inline spacing constraints safely */
        gap: 15px !important;
        padding: 12px 5px 15px 5px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        
        /* Native app momentum mechanics for fluid finger swipe gestures */
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .service-nav::-webkit-scrollbar {
        display: none !important;
    }

    .tab-btn {
        flex: 0 0 auto !important;
        display: inline-block !important;
        width: auto !important;
        /* Preserves your original sizing choices */
        padding: 12px 24px !important;
        margin: 0 !important;
    }
    
    .service-panel {
        width: 100% !important;
        margin-top: 0 !important; /* Erases old top gap positioning offsets */
    }
}