/* ==========================================================================
   Ramadan Preloader — Frontend Styles
   ========================================================================== */

/* CSS Custom Properties (overridden via inline style from admin settings) */
:root {
    --rp-bg: #1a0533;
    --rp-primary: #d4af37;
    --rp-text: #ffffff;
    --rp-speed: 8s;
}

/* ---------- Full-screen overlay ---------- */
.ramadan-preloader {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rp-bg);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.ramadan-preloader.rp-fade-out {
    opacity: 0;
    visibility: hidden;
}

/* ---------- Floating background particles ---------- */
.rp-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.rp-particle {
    position: absolute;
    display: block;
    width: 12px;
    height: 12px;
    background: var(--rp-primary);
    opacity: 0.15;
}

/* Diamond shape via rotation */
.rp-particle {
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.rp-particle--1 { top: 10%; left: 15%; width: 14px; height: 14px; animation: rpFloat 6s ease-in-out infinite; }
.rp-particle--2 { top: 25%; right: 20%; width: 10px; height: 10px; animation: rpFloat 8s ease-in-out 1s infinite; }
.rp-particle--3 { bottom: 30%; left: 10%; width: 8px; height: 8px; animation: rpFloat 7s ease-in-out 0.5s infinite; }
.rp-particle--4 { bottom: 15%; right: 12%; width: 16px; height: 16px; animation: rpFloat 9s ease-in-out 2s infinite; }
.rp-particle--5 { top: 50%; left: 5%; width: 10px; height: 10px; animation: rpFloat 7.5s ease-in-out 1.5s infinite; }
.rp-particle--6 { top: 60%; right: 8%; width: 12px; height: 12px; animation: rpFloat 6.5s ease-in-out 0.8s infinite; }

@keyframes rpFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.15; }
    50%      { transform: translateY(-30px) rotate(180deg); opacity: 0.3; }
}

/* ---------- Center container ---------- */
.rp-center {
    position: relative;
    width: 260px;
    height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* ---------- Geometric rings ---------- */
.rp-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    transform-origin: center;
}

/* Outer ring — octagonal star pattern */
.rp-ring--outer {
    width: 220px;
    height: 220px;
    margin-top: -110px;
    margin-left: -110px;
    animation: rpRotateCW var(--rp-speed) linear infinite;
}

.rp-ring--outer span {
    position: absolute;
    inset: 0;
    border: 2px solid var(--rp-primary);
    opacity: 0.6;
}

.rp-ring--outer span:nth-child(1) { clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); }
.rp-ring--outer span:nth-child(2) { clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); transform: rotate(45deg); }
.rp-ring--outer span:nth-child(3) { clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); transform: rotate(22.5deg); }
.rp-ring--outer span:nth-child(4) { clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); transform: rotate(67.5deg); }

/* Inner ring — counter-rotating star */
.rp-ring--inner {
    width: 150px;
    height: 150px;
    margin-top: -75px;
    margin-left: -75px;
    animation: rpRotateCCW var(--rp-speed) linear infinite;
}

.rp-ring--inner span {
    position: absolute;
    inset: 0;
    border: 1.5px solid var(--rp-primary);
    opacity: 0.4;
}

.rp-ring--inner span:nth-child(1) { clip-path: polygon(50% 5%, 95% 50%, 50% 95%, 5% 50%); }
.rp-ring--inner span:nth-child(2) { clip-path: polygon(50% 5%, 95% 50%, 50% 95%, 5% 50%); transform: rotate(30deg); }
.rp-ring--inner span:nth-child(3) { clip-path: polygon(50% 5%, 95% 50%, 50% 95%, 5% 50%); transform: rotate(60deg); }
.rp-ring--inner span:nth-child(4) { clip-path: polygon(50% 5%, 95% 50%, 50% 95%, 5% 50%); transform: rotate(90deg); }

/* ---------- Center Islamic star (SVG) ---------- */
.rp-star {
    position: relative;
    width: 90px;
    height: 90px;
    z-index: 2;
    animation: rpPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 12px var(--rp-primary)) drop-shadow(0 0 24px rgba(212, 175, 55, 0.4));
}

.rp-star__img {
    display: block;
    width: 100%;
    height: 100%;
}

/* ---------- Greeting text ---------- */
.rp-text {
    position: absolute;
    bottom: -10px;
    width: 100%;
    text-align: center;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 22px;
    letter-spacing: 3px;
    color: var(--rp-text);
    text-shadow: 0 0 20px var(--rp-primary), 0 0 40px rgba(212, 175, 55, 0.3);
    z-index: 2;
    animation: rpGlow 3s ease-in-out infinite;
}

/* ---------- Keyframes ---------- */
@keyframes rpRotateCW {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes rpRotateCCW {
    from { transform: rotate(0deg); }
    to   { transform: rotate(-360deg); }
}

@keyframes rpPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.1); opacity: 0.8; }
}

@keyframes rpGlow {
    0%, 100% { text-shadow: 0 0 20px var(--rp-primary), 0 0 40px rgba(212, 175, 55, 0.3); }
    50%      { text-shadow: 0 0 30px var(--rp-primary), 0 0 60px rgba(212, 175, 55, 0.5); }
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .rp-center {
        width: 200px;
        height: 200px;
    }

    .rp-ring--outer {
        width: 170px;
        height: 170px;
        margin-top: -85px;
        margin-left: -85px;
    }

    .rp-ring--inner {
        width: 115px;
        height: 115px;
        margin-top: -57.5px;
        margin-left: -57.5px;
    }

    .rp-star {
        width: 70px;
        height: 70px;
    }

    .rp-text {
        font-size: 17px;
        letter-spacing: 2px;
        bottom: -5px;
    }
}
