/* =========================================
   1. VARIABLES & RESET
   ========================================= */
html{
    font-size: 16px;
}
:root {
    --bg-color: #1a1512;
    --text-color: #f5f5dc;
    --accent-color: #DEB886;
    --card-bg: #DEB886;
    --font-heading: 'Cairo', sans-serif;
    --font-body: 'Tajawal', sans-serif;
}

* {
    margin: 0; padding: 0; box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.6;
    direction: rtl;
}

body.no-scroll {
    overflow: hidden;
    height: 100vh;
}

/* =========================================
   2. HERO SECTION
   ========================================= */
.hero {
    background: linear-gradient(rgba(26,21,18,0.5), rgba(26,21,18,0.5)), url('background.png') no-repeat center center/cover;
    min-height: clamp(30vh, 40vw, 50vh);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-content h1 {
    font-family: 'Reem Kufi', sans-serif;
    font-weight: 900;
    padding-top: 1rem;
    font-size: clamp(5rem, 12vw, 8rem);
    color: #eeddca; 
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
    line-height: 1.1;
    
}

.hero-content p {
    font-family: var(--font-body);
    font-size: clamp(1.4rem, 2.5vw, 3rem);
    color: #DEB887;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
    font-weight: 700;
}

/* =========================================
   3. LAYOUT & BUTTONS
   ========================================= */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 1rem;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    font-size: rem;

}

.btn {
    background: transparent;
    border: 1px solid #98633B;
    color: #98633B;
    padding: 10px 25px;
    font-size: 1.1rem;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: 0.3s;
    font-weight: 700;
    border-radius: 2px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.btn:hover, .btn.active {
    background: #98633B;
    color: var(--bg-color);
}

.sub-filters .btn {
    font-size: 0.9rem;
    padding: 8px 20px;
    border-color:#DEB886;
    color: #DEB886;
}

.sub-filters .btn:hover, .sub-filters .btn.active {
    background: #DEB886;
    color: var(--bg-color);
}

.hidden { display: none; }

/* =========================================
    4. GALLERY GRID (Masonry)
   ========================================= */
#gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-auto-rows: 50px; 
    grid-auto-flow: dense; 
    gap: 15px;
    padding: 10px;
}

/* =========================================
   تعديل: تأثير اللمعان (Skeleton Loading)
   ========================================= */
.gallery-item {
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background-color: #2b221e; /* لون الخلفية قبل التحميل */
    transition: transform 0.3s ease;
    grid-row: span 4;
    position: relative; /* ضروري عشان اللمعة */
}

/* حركة اللمعان (الشريط اللي بيمشي) */
.gallery-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    /* تدرج لوني خفيف يعطي إحساس اللمعة */
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1), /* خليتها 0.1 عشان تليق مع الخلفية الغامقة */
        transparent
    );
    animation: shimmer 1.5s infinite;
    z-index: 1;
}

@keyframes shimmer {
    100% { left: 100%; }
}

/* تنسيق الصورة (مخفية بالبداية) */
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0; /* مخفية */
    transition: opacity 0.5s ease-in-out;
    position: relative;
    z-index: 2; /* الصورة فوق اللمعة */
}

/* الكلاس اللي الجافا سكريبت بيضيفه لما الصورة تجهز */
.gallery-item img.loaded {
    opacity: 1;
}

/* باقي التنسيقات زي ما هي */
.gallery-item.wide { grid-column: span 2; }
.gallery-item.tall { grid-column: span 1; grid-row: span 6; }

.gallery-item.wide {
    grid-column: span 2;
}

.gallery-item.tall {
    grid-column: span 1;
    grid-row: span 6; 
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* =========================================
   5. MODAL & WHATSAPP
   ========================================= */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
}

.swiper { width: 100%; height: 100%; }
.swiper-slide {
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.close {
    position: absolute;
    top: 20px; right: 35px;
    color: #f1f1f1;
    font-size: 40px; font-weight: bold;
    cursor: pointer;
    z-index: 9999;
    filter: drop-shadow(0px 0px 5px rgba(0,0,0,1));
}

.swiper-button-next, .swiper-button-prev {
    color: #ffffff !important;
    filter: drop-shadow(0px 0px 5px rgba(0,0,0,1));
    transition: transform 0.2s ease;
}

.swiper-button-next:hover, .swiper-button-prev:hover, .close:hover {
    transform: scale(1.2);
    color: #DEB886 !important;
}
/* =========================================
   دائرة التحميل (Swiper Preloader)
   ========================================= */
/* --- الحاوية: وظيفتها بس تحدد الشكل (القناع) --- */
/* --- الحاوية (الدائرة) --- */
/* --- الحاوية (الدائرة) --- */
/* الحاوية الأساسية */
.magic-liquid-loader {
    position: absolute; /* 👈 غيرتها من fixed لـ absolute */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999; /* رقم معقول عشان يكون فوق الصورة */
}

/* باقي الكود تبعك متل ما هو تماماً */
.liquid-box {
    position: relative;
    background-image: url('logo.png'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
    width: 140px;
    height: 140px;
    box-sizing: border-box;
    overflow: hidden;
}

.liquid-box::after {
    content: "";
    position: absolute;
    bottom: -35%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-color: #1A1512; /* لونك المفضل */
    border-radius: 40%;
}
.swiper-slide-active .liquid-box::after {
    animation: liquidFill 2s linear infinite;
}
@keyframes liquidFill {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-125%) rotate(180deg); }
    100% { transform: translateY(0) rotate(360deg); }
}

