/* Global Style & Variables */
:root {
    --bg-gradient: linear-gradient(135deg, #02160e 0%, #052c1d 50%, #0d462f 100%);
    --primary-gold: #d4af37;
    --light-gold: #f3e5ab;
    --glowing-gold: #ffd700;
    --text-light: #ffffff;
    --text-muted: #c2d5cd;
    --card-bg: rgba(13, 70, 47, 0.45);
    --card-border: rgba(212, 175, 55, 0.25);
    --glass-blur: blur(20px);
    --transition-speed: 0.4s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    min-height: -webkit-fill-available; /* Fixes mobile viewport issues */
    width: 100%;
    color: var(--text-light);
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 16px;
}

/* Background Stars */
#stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    background-color: #fff;
    border-radius: 50%;
    animation: twinkle linear infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); box-shadow: 0 0 10px var(--glowing-gold); }
}

/* Floating Clouds/Nebula Particles in Background */
.bg-cloud {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.03) 0%, transparent 70%);
    filter: blur(40px);
    pointer-events: none;
    z-index: 0;
    animation: floatCloud 25s ease-in-out infinite alternate;
}

@keyframes floatCloud {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 40px) scale(1.2); }
}

/* Floating Sky Lanterns rising gently in the background */
.sky-lantern-bg {
    position: absolute;
    bottom: -100px;
    width: 25px;
    height: 35px;
    background: radial-gradient(circle at center, rgba(255, 215, 0, 0.4) 0%, rgba(212, 175, 55, 0.1) 70%);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 8px 8px 12px 12px;
    pointer-events: none;
    z-index: 1;
    animation: riseUp 20s linear infinite;
    opacity: 0.8;
}

@keyframes riseUp {
    0% {
        transform: translateY(0) translateX(0) scale(0.6);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-120vh) translateX(50px) scale(1.1);
        opacity: 0;
    }
}

/* Hanging Lanterns */
.lantern {
    position: fixed;
    top: -5px;
    width: 65px;
    height: 130px;
    z-index: 3;
    pointer-events: none;
}

.lantern-left {
    left: 20px; /* Safe pixel positioning instead of percentages */
    transform-origin: top center;
    animation: swing 6s ease-in-out infinite alternate;
}

.lantern-right {
    right: 20px; /* Safe pixel positioning instead of percentages */
    transform-origin: top center;
    animation: swing 8s ease-in-out infinite alternate-reverse;
}

@keyframes swing {
    0% { transform: rotate(-4deg); }
    100% { transform: rotate(4deg); }
}

.lantern-glow {
    animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
    0% { r: 9; opacity: 0.6; fill: #ffd700; filter: drop-shadow(0 0 3px #ffc107); }
    100% { r: 15; opacity: 1; fill: #fff; filter: drop-shadow(0 0 12px #ffeb3b); }
}

/* Layout Container */
.container {
    width: 100%;
    max-width: 410px; /* Snug fit on mobile */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    position: relative;
    animation: fadeInUp 0.9s cubic-bezier(0.19, 1, 0.22, 1) both;
}

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

/* Sky Elements */
.sky-elements {
    margin-bottom: -10px;
    filter: drop-shadow(0 0 20px rgba(212,175,55,0.5));
    animation: floatMoon 4s ease-in-out infinite alternate;
    z-index: 3;
}

@keyframes floatMoon {
    0% { transform: translateY(0) rotate(-2deg); }
    100% { transform: translateY(-8px) rotate(2deg); }
}

/* Elegant Card Construction */
.eid-card {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 28px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45), 0 0 35px rgba(212, 175, 55, 0.12);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.2), box-shadow 0.4s;
    animation: glowBorder 8s linear infinite alternate;
}

.eid-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 55px rgba(0, 0, 0, 0.55), 0 0 45px rgba(212, 175, 55, 0.22);
}

@keyframes glowBorder {
    0% { border-color: rgba(212, 175, 55, 0.25); }
    50% { border-color: rgba(212, 175, 55, 0.45); }
    100% { border-color: rgba(212, 175, 55, 0.25); }
}

/* Card Inside Screen */
.card-inside {
    padding: 30px 22px 22px 22px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.glow-text {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-gold);
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.7);
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 2px;
    animation: textPulse 3s ease-in-out infinite alternate;
}

@keyframes textPulse {
    0% { text-shadow: 0 0 10px rgba(212, 175, 55, 0.5); }
    100% { text-shadow: 0 0 20px rgba(212, 175, 55, 0.9), 0 0 30px rgba(255, 215, 0, 0.4); }
}

.ornament-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 8px 0 16px 0;
}

.ornament-divider span {
    display: inline-block;
    height: 1px;
    width: 70px;
    background: linear-gradient(90deg, transparent, var(--primary-gold), transparent);
}

