/**
 * ملف التنسيقات العامة والأنماط المخصصة والمحسنة
 * فن الخشب والحلول الذكية
 */

/* الخطوط والتنسيق العام الفاخر */
body {
    font-family: 'Almarai', 'IBM Plex Sans Arabic', sans-serif;
    letter-spacing: normal;
}

/* خط العناوين الفاخر الإبداعي - المسيري بتفاصيل حرفية راقية */
h1, h2, h3, .font-luxury {
    font-family: 'El Messiri', 'Alexandria', serif;
    letter-spacing: normal;
}

/* نمط خلفية الخشب الداكن الفاخر */
.wood-bg-pattern {
    background-color: #0f0b0a;
    background-image: 
        radial-gradient(#3a1a14 0.9px, transparent 0.9px), 
        radial-gradient(#3a1a14 0.9px, #0f0b0a 0.9px);
    background-size: 28px 28px;
    background-position: 0 0, 14px 14px;
}

/* تأثير التوهج اللطيف (Glow Effects) */
.glow-wood {
    box-shadow: 0 0 35px -5px rgba(198, 110, 59, 0.25);
}

.glow-amber {
    box-shadow: 0 0 35px -5px rgba(245, 158, 11, 0.25);
}

/* نبض زر الواتساب للفت الانتباه */
@keyframes pulse-subtle {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
}

.whatsapp-pulse {
    animation: pulse-subtle 2.5s infinite ease-in-out;
}

/* تصفية وحركات عناصر المعرض */
.portfolio-item {
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-item.item-hidden {
    display: none !important;
    opacity: 0;
    transform: scale(0.92);
}

.portfolio-item.item-visible {
    display: block !important;
    animation: galleryFade 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes galleryFade {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* تنسيقات نافذة عرض الصور المكبرة (Lightbox Modal) */
#lightboxModal {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#lightboxModal.active {
    opacity: 1;
    visibility: visible;
}

#lightboxModal.inactive {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#lightboxImg {
    max-height: 85vh;
    transition: transform 0.3s ease;
}

/* تنسيق الأسئلة الشائعة (FAQ Accordion) */
.faq-content {
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

.faq-item.active .faq-content {
    max-height: 400px;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-icon {
    transition: transform 0.3s ease;
}

/* زر الصعود للأعلى (Back to Top) */
#backToTopBtn {
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

#backToTopBtn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#backToTopBtn.hide {
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
}

/* شريط تمرير أنيق متناسق مع هوية الموقع */
::-webkit-scrollbar {
    width: 9px;
}

::-webkit-scrollbar-track {
    background: #0d0a09;
}

::-webkit-scrollbar-thumb {
    background: #7a3727;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #c66e3b;
}

/* تحسين تجربة التحديد بالماوس */
::selection {
    background-color: #c66e3b;
    color: #ffffff;
}

/* بطاقات زجاجية مدمجة */
.glass-card {
    background: rgba(22, 17, 15, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(198, 110, 59, 0.18);
}

.glass-card:hover {
    border-color: rgba(245, 158, 11, 0.38);
}

/* ==========================================================================
   تأثيرات وحركات بصرية فاخرة (Luxury Animations & Micro-Interactions)
   ========================================================================== */

/* 1. حركة الطفو اللطيفة للعناصر والشارات (Gentle Floating Effect) */
@keyframes floatSlow {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

.animate-float {
    animation: floatSlow 4s ease-in-out infinite;
}

.animate-float-delayed {
    animation: floatSlow 4.5s ease-in-out infinite 1.8s;
}

/* 2. لمعان انعكاس الضوء الفاخر على الأزرار (Luxury Shimmer Effect) */
.btn-shimmer {
    position: relative;
    overflow: hidden;
}

.btn-shimmer::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -70%;
    width: 25%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.28) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    animation: shimmerEffect 4s infinite cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

@keyframes shimmerEffect {
    0% {
        left: -70%;
    }
    30%, 100% {
        left: 150%;
    }
}

/* 3. نبض التوهج الذهبي الفاخر (Ambient Gold Glow Pulse) */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 25px -5px rgba(245, 158, 11, 0.25);
    }
    50% {
        box-shadow: 0 0 40px 3px rgba(245, 158, 11, 0.5);
    }
}

.animate-glow-pulse {
    animation: glowPulse 3.5s infinite ease-in-out;
}

/* 4. ارتقاء البطاقات عند التحويم (Smooth Card Lift & Elevation) */
.hover-lift {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.35s ease, 
                border-color 0.35s ease;
}

.hover-lift:hover {
    transform: translateY(-7px);
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.7), 0 0 25px -5px rgba(198, 110, 59, 0.22);
}

/* 5. دوران ناعم للأيقونات عند التحويم */
.group:hover .icon-hover-rotate {
    transform: rotate(10deg) scale(1.12);
}

.icon-hover-rotate {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 6. حركة هبوط مؤشر التمرير للأسفل (Scroll Down Bounce) */
@keyframes bounceDown {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(6px);
    }
    60% {
        transform: translateY(3px);
    }
}

.animate-bounce-down {
    animation: bounceDown 2.2s infinite;
}

/* 7. احترام تفضيلات المستخدم لتقليل الحركة وصمام أمان للمكتبة */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* صمام أمان لمنع اختفاء المحتوى في حال عدم توفر أو تأخر مكتبة AOS */
body:not(.aos-ready) [data-aos],
.no-aos [data-aos],
[data-aos].aos-fallback {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
}
