/* General Body and Font Styles */
body { 
    font-family: 'Poppins', sans-serif; 
    background-color: #1a0b2e; 
    color: #f0f0f0; 
}

/* Background Image Handling */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    /* UPDATED: Replaced external URL with local asset. Change file name if needed. */
    background: url('assets/images/background-banner.png') center/cover no-repeat;
    opacity: 0.5;
    z-index: -1;
    transition: background-image 0.5s ease-in-out;
}

body.app-background::before {
    /* UPDATED: Replaced external URL with local asset. Change file name if needed. */
    background-image: url('assets/images/background-banner.png');
    opacity: 0.3;
}

/* Utility and Component Styles */
.ludo-bg-pattern { 
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px); 
    background-size: 15px 15px; 
}
.glassmorphism { 
    background: rgba(40, 25, 65, 0.6); 
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
}
.modal-overlay { 
    background: rgba(0, 0, 0, 0.7); 
    backdrop-filter: blur(5px); 
}

/* Page Navigation and Animation */
.page { display: none; }
.page.active { 
    display: block; 
    animation: fadeIn 0.5s ease; 
}
@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}
.bottom-nav-item.active { color: #facc15; }

/* QR Code Style */
#qrcode-container img { 
    background: white; 
    border-radius: 8px; 
    margin: 0 auto; 
    width: 160px !important; /* Force a consistent size */
    height: 160px !important;
}

