/* Global Variables */
:root {
    --primary-color: #0B4744;    /* Dark Green - Represents Strength & Stability */
    --primary-dark: #0D2B2E;     /* Deep Green - For Header/Footer/Headings */
    --accent-color: #CCA140;     /* Gold - Represents Luxury & Quality */
    --bg-light: #F5F6F7;         /* Clean Light Background */
    --text-dark: #0D2B2E;        /* Dark Green Text */
    --white: #ffffff;

    /* Green Depth Gradients */
    --gradient-green: linear-gradient(135deg, #0B4744 0%, #0D2B2E 100%);
    --gradient-light: linear-gradient(to bottom, #ffffff 0%, #F5F6F7 100%);
    
    /* Fonts */
    --font-ar-body: 'Cairo', sans-serif;
    --font-ar-heading: 'Tajawal', sans-serif;
    --font-en-body: 'Inter', sans-serif;
    --font-en-heading: 'Poppins', sans-serif;
}

/* Typography Setup */
body {
    font-family: var(--font-ar-body);
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-ar-heading);
}

/* English Override (will be applied when html lang="en") */
html[lang="en"] body {
    font-family: var(--font-en-body);
}

html[lang="en"] h1,
html[lang="en"] h2,
html[lang="en"] h3,
html[lang="en"] h4,
html[lang="en"] h5,
html[lang="en"] h6 {
    font-family: var(--font-en-heading);
}

/* Navbar Styling */
.navbar {
    transition: all 0.3s ease;
    background-color: var(--primary-color) !important;
}

.navbar-brand {
    background: transparent !important;
}

.navbar-brand img {
    max-height: 50px;
}

.nav-link {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9) !important;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-color) !important;
}

/* Hero Slider */
.carousel-item {
    height: 80vh;
    min-height: 500px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.carousel-item .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.6));
}

.carousel-caption {
    z-index: 2;
}

.carousel-caption h1 {
    color: var(--accent-color) !important;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.5);
}

/* Card Sliders (Horizontal Scroll) */
.card-slider {
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE 10+ */
    cursor: grab;
    padding: 10px 5px;
    /* Space for shadow */
}

.card-slider::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.card-slider:active {
    cursor: grabbing;
}

.card {
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out, opacity 0.6s ease-out !important;
}

.card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15) !important;
}

/* Scroll Reveal Initial State */
.reveal-card {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.reveal-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Card Slider Nav Buttons */
.slider-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    opacity: 0.8;
    transition: all 0.3s ease;
}

.slider-nav-btn:hover {
    opacity: 1;
}

html[dir="rtl"] .slider-nav-btn.slider-prev { right: -15px; }
html[dir="rtl"] .slider-nav-btn.slider-next { left: -15px; }
html[lang="en"] .slider-nav-btn.slider-prev { left: -15px; }
html[lang="en"] .slider-nav-btn.slider-next { right: -15px; }

@media (min-width: 768px) {
    html[dir="rtl"] .slider-nav-btn.slider-prev { right: -25px; }
    html[dir="rtl"] .slider-nav-btn.slider-next { left: -25px; }
    html[lang="en"] .slider-nav-btn.slider-prev { left: -25px; }
    html[lang="en"] .slider-nav-btn.slider-next { right: -25px; }
}

/* Hide arrows on desktop / full screen, keep them for mobile and tablet */
@media (min-width: 992px) {
    .slider-nav-btn {
        display: none !important;
    }

    /* Show only specific section arrows on desktop */
    #servicesSliderPrev, 
    #servicesSliderNext, 
    #servicesSliderPrevEn, 
    #servicesSliderNextEn,
    #downloadsSliderPrev,
    #downloadsSliderNext,
    #downloadsSliderPrevEn,
    #downloadsSliderNextEn,
    #projectsSliderPrev,
    #projectsSliderNext,
    #projectsSliderPrevEn,
    #projectsSliderNextEn {
        display: flex !important;
    }
}

/* Animations */
[data-aos] {
    pointer-events: none;
}

[data-aos].aos-animate {
    pointer-events: auto;
}

/* Social Icons */
.social-icons a {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white !important;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    background: var(--accent-color);
    color: var(--primary-dark) !important;
    transform: translateY(-3px);
}

/* Page Header */
.page-header {
    position: relative;
    height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    margin-top: 0 !important;
    animation: headerFadeIn 0.8s ease-in-out forwards;
}

@keyframes headerFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.page-subtitle {
    font-size: 1.15rem;
    font-weight: 400;
    opacity: 0.9;
    max-width: 850px;
    margin: 0.5rem auto 1.5rem;
    line-height: 1.6;
}

/* Custom AOS Animation for Page Header */
.page-header [data-aos="fade-up"] {
    transform: translate3d(0, 30px, 0);
}

.page-header [data-aos="fade-up"].aos-animate {
    transform: translate3d(0, 0, 0);
}

@media (max-width: 768px) {
    .page-header {
        height: 260px;
        padding-top: 70px;
    }
    
    .page-subtitle {
        font-size: 1rem;
        padding: 0 15px;
    }

    .page-header h1 {
        font-size: 2.2rem !important;
    }

    /* Disable heavy animations on mobile for performance */
    .page-header [data-aos] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        animation: none !important;
    }
}

