/**
 * 🌙 Ramadan Theme - OPTIMIZED for Performance
 * ثيم رمضان محسّن للأداء الخفيف
 */

:root {
    --rm-gold: #D4AF37;
    --rm-gold-light: #F5D67B;
    --rm-gold-dark: #B8860B;
    --rm-navy: #0a0a1a;
    --rm-purple: #1a0a2e;
    --rm-blue: #0d1b2a;
    --rm-cream: #FFF8DC;
    --rm-orange: #FF6B35;
}

/* ============================================
   🎬 INTRO SPLASH SCREEN - تجربة الدخول
   ============================================ */
.ramadan-splash {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #1a0a2e 0%, #0a0a1a 100%);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* الهلال الكبير */
.splash-moon {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: 30px;
    opacity: 0;
    transform: scale(0);
    animation: moonAppear 1.2s ease-out 0.3s forwards;
}

@keyframes moonAppear {
    0% { opacity: 0; transform: scale(0); }
    100% { opacity: 1; transform: scale(1); }
}

.splash-moon::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.8);
}

.splash-moon::after {
    content: '';
    position: absolute;
    top: 10px;
    right: -5px;
    width: 85px;
    height: 85px;
    border-radius: 50%;
    background: #0a0a1a;
}

/* عنوان رمضان كريم */
.splash-title {
    font-size: 48px;
    font-weight: 900;
    color: #FFD700;
    opacity: 0;
    transform: translateY(-50px);
    animation: titleDrop 0.8s ease-out 0.8s forwards;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

@keyframes titleDrop {
    0% { opacity: 0; transform: translateY(-50px); }
    100% { opacity: 1; transform: translateY(0); }
}

.splash-subtitle {
    font-size: 18px;
    color: var(--rm-cream);
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 1.3s forwards;
    margin-bottom: 40px;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* الفوانيس في السبلاش */
.splash-lanterns {
    display: flex;
    gap: 25px;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 1.6s forwards;
}

.splash-lantern {
    animation: none;
}

/* زر الدخول */
.splash-enter-btn {
    margin-top: 40px;
    padding: 13px 45px;
    font-size: 17px;
    font-weight: 700;
    color: var(--rm-navy);
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 1.9s forwards;
    transition: transform 0.2s ease;
}

.splash-enter-btn:active {
    transform: scale(0.95);
}

.ramadan-splash.hide {
    animation: splashExit 0.5s ease-in forwards;
}

@keyframes splashExit {
    to { opacity: 0; visibility: hidden; }
}

/* ============================================
   🏮 FLOATING LANTERNS - الفوانيس المعلقة
   ============================================ */
.ramadan-lanterns-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 120px;
    pointer-events: none;
    z-index: 9990;
    overflow: hidden;
    will-change: transform;
}

.floating-lantern {
    position: absolute;
    top: -10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-origin: top center;
}

.floating-lantern .rope {
    width: 2px;
    height: 25px;
    background: linear-gradient(to bottom, #4a3728, #8B7355);
}

.floating-lantern.left-1 { left: 5%; animation: swing1 3.5s ease-in-out infinite; }
.floating-lantern.right-1 { right: 5%; animation: swing2 3.5s ease-in-out infinite; }

@keyframes swing1 {
    0%, 100% { transform: rotate(-6deg); }
    50% { transform: rotate(6deg); }
}

@keyframes swing2 {
    0%, 100% { transform: rotate(6deg); }
    50% { transform: rotate(-6deg); }
}

/* ============================================
   🌙 TOP BANNER - بانر رمضان كريم
   ============================================ */
.ramadan-banner {
    background: linear-gradient(135deg, #1a0a2e 0%, #2d1b4e 50%, #1a0a2e 100%);
    padding: 12px 16px;
    position: relative;
    overflow: hidden;
    border-bottom: 3px solid #FFD700;
    box-shadow: 0 3px 15px rgba(255, 215, 0, 0.25);
}

.ramadan-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M40 0L40 80M0 40L80 40' stroke='%23FFD700' stroke-width='0.5' fill='none' opacity='0.08'/%3E%3C/svg%3E");
    pointer-events: none;
}

.ramadan-banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    position: relative;
    z-index: 2;
}

.banner-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.banner-title {
    font-size: 24px;
    font-weight: 900;
    color: #FFD700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    letter-spacing: 2px;
}

.banner-subtitle {
    font-size: 12px;
    color: rgba(255, 248, 220, 0.85);
    font-weight: 500;
}

.banner-lantern {
    width: 40px;
    height: auto;
    animation: none;
}

.banner-moon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
}

.banner-stars {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
}

/* ============================================
   🌟 STARS LAYER - طبقة النجوم المحدودة
   ============================================ */
.ramadan-stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 300px;
    pointer-events: none;
    z-index: 9985;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(26, 10, 46, 0.3) 0%, transparent 100%);
    will-change: transform;
}

.star {
    position: absolute;
    background: #FFD700;
    border-radius: 50%;
    animation: twinkle var(--duration, 2.5s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
    box-shadow: 0 0 8px #FFD700;
}

.star::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300%;
    height: 300%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 60%);
    border-radius: 50%;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.9; }
}

/* ============================================
   🎊 PARTICLES - جزيئات بحد أدنى
   ============================================ */
.ramadan-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9984;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #FFD700;
    border-radius: 50%;
    opacity: 0;
    animation: particleFall linear infinite;
    box-shadow: 0 0 6px #FFD700;
}

.particle::before {
    content: '✦';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #FFD700;
    font-size: 10px;
}