/* Winner and Level Up Animations */
.winner-animation, .level-up-animation, .payment-success-animation {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000;
    background: rgba(0,0,0,0.7); display: flex; flex-direction: column;
    justify-content: center; align-items: center; text-align: center;
}
.winner-animation i { font-size: 100px; color: #facc15; animation: crown-pop 0.5s ease-out; }
.winner-animation p { font-size: 2rem; font-weight: bold; color: white; animation: text-fade-in 1s ease-out; }
@keyframes crown-pop { 0% { transform: scale(0); } 80% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes text-fade-in { 0% { opacity: 0; } 100% { opacity: 1; } }

.level-up-animation i { font-size: 80px; color: #4ade80; animation: level-star-pop 0.6s ease-out; }
.level-up-animation p { font-size: 2.5rem; font-weight: bold; color: white; animation: text-fade-in 1s ease-out; }
.level-up-animation .level-number { font-size: 3.5rem; color: #facc15; text-shadow: 0 0 10px rgba(250, 204, 21, 0.8); }
@keyframes level-star-pop { 0% { transform: scale(0); } 80% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* Payment Success Animation Styles */
.payment-success-animation .circle-icon {
    width: 100px; height: 100px; border-radius: 50%; background-color: #22c55e;
    display: flex; justify-content: center; align-items: center;
    animation: success-pop 0.5s ease-out;
}
.payment-success-animation .circle-icon i { font-size: 50px; color: white; }
.payment-success-animation .success-text { font-size: 1.8rem; font-weight: bold; color: white; margin-top: 20px; animation: text-fade-in 0.5s 0.2s ease-out backwards; }
.payment-success-animation .amount-text { font-size: 2.5rem; font-weight: bold; color: #4ade80; text-shadow: 0 0 10px rgba(74, 222, 128, 0.7); animation: text-fade-in 0.5s 0.4s ease-out backwards; }
@keyframes success-pop { 0% { transform: scale(0); } 80% { transform: scale(1.1); } 100% { transform: scale(1); } }


/* History and Leaderboard Styles */
.history-item .status-pending { color: #facc15; }
.history-item .status-approved, .history-item .status-completed { color: #4ade80; }
.history-item .status-rejected { color: #f87171; }
.skeleton { animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.leaderboard-tab-btn.active-tab, .history-tab-btn.active-tab {
    color: #facc15;
    border-bottom: 2px solid #facc15;
    background-color: rgba(250, 204, 21, 0.1);
}
.leaderboard-content.hidden, .history-content.hidden { display: none; }

/* Battle Section Styles */
.vs-text {
    font-weight: 800; font-size: 1.5rem; color: #f87171;
    text-shadow: 0 0 5px rgba(248, 113, 113, 0.7);
}
.battle-card {
    position: relative; overflow: hidden;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.battle-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}
.battle-card::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(50, 20, 80, 0.7), rgba(20, 10, 40, 0.7));
    z-index: -1; border-radius: inherit;
}
.prize-glow { text-shadow: 0 0 8px rgba(74, 222, 128, 0.8); }
.button-gradient-1 { background: linear-gradient(to right, #ef4444, #f97316); box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4); }
.button-gradient-2 { background: linear-gradient(to right, #22c55e, #10b981); box-shadow: 0 4px 10px rgba(34, 197, 94, 0.4); }
.button-gradient-3 { background: linear-gradient(to right, #3b82f6, #60a5fa); box-shadow: 0 4px 10px rgba(59, 130, 246, 0.4); }
.button-gradient-4 { background: linear-gradient(to right, #a855f7, #d946ef); box-shadow: 0 4px 10px rgba(168, 85, 247, 0.4); }
.button-gradient-disabled { background: #6b7280; box-shadow: none; cursor: not-allowed; }
.button-hover-effect:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0,0,0,0.4); }
.pulse-icon { animation: pulse-icon 1.5s infinite; }
@keyframes pulse-icon { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }

/* Deposit Modal Styles */
.amount-suggestion-btn {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #f0f0f0;
    padding: 8px;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.2s, transform 0.2s;
}
.amount-suggestion-btn:hover {
    background-color: rgba(250, 204, 21, 0.3);
    transform: translateY(-2px);
}
.amount-suggestion-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px #facc15;
}
.step-indicator {
    background-color: rgba(250, 204, 21, 0.2);
    color: #facc15;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 9999px;
}
.instruction-box {
    background-color: rgba(59, 130, 246, 0.1);
    border-left: 4px solid #3b82f6;
    padding: 12px;
    border-radius: 8px;
}


/* Profile Section Styles */
.profile-header-bg {
    background: url('assets/images/background-banner.png') center/cover no-repeat;
    position: relative; overflow: hidden;
}
.profile-header-bg::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(26, 11, 46, 0.8), rgba(26, 11, 46, 0.2));
    z-index: 0;
}

/* === NEW PROFILE HEADER STYLES START === */
.profile-header-new {
    background: linear-gradient(135deg, #4f46e5, #a855f7); /* New Gradient */
    border: none; /* Remove border if any */
}
.profile-header-new::before {
    background: none; /* Remove the overlay */
}
/* === NEW PROFILE HEADER STYLES END === */

.profile-avatar-container { position: relative; z-index: 1; transition: transform 0.3s ease-in-out; }
.profile-avatar-container:hover { transform: scale(1.05); }

/* === UPDATED STAT CARD STYLES START === */
.profile-stat-card { 
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    background-color: rgba(255, 255, 255, 0.05); /* Lighter background */
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}
.profile-stat-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 8px 25px rgba(0,0,0,0.5); 
    border-color: rgba(250, 204, 21, 0.5);
}
/* === UPDATED STAT CARD STYLES END === */

.level-badge {
    background: linear-gradient(45deg, #facc15, #f97316); color: #1a0b2e;
    font-weight: bold; padding: 4px 12px; border-radius: 9999px;
    box-shadow: 0 2px 8px rgba(250, 204, 21, 0.4);
    animation: bounce-in 0.5s ease-out;
}
@keyframes bounce-in { 0% { transform: scale(0); opacity: 0; } 70% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); } }
.kyc-badge {
    font-size: 0.7rem; font-weight: bold; padding: 3px 10px;
    border-radius: 9999px; text-transform: uppercase;
}
.kyc-verified { background-color: #4ade80; color: #1a0b2e; }
.kyc-pending { background-color: #facc15; color: #1a0b2e; }
.kyc-rejected { background-color: #f87171; color: #1a0b2e; }
.kyc-not-started { background-color: #9ca3af; color: #1a0b2e; }

/* Daily Spin Wheel Styles */
#spin-wheel-container {
    position: relative; width: 250px; height: 250px; margin: 20px auto;
    border-radius: 50%; border: 8px solid #facc15;
    box-shadow: 0 0 20px rgba(250, 204, 21, 0.6);
    overflow: hidden; transition: transform 4s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.wheel-segment {
    position: absolute; width: 50%; height: 50%; top: 50%; left: 50%;
    transform-origin: 0% 0%; display: flex; align-items: center;
    justify-content: center; font-weight: bold; font-size: 0.9rem;
    color: #1a0b2e; transform: rotate(var(--angle));
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}
.wheel-segment-inner { display: block; transform: rotate(45deg); padding-left: 20px; }
#spin-button {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 80px; height: 80px; border-radius: 50%;
    background: linear-gradient(45deg, #facc15, #f97316);
    color: #1a0b2e; font-weight: bold; font-size: 1.2rem;
    border: 4px solid #fff; cursor: pointer;
    box-shadow: 0 0 15px rgba(250, 204, 21, 0.8); z-index: 10;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.1s ease-in-out;
}
#spin-button:active { transform: translate(-50%, -50%) scale(0.95); }
#spin-pointer {
    position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
    width: 0; height: 0; border-left: 15px solid transparent;
    border-right: 15px solid transparent; border-bottom: 25px solid #ef4444;
    z-index: 11;
}

/* Daily Streak Styles */
.streak-day.completed {
    background: linear-gradient(45deg, #4ade80, #22c55e); color: #1a0b2e;
    box-shadow: 0 4px 10px rgba(74, 222, 128, 0.4);
    transform: scale(1.05); border: 2px solid #a7f3d0;
}
.streak-day.current {
    background: linear-gradient(45deg, #facc15, #f97316); color: #1a0b2e;
    box-shadow: 0 4px 15px rgba(250, 204, 21, 0.6);
    animation: pulse-glow 1.5s infinite alternate; border: 2px solid #fde047;
}
.streak-day { transition: all 0.3s ease-in-out; border: 2px solid transparent; }
@keyframes pulse-glow { 0% { box-shadow: 0 4px 15px rgba(250, 204, 21, 0.6); } 100% { box-shadow: 0 4px 25px rgba(250, 204, 21, 0.9); } }

/* PWA Install Button */
#install-button {
    position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
    background-color: #facc15; color: #1a0b2e; padding: 12px 24px;
    border: none; border-radius: 9999px; font-weight: bold;
    font-size: 1rem; cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 1000; display: none;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .bottom-nav-item span { font-size: 0.65rem; }
    .bottom-nav-item i { font-size: 1.1rem; }
}
