﻿@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;500;700;900&display=swap');

:root {
    --brand-red: #D22027;
    --brand-red-glow: rgba(210, 32, 39, 0.6);
    --bg-dark: #0a0a0c;
    --panel-bg: rgba(20, 20, 24, 0.7);
    --panel-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #888899;
    --gold: #FFD700;
    --silver: #C0C0C0;
    --bronze: #CD7F32;
    --diamond: #00FFFF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
}

.orb-1 {
    width: 40vw;
    height: 40vw;
    background: var(--brand-red);
    top: -10%;
    left: -10%;
    animation: float 20s ease-in-out infinite alternate;
}

.orb-2 {
    width: 30vw;
    height: 30vw;
    background: #ff4b4b;
    bottom: 10%;
    right: -5%;
    animation: float 15s ease-in-out infinite alternate-reverse;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10%, 10%) scale(1.1); }
}

/* Common Layout */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    position: relative;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    filter: drop-shadow(0 0 10px var(--brand-red-glow));
}

.brand-text h1 {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 2px;
    margin: 0;
    line-height: 1;
}

.brand-text span {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 4px;
}

.title-container {
    text-align: right;
}

.title-container h2 {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.parameters-btn {
    color: var(--brand-red);
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.parameters-btn:hover {
    border-bottom-color: var(--brand-red);
    text-shadow: 0 0 8px var(--brand-red-glow);
}

/* Progress Section */
.progress-section {
    padding: 2rem;
    margin-bottom: 2rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.progress-header h3 {
    font-size: 1.2rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.total-counter {
    font-size: 4rem;
    font-weight: 900;
    color: var(--brand-red);
    line-height: 1;
    text-shadow: 0 0 20px var(--brand-red-glow);
}

.progress-bar-container {
    margin-bottom: 3rem;
    padding: 0 10px;
}

.progress-track {
    width: 100%;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    border: 1px solid var(--panel-border);
    position: relative;
}

/* Progress fill loading animation */
.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(45deg, var(--brand-red) 25%, #e03232 25%, #e03232 50%, var(--brand-red) 50%, var(--brand-red) 75%, #e03232 75%, #e03232 100%);
    background-size: 30px 30px;
    border-radius: 10px;
    box-shadow: 0 0 15px var(--brand-red-glow);
    transition: width 2s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: visible;
}

.progress-fill.loading-effect {
    animation: moveStripes 1s linear infinite;
}

@keyframes moveStripes {
    0% { background-position: 0 0; }
    100% { background-position: 30px 0; }
}

/* Glowing Pulse Flare at the tip of the progress bar */
.progress-fill.loading-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    transform: translate(50%, -50%);
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 20px 10px var(--brand-red), 0 0 40px #fff;
    animation: pulseGlow 1.2s infinite alternate;
    z-index: 5;
}

@keyframes pulseGlow {
    0% { transform: translate(50%, -50%) scale(0.8); opacity: 0.7; }
    100% { transform: translate(50%, -50%) scale(1.3); opacity: 1; }
}

.tier-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.5s ease;
    z-index: 2;
}

.marker-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 4px solid var(--panel-border);
    transition: all 0.5s ease;
}

.marker-label {
    position: absolute;
    top: 25px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

/* Tier Active States */
.tier-marker.active .marker-dot {
    border-color: white;
    box-shadow: 0 0 10px white;
    background: white;
}

.tier-marker.silver-tier.active .marker-dot { border-color: var(--silver); box-shadow: 0 0 15px var(--silver); background: var(--silver); }
.tier-marker.gold-tier.active .marker-dot { border-color: var(--gold); box-shadow: 0 0 15px var(--gold); background: var(--gold); }
.tier-marker.diamond-tier.active .marker-dot { border-color: var(--diamond); box-shadow: 0 0 15px var(--diamond); background: var(--diamond); }
.tier-marker.mystery-tier.active .marker-dot { border-color: #ff4500; box-shadow: 0 0 15px #ff4500; background: #ff4500; }

.tier-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.tier-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    opacity: 0.5;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: default;
    position: relative;
    overflow: hidden;
}

.tier-card.unlocked {
    opacity: 1;
    background: rgba(255, 255, 255, 0.05);
}

.tier-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.2rem;
}

.silver-icon { background: linear-gradient(135deg, #e0e0e0, #888888); }
.gold-icon { background: linear-gradient(135deg, #ffe55c, #d4af37); }
.diamond-icon { background: linear-gradient(135deg, #b9f2ff, #00d2ff); }
.mystery-icon { 
    background: linear-gradient(135deg, #ff8c00, #ff0000); 
    color: white; 
}

.tier-card h4 {
    color: white;
    margin-bottom: 0.5rem;
}

.tier-card .goal {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.tier-card .reward {
    font-weight: 700;
    color: var(--brand-red);
}

/* Leaderboard Section */
.leaderboard-section {
    padding: 2rem;
}

.leaderboard-header {
    margin-bottom: 1.5rem;
}

.leaderboard-header h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.leaderboard-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.table-container {
    overflow-x: auto;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th, 
.leaderboard-table td {
    padding: 1.2rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.leaderboard-table th {
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.leaderboard-table tbody tr {
    transition: background 0.3s ease;
}

.leaderboard-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.leaderboard-table td {
    font-weight: 500;
}

/* Ranks */
.rank-1, .rank-2, .rank-3 { font-weight: 900; font-size: 1.2rem; }
.rank-1 { color: var(--gold); text-shadow: 0 0 10px rgba(255,215,0,0.5); }
.rank-2 { color: var(--silver); text-shadow: 0 0 10px rgba(192,192,192,0.5); }
.rank-3 { color: var(--bronze); text-shadow: 0 0 10px rgba(205,127,50,0.5); }

/* Filters */
.filters-container {
    display: flex;
    gap: 10px;
    padding: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: -1rem;
    margin-bottom: 1rem;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.filter-btn.active {
    background: var(--brand-red);
    color: white;
    border-color: var(--brand-red);
    box-shadow: 0 0 15px var(--brand-red-glow);
}

/* Admin Modal CSS */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #111;
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--brand-red);
    box-shadow: 0 0 30px rgba(210, 32, 39, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 1rem;
}

.close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.admin-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--panel-border);
    color: white;
    padding: 0.5rem;
    border-radius: 8px;
    font-family: inherit;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.5rem;
}

.admin-table th, .admin-table td {
    padding: 0.5rem;
    text-align: left;
}

.admin-btn-primary {
    background: var(--brand-red);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.admin-btn-primary:hover {
    background: #ff4b4b;
    box-shadow: 0 0 15px var(--brand-red-glow);
}

.admin-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--panel-border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.admin-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.admin-btn-danger {
    background: transparent;
    color: #ff4b4b;
    border: 1px solid #ff4b4b;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
}
.admin-btn-danger:hover {
    background: #ff4b4b;
    color: white;
}

.admin-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    border-top: 1px solid var(--panel-border);
    padding-top: 1.5rem;
}

/* Custom Color Illumination for Tiers on Hover */
#card-silver:hover {
    box-shadow: 0 10px 30px rgba(192, 192, 192, 0.4), inset 0 0 15px rgba(192, 192, 192, 0.2);
    border-color: #c0c0c0;
    background: rgba(192, 192, 192, 0.1);
    transform: translateY(-8px) scale(1.02);
}

#card-gold:hover {
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4), inset 0 0 15px rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    transform: translateY(-8px) scale(1.02);
}

#card-diamond:hover {
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.4), inset 0 0 15px rgba(0, 255, 255, 0.2);
    border-color: #00ffff;
    background: rgba(0, 255, 255, 0.1);
    transform: translateY(-8px) scale(1.02);
}

/* Prize Glow Animation for Mystery Tier Border */
@keyframes prizeBorderGlow {
    0% { 
        box-shadow: 0 0 15px #ffd700, inset 0 0 10px #ffd700, 0 0 30px #ff4500; 
        border-color: #ffd700; 
    }
    50% { 
        box-shadow: 0 0 30px #fff, inset 0 0 20px #fff, 0 0 60px #ff0000; 
        border-color: #ffffff; 
    }
    100% { 
        box-shadow: 0 0 15px #ffd700, inset 0 0 10px #ffd700, 0 0 30px #ff4500; 
        border-color: #ffd700; 
    }
}

#card-mystery:hover {
    background: linear-gradient(to bottom, rgba(30,20,0,0.9), rgba(255, 69, 0, 0.3));
    animation: prizeBorderGlow 1.5s infinite ease-in-out;
    transform: translateY(-8px) scale(1.02);
}

/* Motivational Quote */
.motivation-quote {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--text-main);
    margin-top: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 2rem;
    border: 2px solid var(--brand-red);
    box-shadow: inset 0 0 20px var(--brand-red-glow), 0 0 20px var(--brand-red-glow);
    animation: pulseQuote 2s infinite alternate;
}

@keyframes pulseQuote {
    0% { transform: scale(1); box-shadow: inset 0 0 15px var(--brand-red-glow), 0 0 15px var(--brand-red-glow); }
    100% { transform: scale(1.02); box-shadow: inset 0 0 30px var(--brand-red-glow), 0 0 30px var(--brand-red-glow); }
}

/* Enhance Admin Toggle Button */
.admin-toggle-btn {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    cursor: pointer;
    border-radius: 30px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
    transition: all 0.3s;
    z-index: 1000;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}
.admin-btn-text {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
}
.admin-toggle-btn:hover {
    background: var(--brand-red);
    box-shadow: 0 0 20px var(--brand-red-glow);
    transform: scale(1.05);
}