@keyframes particleFall {
    0% { opacity: 0; transform: translateY(-10px) scale(0); }
    10% { opacity: 1; }
    90% { opacity: 0.7; }
    100% { opacity: 0; transform: translateY(100vh) rotate(360deg) scale(0); }
}

/* ============================================
   🌙 MOON DECORATION - هلال مبسط
   ============================================ */
.ramadan-moon {
    position: fixed;
    top: 80px;
    right: 50%;
    transform: translateX(50%);
    z-index: 9986;
    pointer-events: none;
    animation: none;
}

.ramadan-moon svg {
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.6));
}

/* ============================================
   🎨 PAGE BACKGROUND EFFECTS
   ============================================ */
.ramadan-active body {
    position: relative;
}

.ramadan-active body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 300px;
    background: linear-gradient(180deg, 
        rgba(26, 10, 46, 0.4) 0%, 
        rgba(26, 10, 46, 0.2) 40%,
        transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* Minimal corner decorations */
.ramadan-corner-decor {
    position: fixed;
    width: 100px;
    height: 100px;
    pointer-events: none;
    z-index: 9983;
    opacity: 0.4;
}

.ramadan-corner-decor.top-left {
    top: 120px;
    left: 0;
    background: radial-gradient(ellipse at top left, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
}

.ramadan-corner-decor.top-right {
    top: 120px;
    right: 0;
    background: radial-gradient(ellipse at top right, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
}

/* ============================================
   🎁 RAMADAN POPUP CARD - محسّن
   ============================================ */
.ramadan-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 26, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(8px);
}

.ramadan-popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.ramadan-popup {
    background: linear-gradient(180deg, #1a0a2e 0%, #0a0a1a 100%);
    border: 2px solid #FFD700;
    border-radius: 24px;
    padding: 0;
    max-width: 340px;
    width: 90%;
    position: relative;
    transform: scale(0.8) translateY(50px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.25);
    overflow: hidden;
    will-change: transform;
}

.ramadan-popup-overlay.show .ramadan-popup {
    transform: scale(1) translateY(0);
}

.popup-header {
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.1) 0%, transparent 100%);
    padding: 25px 20px 15px;
    position: relative;
    text-align: center;
}

.popup-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #FFD700, transparent);
}

.popup-lanterns {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.popup-moon-icon {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 32px;
    opacity: 0.9;
}

.popup-content {
    padding: 18px 24px 30px;
    text-align: center;
}

.popup-title {
    font-size: 36px;
    font-weight: 900;
    color: #FFD700;
    margin-bottom: 6px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.popup-subtitle {
    font-size: 16px;
    color: var(--rm-cream);
    margin-bottom: 15px;
    font-weight: 600;
}

.popup-divider {
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #FFD700, transparent);
    margin: 0 auto 15px;
}

.popup-message {
    color: rgba(255, 248, 220, 0.85);
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.popup-btn {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #0a0a1a;
    border: none;
    padding: 13px 40px;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease;
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.35);
}

.popup-btn:active {
    transform: scale(0.97);
}

/* ============================================
   🎨 THEMED UI ELEMENTS - عناصر واجهة مبسطة
   ============================================ */
.ramadan-active .btn-primary,
.ramadan-active .checkout-btn {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%) !important;
    color: #0a0a1a !important;
    font-weight: 700 !important;
    border: none !important;
    box-shadow: 0 3px 16px rgba(255, 215, 0, 0.3) !important;
}

.ramadan-active .btn-primary:active {
    transform: scale(0.98);
}

.ramadan-active .bottom-nav {
    border-top: 2px solid rgba(255, 215, 0, 0.3) !important;
    background: linear-gradient(180deg, rgba(26, 10, 46, 0.85) 0%, rgba(10, 10, 26, 0.95) 100%) !important;
    box-shadow: 0 -3px 15px rgba(255, 215, 0, 0.1) !important;
}

.ramadan-active .nav-item.active i,
.ramadan-active .nav-item.active span {
    color: #FFD700 !important;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.ramadan-active .header {
    background: linear-gradient(135deg, #1a0a2e 0%, #0d0620 100%) !important;
    border-bottom: 2px solid rgba(255, 215, 0, 0.2) !important;
}

.ramadan-active .store-card,
.ramadan-active .product-card {
    border: 1px solid rgba(255, 215, 0, 0.12) !important;
    box-shadow: 0 2px 12px rgba(255, 215, 0, 0.08) !important;
}

.ramadan-active .store-card:active,
.ramadan-active .product-card:active {
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.15) !important;
}

.ramadan-active .search-bar,
.ramadan-active input[type="search"] {
    border: 2px solid rgba(255, 215, 0, 0.15) !important;
}

.ramadan-active .search-bar:focus {
    border-color: rgba(255, 215, 0, 0.4) !important;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.15) !important;
}

/* ============================================
   📱 RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .splash-title { font-size: 40px; }
    .splash-moon { width: 80px; height: 80px; }
    
    .floating-lantern.left-1 { left: 2%; }
    .floating-lantern.right-1 { right: 2%; }
    
    .banner-title { font-size: 20px; }
    .banner-lantern { width: 32px; }
    .banner-moon { width: 26px; height: 26px; left: 8px; }
    
    .ramadan-stars { height: 250px; }
    
    .popup-title { font-size: 32px; }
    .popup-message { font-size: 14px; }
}

@media (max-width: 360px) {
    .banner-moon {
        display: none;
    }
    
    .ramadan-moon {
        display: none;
    }
    
    .ramadan-stars {
        height: 200px;
    }
}