.whatsapp-float {
    position: fixed; bottom: 25px; right: 25px;
    width: 50px; height: 50px;
    z-index: 999; border-radius: 50%;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
    transition: 0.3s;
}
.whatsapp-float img { width: 100%; height: 100%; object-fit: cover; }

/* =========================================
   6. FOOTER STYLES
   ========================================= */
.site-footer {
    background-color: #1a120b;
    color: #e0d0b8;
    padding: 40px 0 20px;
    margin-top: 50px;
    border-top: 4px solid #c5a085;
    font-family: 'Cairo', sans-serif;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-col h3 {
    color: #c5a085;
    font-size: 1.5rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    bottom: 0; right: 0;
    width: 50px; height: 2px;
    background-color: #c5a085;
}

.footer-col ul { list-style: none; padding: 0; }
.contact-item { margin-bottom: 15px; }

.footer-col ul li a, .contact-link {
    color: #e0d0b8;
    text-decoration: none;
    transition: 0.3s;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.contact-text { font-weight: bold; }

.footer-col ul li a:hover {
    color: #fff;
    padding-right: 10px;
}

.footer-col i { color: #c5a085; }

.footer-bottom {
    text-align: center;
    margin-top: 30px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

.gold-text { color: #c5a085; font-weight: bold; }

/* =========================================
   8. SCROLL TO TOP ARROW
   ========================================= */
/* === تنسيق زر الصعود (الكبسولة المركزية) === */
#scroll-top-btn {
    position: fixed;
    z-index: 999;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;

    /* التمركز في منتصف الشاشة للكل (موبايل وكمبيوتر) */
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);

    /* الشكل البيضاوي (الكبسولة) */
    width: 50px;
    height: 80px; /* طولناه عشان يساع 3 أسهم */
    border-radius: 25px; /* تدوير الحواف */
    
    /* الستايل واللون */
    background-color: rgba(0, 0, 0, 0.6); /* ذهبي شفاف شوي */
    backdrop-filter: blur(5px); /* تأثير الزجاج */
    border: 2px solid #1a1512;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);

    /* ترتيب الأسهم فوق بعض */
    display: flex;
    flex-direction: column; /* عمودي */
    justify-content: center;
    align-items: center;
    gap: 5px; /* مسافة صغيرة بين كل سهم */
}

#scroll-top-btn.show {
    opacity: 1;
    visibility: visible;
}

/* === رسم الأسهم الثلاثة === */
#scroll-top-btn span {
    display: block;
    width: 12px;
    height: 12px;
    border-top: 3px solid #ffffff;   /* لون السهم غامق */
    border-right: 3px solid #ffffff;
    transform: rotate(-45deg);       /* تدوير لفوق */
    
    /* الأنميشن */
    animation: arrowWave 1.5s infinite ease-in-out;
    opacity: 0; /* يبدأ مخفي عشان يظهر بالتدريج */
}

/* === تأخير الحركة (عشان يتحركوا ورا بعض) === */
/* السهم التحتاني */
#scroll-top-btn span:nth-child(3) {
    animation-delay: 0s;
}
/* السهم النصاني */
#scroll-top-btn span:nth-child(2) {
    animation-delay: 0.15s;
}
/* السهم الفوقاني */
#scroll-top-btn span:nth-child(1) {
    animation-delay: 0.3s;
}

/* === الأنميشن (ظهور واختفاء مع حركة) === */
@keyframes arrowWave {
    0% {
        /* يبدأ من تحت شوي */
        transform: translateY(6px) rotate(-45deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        /* ينتهي فوق شوي */
        transform: translateY(-6px) rotate(-45deg);
        opacity: 0;
    }
}
    #scroll-top-btn:hover {
        transform: translateX(-50%) translateY(-5px); /* يطلع لفوق شوي لما تأشر عليه */
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.6);
    }

/* =========================================
   7. MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 768px) {
    
    #gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px; padding: 5px;
    }
    .liquid-box {
        width: 100px;
        height: 100px;
    }
    .whatsapp-float { right: 15px;bottom: 20px; }

    .footer-container { text-align: center; }
    .footer-col h3::after { right: 50%; transform: translateX(50%); }
    .footer-col ul li a:hover { padding-right: 0; }
    
    .contact-link { justify-content: center; }
}