/* --- Global Variables & Base Styles --- */
:root {
    --font-heading: 'Marhey', sans-serif;
    --font-body: 'IBM Plex Sans Arabic', sans-serif;
    --color-bg: #ffffff;
    --color-bg-alt: #f8f8f8;
    --color-text: #2c2a2a;
    --color-primary: #a38a70;
    --color-dark: #1a1a1a;
    --nav-height: 80px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem;
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title h2 {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 600;
    position: relative;
    display: inline-block;
    padding-bottom: 1rem;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--color-primary);
}

/* --- Preloader --- */
.preloader {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: var(--color-bg);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.preloader.hidden { opacity: 0; visibility: hidden; }

/* --- Header & Navbar --- */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
}
.navbar {
    height: var(--nav-height);
    transition: all 0.4s ease;
}
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 2rem;
}
.nav-brand {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
    z-index: 1001; /* To be above mobile nav overlay */
}
.nav-menu {
    display: flex;
    list-style: none;
    margin: 0; padding: 0;
    gap: 2.5rem;
}
.nav-menu a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
    position: relative;
    padding: 5px 0;
    transition: color 0.3s ease;
}
.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: width 0.3s ease;
}
.nav-menu a:hover { color: white; }
.nav-menu a:hover::after { width: 100%; }
.nav-actions { display: flex; align-items: center; gap: 1rem; }
.nav-contact-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}
.nav-contact-btn:hover { background: white; color: var(--color-dark); }
.burger-menu {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 1001;
}

/* Scrolled Navbar Style */
#main-header.scrolled {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
#main-header.scrolled .nav-brand,
#main-header.scrolled .nav-menu a,
#main-header.scrolled .burger-menu { color: var(--color-dark); }
#main-header.scrolled .nav-contact-btn {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

/* --- Mobile Navigation --- */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%; /* Start off-screen */
    width: 80%;
    max-width: 300px;
    height: 100%;
    background-color: var(--color-dark);
    z-index: 1002;
    transition: right 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    padding: 100px 40px;
    display: flex;
    flex-direction: column;
}
.mobile-nav.active { right: 0; }
.mobile-nav ul { list-style: none; padding: 0; margin: 0; }
.mobile-nav ul li { margin-bottom: 2rem; }
.mobile-nav ul a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 600;
    transition: color 0.3s ease;
}
.mobile-nav ul a:hover { color: var(--color-primary); }
.close-btn {
    position: absolute;
    top: 30px;
    right: 30px;
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
}


/* --- Hero Section --- */
.hero-section {
    position: relative;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    overflow: hidden;
}
.hero-background-image {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    transform: scale(1.1); /* Slight zoom for effect */
    animation: zoom-out 20s linear infinite;
}
@keyframes zoom-out {
    0% { transform: scale(1.1); }
    100% { transform: scale(1); }
}
.hero-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.5), rgba(0,0,0,0.2), rgba(0,0,0,0.6));
}
.hero-content {
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(30px);
    animation: hero-fade-in 1s 0.5s forwards;
}
@keyframes hero-fade-in { to { opacity: 1; transform: translateY(0); } }

.main-heading {
    font-family: var(--font-heading);
    font-size: 5rem;
    font-weight: 600;
    margin: 0 0 1rem;
    text-shadow: 0 2px 15px rgba(0,0,0,0.5);
}
.sub-heading {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 2.5rem;
    text-shadow: 0 1px 10px rgba(0,0,0,0.5);
}
.hero-buttons { display: flex; justify-content: center; gap: 1rem; }
.btn {
    padding: 15px 35px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}