.ornament-mosque {
    color: var(--primary-gold);
    font-size: 1.1rem;
    text-shadow: 0 0 8px rgba(212,175,55,0.4);
    animation: mosqueGlow 3s ease-in-out infinite alternate;
}

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

/* Message Styles */
.wishes-text {
    text-align: center;
    margin-bottom: 20px;
}

.arabic-text {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: var(--primary-gold);
    margin-bottom: 4px;
}

.translation {
    font-size: 0.75rem;
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.personal-note {
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-muted);
}

/* Eidi Widget */
.eidi-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 20px;
    padding: 16px;
    text-align: center;
    transition: border-color 0.3s;
}

.eidi-box:focus-within {
    border-color: rgba(212, 175, 55, 0.4);
}

.eidi-icon {
    font-size: 1.5rem;
    color: var(--primary-gold);
    margin-bottom: 6px;
    animation: heartBeat 2s infinite alternate;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    10% { transform: scale(1.15); }
    20% { transform: scale(1); }
    30% { transform: scale(1.1); }
    40% { transform: scale(1); }
    100% { transform: scale(1); }
}

.eidi-box h3 {
    font-size: 1.1rem;
    margin-bottom: 2px;
    letter-spacing: 0.5px;
    color: var(--light-gold);
}

.upi-recipient {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.upi-recipient strong {
    color: var(--text-light);
}

/* Selector buttons */
.amount-selector {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.amount-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: var(--text-light);
    padding: 12px 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.amount-btn:hover {
    border-color: var(--primary-gold);
    background: rgba(212, 175, 55, 0.1);
    transform: translateY(-1px);
}

.amount-btn.active {
    background: linear-gradient(135deg, var(--primary-gold) 0%, #b89127 100%);
    border-color: var(--primary-gold);
    color: #02160e;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    transform: scale(1.03);
}

/* Custom Input field styling */
.custom-amount-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.25, 1, 0.5, 1), margin 0.35s;
    margin-bottom: 0;
}

.custom-amount-container.show {
    max-height: 80px;
    margin-bottom: 14px;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.currency-symbol {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: var(--primary-gold);
    font-weight: 600;
}

#custom-amount-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 12px;
    padding: 12px 15px 12px 35px;
    color: var(--text-light);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#custom-amount-input:focus {
    border-color: var(--primary-gold);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.35);
}

/* CTAs and buttons with Shimmer Animation */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-gold) 0%, #b89127 100%);
    color: #02160e;
    width: 100%;
    box-shadow: 0 5px 18px rgba(212, 175, 55, 0.3);
}

/* Elegant moving highlight across button */
.btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 30%;
    height: 200%;
    background: rgba(255, 255, 255, 0.35);
    transform: rotate(30deg);
    transition: none;
    animation: buttonShine 4s infinite linear;
}

@keyframes buttonShine {
    0% { left: -60%; }
    20% { left: 140%; }
    100% { left: 140%; }
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.5);
}

.btn-primary:active {
    transform: translateY(1px);
}

.cta-actions {
    margin-bottom: 14px;
}

/* Badge for UPI address */
.upi-id-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.18);
    border: 1px dashed rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.3s, border-color 0.3s;
}

.upi-id-badge:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-gold);
}

.upi-info {
    text-align: left;
}

.upi-info .label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.upi-info .value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-gold);
}

.copy-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.3s;
}

.upi-id-badge:hover .copy-btn {
    color: var(--primary-gold);
}

/* Footer Section */
footer {
    margin-top: 20px;
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

footer i {
    color: #e25858;
}

.heart-pulse {
    animation: heartBeat 1.2s infinite;
}

/* Toast Message */
.toast {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(13, 70, 47, 0.95);
    border: 1px solid var(--primary-gold);
    color: var(--text-light);
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 999;
    opacity: 0;
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.show {
    bottom: 30px;
    opacity: 1;
}

/* Responsiveness and Perfect Phone Alignment */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 0;
        max-width: 100%;
    }

    /* Fixed alignment issue: Secure positioning with pixels from frame edges so lamps NEVER clip */
    .lantern {
        width: 42px;
        height: 84px;
        top: 0;
    }
    .lantern-left { left: 8px; }
    .lantern-right { right: 8px; }
    
    .eid-card {
        border-radius: 24px;
    }

    .glow-text {
        font-size: 2.1rem;
    }

    .card-inside {
        padding: 20px 15px 15px 15px;
    }

    .personal-note {
        font-size: 0.82rem;
    }

    .amount-btn {
        padding: 10px 8px;
        font-size: 0.88rem;
    }

    .btn {
        padding: 12px 20px;
        font-size: 0.92rem;
    }
}

@media (max-width: 360px) {
    /* Hide hanging lanterns on very narrow devices to ensure full space for the card */
    .lantern {
        display: none;
    }
}