.page-header .breadcrumb-item a {
    transition: color 0.3s ease;
}

.page-header .breadcrumb-item a:hover {
    color: var(--accent-color) !important;
}

/* Bootstrap Overrides */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-light {
    background-color: var(--bg-light) !important;
}

.btn-primary {
    background-color: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
    color: #fff !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #b58d35 !important;
    border-color: #b58d35 !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(204, 161, 64, 0.3);
}

.btn-outline-primary {
    color: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
    font-weight: 600;
}

.btn-outline-primary:hover {
    background-color: var(--accent-color) !important;
    color: #fff !important;
}

/* Footer Overrides */
footer.bg-dark {
    background-color: var(--primary-dark) !important;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--primary-dark);
}

.page-header h1 {
    color: var(--accent-color) !important;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.text-white h1, 
.text-white h2, 
.text-white h3, 
.text-white h4, 
.text-white h5, 
.text-white h6,
.bg-dark h1,
.bg-dark h2,
.bg-dark h3,
.bg-dark h4,
.bg-dark h5,
.bg-dark h6,
.bg-primary h1,
.bg-primary h2,
.bg-primary h3,
.bg-primary h4,
.bg-primary h5,
.bg-primary h6 {
    color: inherit;
}

.text-muted {
    color: #556061 !important;
}

/* Depth Classes */
.bg-gradient-green {
    background: var(--gradient-green) !important;
    color: white !important;
}

.bg-depth {
    background: var(--gradient-light) !important;
}

section {
    position: relative;
}

/* Hover Lift Effect */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, .175) !important;
}

/* Image Zoom on Hover */
.card-img-wrapper {
    overflow: hidden;
}

.transition-zoom {
    transition: transform 0.5s ease;
}

.card:hover .transition-zoom {
    transform: scale(1.1);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading Spinner (Optional) */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Global Section Centering 
section {
    text-align: center;
}*/

section .row {
    justify-content: center;
}

/* Center flex items in sections (like icons in About) */
section .d-flex {
    justify-content: center;
}

/* Fix for Card Slider to keep it working with scroll */
section .card-slider.d-flex {
    justify-content: flex-start !important;
}

/* Use auto margins to support safe centering, aligning the cards center when they do not overflow */
section .card-slider.d-flex::before,
section .card-slider.d-flex::after {
    content: '';
    margin: auto;
}

/* Ensure empty space after the last card inside the flex slider so it doesn't touch the edge */
section .card-slider.d-flex::after {
    padding-inline-end: 20px;
}

/* Partner Section Styles */
.partner-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05) !important;
}

.partner-card:hover {
    border-color: var(--accent-color) !important;
    background-color: rgba(204, 161, 64, 0.05);
}

.partner-logo-wrapper {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.partner-card:hover .partner-logo-wrapper {
    filter: grayscale(0%);
    opacity: 1;
}

.partner-logo-wrapper img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

/* Global CTA Widget */
.global-cta-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: none;
}

.cta-btn-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    pointer-events: auto;
}

.cta-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    font-size: 28px;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
}

.cta-button:hover, .cta-button:focus {
    color: #fff !important;
    transform: scale(1.08);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

.cta-whatsapp {
    background-color: #25D366;
}

.cta-call {
    background-color: var(--accent-color);
}

/* Tooltip */
.cta-tooltip {
    position: absolute;
    right: 75px;
    background-color: #333;
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    pointer-events: none;
    font-family: inherit;
    direction: rtl;
}

html[lang="en"] .cta-tooltip {
    direction: ltr;
}

.cta-btn-container:hover .cta-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Tooltip Arrow */
.cta-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -6px;
    transform: translateY(-50%);
    border-width: 6px 0 6px 6px;
    border-style: solid;
    border-color: transparent transparent transparent #333;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .global-cta-widget {
        bottom: 20px;
        right: 20px;
    }
    .cta-button {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    .cta-tooltip {
        display: none !important;
    }
}

/* Projects Page Styles */
.project-item {
    transition: all 0.4s ease;
    cursor: pointer;
}

.project-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.2) 100%);
    opacity: 0;
    transition: all 0.4s ease;
    transform: translateY(10px);
}

.project-item:hover .project-overlay {
    opacity: 1;
    transform: translateY(0);
}

.project-item img {
    transition: transform 0.6s ease;
}

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

/* Justified text alignment for cards (Kashida) - Applied to Arabic */
html[lang="ar"] .card-text-justified {
    text-align: justify;
    text-justify: inter-word;
}

/* Left alignment for English to avoid large spaces in narrow columns */
html[lang="en"] .card-text-justified {
    text-align: left;
}

/* Highlights Section Card Image Styling */
.highlights-img-col {
    position: relative;
    padding: 0;
    overflow: hidden;
    min-height: 220px;
}

.highlights-img-col img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

@media (max-width: 575.98px) {
    .highlights-img-col {
        min-height: 220px;
    }
}