.btn-primary { background-color: var(--color-primary); color: white; }
.btn-primary:hover { background-color: #8c7359; transform: translateY(-3px); }
.btn-secondary { background-color: transparent; color: white; border: 2px solid white; }
.btn-secondary:hover { background-color: white; color: var(--color-dark); transform: translateY(-3px); }


/* --- Scroll Animation Base Styles --- */
.feature-card, .gallery-item, .faq-item {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.feature-card.in-view, .gallery-item.in-view, .faq-item.in-view {
    opacity: 1;
    transform: translateY(0);
}
/* Staggered (sequential) animation delays */
.features-grid .feature-card:nth-child(1) { transition-delay: 0.1s; }
.features-grid .feature-card:nth-child(2) { transition-delay: 0.2s; }
.features-grid .feature-card:nth-child(3) { transition-delay: 0.3s; }
.gallery-grid .gallery-item:nth-child(1) { transition-delay: 0.1s; }
.gallery-grid .gallery-item:nth-child(2) { transition-delay: 0.2s; }
.gallery-grid .gallery-item:nth-child(3) { transition-delay: 0.3s; }
.gallery-grid .gallery-item:nth-child(4) { transition-delay: 0.4s; }


/* --- Features Section (FIXED) --- */
.features-section { background-color: var(--color-bg-alt); }
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem; /* Increased gap slightly */
}
.feature-card {
    background-color: white;
    padding: 2.5rem;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.6s ease-out, transform 0.6s ease-out; /* Combined transitions */
}
.feature-card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0,0,0,0.07); }
.feature-icon {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
}
.feature-card h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem; margin: 0 0 1rem;
}
.feature-card p { line-height: 1.7; color: #666; }


/* --- Gallery Section --- */
.gallery-section { background-color: var(--color-bg); }
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 280px;
    gap: 1.5rem;
}
.gallery-item {
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.gallery-item img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.gallery-item:hover img { transform: scale(1.1); }
.gallery-item.tall { grid-row: span 2; }
.gallery-item.wide { grid-column: span 2; }

/* --- Testimonials Section --- */
.testimonials-section { background: var(--color-bg-alt); }
.testimonial-slider {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    overflow: hidden;
    height: 350px;
}
.testimonial-slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.testimonial-slide.active { opacity: 1; transform: translateX(0); }
.testimonial-slide.exit { transform: translateX(-50px); }
.testimonial-slide img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 0 5px white, 0 5px 10px rgba(0,0,0,0.1);
}
.testimonial-slide p {
    font-size: 1.2rem;
    font-style: italic;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}
.testimonial-slide h4 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--color-primary);
}
.testimonial-navigation {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}
.testimonial-navigation button {
    background: transparent;
    border: 1px solid #ddd;
    color: #999;
    width: 40px; height: 40px;
    border-radius: 50%;
    margin: 0 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.testimonial-navigation button:hover { background: var(--color-primary); color: white; border-color: var(--color-primary); }

/* --- FAQ Section --- */
.faq-section { background-color: var(--color-bg); }
.faq-accordion { max-width: 800px; margin: 0 auto; }
.faq-item {
    background: white;
    border-bottom: 1px solid #eee;
}
.faq-question {
    width: 100%;
    background: transparent;
    border: none;
    text-align: right;
    padding: 1.5rem;
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-question::after {
    content: '\f078'; /* Font Awesome down arrow */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    transition: transform 0.3s ease;
}
.faq-item.active .faq-question::after { transform: rotate(180deg); }
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
}
.faq-answer p {
    padding: 0 1.5rem 1.5rem;
    margin: 0;
    line-height: 1.8;
    color: #555;
}

/* --- Footer --- */
.site-footer {
    background-color: var(--color-dark);
    color: rgba(255,255,255,0.7);
    padding-top: 5rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 4rem;
}
.footer-grid h3 {
    font-family: var(--font-heading);
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}
.footer-about p, .footer-contact p { line-height: 1.8; }
.footer-contact p i { margin-left: 10px; color: var(--color-primary); }
.footer-social a {
    display: block;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}
.footer-social a:hover { color: var(--color-primary); }
.copyright {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
}

/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
    .nav-menu, .nav-contact-btn { display: none; }
    .burger-menu { display: block; }
}

@media (max-width: 768px) {
    .main-heading { font-size: 3rem; }
    .sub-heading { font-size: 1.1rem; }
    .section-title h2 { font-size: 2.2rem; }
    .gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 250px;
    }
    .gallery-item.tall, .gallery-item.wide {
        grid-row: auto;
        grid-column: auto;
    }
}