/* Ramadan Theme CSS */

/* Base theme container - this will be applied to the body or main container */
.ramadan-theme {
    position: relative;
    overflow-x: hidden;
}

/* Crescent Moon */
.ramadan-moon {
    position: fixed;
    top: 50px;
    right: 50px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: transparent;
    box-shadow: -12px 0 0 var(--ramadan-color, #f1c40f);
    transform: rotate(-30deg);
    z-index: 1000;
    pointer-events: none;
    animation: ramadan-float 6s ease-in-out infinite;
}

/* Stars */
.ramadan-star {
    position: fixed;
    background-color: var(--ramadan-color, #f1c40f);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    width: 20px;
    height: 20px;
    z-index: 999;
    pointer-events: none;
}

.ramadan-star-1 {
    top: 15%;
    left: 10%;
    animation: ramadan-twinkle 3s ease-in-out infinite;
}

.ramadan-star-2 {
    top: 25%;
    left: 30%;
    width: 15px;
    height: 15px;
    animation: ramadan-twinkle 4s ease-in-out infinite 1s;
}

.ramadan-star-3 {
    top: 10%;
    left: 65%;
    width: 12px;
    height: 12px;
    animation: ramadan-twinkle 5s ease-in-out infinite 0.5s;
}

.ramadan-star-4 {
    top: 20%;
    left: 85%;
    animation: ramadan-twinkle 3.5s ease-in-out infinite 1.5s;
}

.ramadan-star-5 {
    top: 30%;
    left: 50%;
    width: 10px;
    height: 10px;
    animation: ramadan-twinkle 4.5s ease-in-out infinite 0.8s;
}

/* Lanterns - Use admin panel color */
.ramadan-lantern {
    position: fixed;
    bottom: 0px; /* Fixed: Show full lantern instead of -10px */
    width: 40px;
    height: 70px;
    background-color: var(--ramadan-color, #e74c3c); /* Use admin panel color */
    border-radius: 10px 10px 0 0;
    z-index: 999;
    pointer-events: none;
}

.ramadan-lantern::before {
    content: "";
    position: absolute;
    top: -15px;
    left: 37.5%; /* Center the handle proportionally */
    width: 25%; /* Make width proportional to lantern */
    height: 21.4%; /* Make height proportional to lantern (15px of 70px) */
    background-color: var(--ramadan-color, #e74c3c); /* Fixed: Use admin panel color instead of hardcoded */
    border-radius: 5px;
}

.ramadan-lantern::after {
    content: "";
    position: absolute;
    top: 21.4%; /* Position proportionally (15px of 70px) */
    left: 20%; /* Center the decorations proportionally */
    width: 60%; /* Make width proportional to lantern */
    height: 11.4%; /* Make height proportional (8px of 70px) */
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 5px;
    box-shadow: 0 28.6% 0 rgba(255, 255, 255, 0.6); /* Shadow proportional (20px of 70px) */
}

.ramadan-lantern-1 {
    left: 10%;
    animation: ramadan-sway 4s ease-in-out infinite;
}

.ramadan-lantern-2 {
    left: 30%;
    height: 60px;
    width: 35px;
    animation: ramadan-sway 5s ease-in-out infinite 0.5s;
}

.ramadan-lantern-3 {
    left: 50%;
    animation: ramadan-sway 4.5s ease-in-out infinite 1s;
}

.ramadan-lantern-4 {
    left: 70%;
    height: 55px;
    width: 32px;
    animation: ramadan-sway 3.5s ease-in-out infinite 1.5s;
}

.ramadan-lantern-5 {
    left: 90%;
    animation: ramadan-sway 5.5s ease-in-out infinite 0.8s;
}

/* Light intensity adjustments */
.ramadan-light .ramadan-moon,
.ramadan-light .ramadan-star,
.ramadan-light .ramadan-lantern {
    opacity: 0.3;
}

.ramadan-medium .ramadan-moon,
.ramadan-medium .ramadan-star,
.ramadan-medium .ramadan-lantern {
    opacity: 0.7;
}

.ramadan-full .ramadan-moon,
.ramadan-full .ramadan-star,
.ramadan-full .ramadan-lantern {
    opacity: 1;
}

/* Animations */
@keyframes ramadan-float {
    0%, 100% {
        transform: translateY(0) rotate(-30deg);
    }
    50% {
        transform: translateY(-10px) rotate(-30deg);
    }
}

@keyframes ramadan-twinkle {
    0%, 100% {
        opacity: var(--ramadan-opacity, 1);
        transform: scale(1);
    }
    50% {
        opacity: var(--ramadan-opacity, 1) * 0.5;
        transform: scale(0.8);
    }
}

@keyframes ramadan-sway {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(10px);
    }
}

/* Add a subtle glow to the page when Ramadan theme is active */
.ramadan-theme::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to bottom, 
        rgba(var(--ramadan-rgb-color, 241, 196, 15), 0.1) 0%, 
        transparent 100%);
    pointer-events: none;
    z-index: 998;
}

/* Enhanced responsive adjustments in CSS */
@media (max-width: 1200px) {
    .ramadan-moon {
        width: 50px;
        height: 50px;
        box-shadow: -10px 0 0 var(--ramadan-color, #f1c40f);
    }
    
    .ramadan-star {
        width: 16px;
        height: 16px;
    }
    
    .ramadan-lantern {
        width: 35px;
        height: 60px;
        bottom: 0px; /* Show full lantern on tablet */
    }
    
    /* Scale lantern handles on tablet */
    .ramadan-lantern::before {
        top: -20%; /* Proportional to lantern height */
        width: 22.8%; /* Proportional to width (8px of 35px) */
        height: 20%; /* Proportional to height (12px of 60px) */
    }
    
    .ramadan-lantern::after {
        top: 20%; /* Proportional positioning */
        left: 14.3%; /* Proportional positioning */
        width: 71.4%; /* Proportional width */
        height: 8.3%; /* Proportional height */
        box-shadow: 0 25% 0 rgba(255, 255, 255, 0.6); /* Proportional shadow */
    }
}

@media (max-width: 768px) {
    .ramadan-theme::before {
        height: 150px;
    }
    
    .ramadan-moon {
        width: 35px;
        height: 35px;
        top: 30px;
        right: 20px;
        box-shadow: -7px 0 0 var(--ramadan-color, #f1c40f);
    }
    
    .ramadan-star {
        width: 12px;
        height: 12px;
    }
    
    .ramadan-lantern {
        width: 25px;
        height: 45px;
        bottom: 0px; /* Show full lantern on mobile */
    }
    
    /* Scale lantern handles on mobile */
    .ramadan-lantern::before {
        top: -22.2%; /* Proportional to mobile lantern height */
        width: 24%; /* Proportional to width (6px of 25px) */
        height: 22.2%; /* Proportional to height (10px of 45px) */
    }
    
    .ramadan-lantern::after {
        top: 22.2%; /* Proportional positioning */
        left: 20%; /* Proportional positioning */
        width: 60%; /* Proportional width */
        height: 11.1%; /* Proportional height */
        box-shadow: 0 33.3% 0 rgba(255, 255, 255, 0.6); /* Proportional shadow */
    }
    
    /* Hide some decorations on mobile */
    .ramadan-star-4,
    .ramadan-star-5,
    .ramadan-lantern-4,
    .ramadan-lantern-5 {
        display: none;
    }
}

@media (max-width: 480px) {
    .ramadan-theme::before {
        height: 100px;
    }
    
    .ramadan-moon {
        width: 25px;
        height: 25px;
        top: 25px;
        right: 15px;
        box-shadow: -5px 0 0 var(--ramadan-color, #f1c40f);
    }
    
    .ramadan-star {
        width: 8px;
        height: 8px;
    }
    
    .ramadan-lantern {
        width: 18px;
        height: 32px;
        bottom: 0px; /* Show full lantern on small screens */
    }
    
    /* Scale lantern handles on small screens */
    .ramadan-lantern::before {
        top: -25%; /* Proportional to small lantern height */
        width: 22.2%; /* Proportional to width (4px of 18px) */
        height: 25%; /* Proportional to height (8px of 32px) */
    }
    
    .ramadan-lantern::after {
        top: 25%; /* Proportional positioning */
        left: 22.2%; /* Proportional positioning */
        width: 55.5%; /* Proportional width */
        height: 12.5%; /* Proportional height */
        box-shadow: 0 37.5% 0 rgba(255, 255, 255, 0.6); /* Proportional shadow */
    }
    
    /* Hide more decorations on small screens */
    .ramadan-star-3,
    .ramadan-lantern-3 {
        display: none;
    }
}

@media (orientation: landscape) and (max-height: 480px) {
    .ramadan-theme::before {
        height: 60px;
    }
    
    .ramadan-moon {
        width: 20px;
        height: 20px;
        top: 10px;
        box-shadow: -4px 0 0 var(--ramadan-color, #f1c40f);
    }
    
    /* Hide decorations in landscape on short screens */
    .ramadan-star,
    .ramadan-lantern {
        display: none;
    }
}

/* Optional: Add subtle border to the page - DISABLED by user request */
/*
.ramadan-theme.ramadan-full {
    border: 5px solid transparent;
    border-image: linear-gradient(to bottom, var(--ramadan-color, #f1c40f), transparent);
    border-image-slice: 1;
}
*/

/* Special styling for buttons when ramadan theme is active */
.ramadan-theme .btn-primary {
    box-shadow: 0 0 10px var(--ramadan-color, #f1c40f);
}

/* Special styling for header when ramadan theme is active */
.ramadan-theme header {
    position: relative;
}

.ramadan-theme.ramadan-full header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--ramadan-color, #f1c40f);
    box-shadow: 0 0 10px var(--ramadan-color, #f1c40f);
}
