/* =====================================================
   HELLFIRE GAME - DASHBOARD STYLES
   ===================================================== */

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(139, 0, 0, 0.3);
    padding: 15px 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 900;
    text-decoration: none;
    letter-spacing: 0.05em;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    text-align: right;
}

.user-name {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.user-level {
    display: block;
    font-size: 0.85rem;
    color: var(--fire-middle);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(139, 0, 0, 0.2);
    border: 1px solid rgba(139, 0, 0, 0.4);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-normal);
}

.logout-btn:hover {
    color: var(--text-primary);
    background: rgba(139, 0, 0, 0.4);
    border-color: var(--fire-outer);
}

.logout-btn svg {
    width: 18px;
    height: 18px;
}

/* Dashboard Container */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 20px 40px;
    min-height: 100vh;
}

/* Section Titles */
.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-fire);
    margin-bottom: 25px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.section-title svg {
    width: 24px;
    height: 24px;
    stroke: var(--fire-middle);
}

/* Stats Section */
.stats-section {
    margin-bottom: 40px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(139, 0, 0, 0.3);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    transition: var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--fire-middle);
    box-shadow: 0 10px 40px rgba(255, 69, 0, 0.2);
}

.stat-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--gradient-lava);
    flex-shrink: 0;
}

.stat-icon svg {
    width: 30px;
    height: 30px;
    stroke: white;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Combat Section */
.combat-section {
    margin-bottom: 40px;
}

.combat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.combat-stat {
    text-align: center;
    padding: 25px 20px;
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(80, 80, 80, 0.3);
    border-radius: 12px;
    transition: var(--transition-normal);
}

.combat-stat:hover {
    border-color: rgba(139, 0, 0, 0.5);
}

.combat-value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--fire-middle);
    margin-bottom: 5px;
}

.combat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* =====================================================
   REDEEM CODE SECTION
   ===================================================== */
.redeem-section {
    margin-bottom: 40px;
}

.redeem-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.redeem-input-area {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(139, 0, 0, 0.3);
    border-radius: 16px;
    padding: 25px;
}

.redeem-form {
    margin-bottom: 20px;
}

.redeem-input-group {
    display: flex;
    gap: 12px;
}

.redeem-input {
    flex: 1;
    padding: 14px 18px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-primary);
    background: rgba(40, 40, 40, 0.8);
    border: 2px solid rgba(80, 80, 80, 0.5);
    border-radius: 10px;
    outline: none;
    transition: var(--transition-normal);
}

.redeem-input::placeholder {
    text-transform: none;
    letter-spacing: normal;
    color: var(--text-muted);
}

.redeem-input:focus {
    border-color: var(--fire-middle);
    box-shadow: 0 0 20px rgba(255, 123, 0, 0.2);
}

.redeem-btn {
    padding: 14px 28px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: white;
    background: var(--gradient-lava);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: 0 0 20px rgba(255, 69, 0, 0.3);
    min-width: 120px;
}

.redeem-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(255, 69, 0, 0.5);
}

.redeem-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.redeem-btn .btn-loader {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

.redeem-btn.loading .btn-text {
    display: none;
}

.redeem-btn.loading .btn-loader {
    display: block;
}

.redeem-message {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: none;
}

.redeem-message.show {
    display: block;
}

.redeem-message.success {
    background: rgba(0, 139, 0, 0.2);
    border: 1px solid rgba(0, 200, 0, 0.4);
    color: #6bff6b;
}

.redeem-message.error {
    background: rgba(139, 0, 0, 0.2);
    border: 1px solid rgba(220, 20, 60, 0.4);
    color: #ff6b6b;
}

/* Redeem Rewards */
.redeem-rewards {
    background: rgba(0, 100, 0, 0.15);
    border: 1px solid rgba(0, 200, 0, 0.3);
    border-radius: 12px;
    padding: 20px;
    animation: rewardPop 0.5s ease;
}

@keyframes rewardPop {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.redeem-rewards h4 {
    color: #6bff6b;
    margin-bottom: 15px;
    font-size: 1rem;
}

.rewards-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.reward-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 0.9rem;
}

.reward-item .reward-icon {
    font-size: 1.2rem;
}

.reward-item .reward-value {
    font-weight: 700;
    color: var(--text-fire);
}

/* Redeem History */
.redeem-history {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(139, 0, 0, 0.3);
    border-radius: 16px;
    padding: 25px;
    max-height: 400px;
    overflow-y: auto;
}

.history-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-loading {
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(40, 40, 40, 0.6);
    border-radius: 10px;
    transition: var(--transition-fast);
}

.history-item:hover {
    background: rgba(60, 60, 60, 0.6);
}

.history-code {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--fire-middle);
    font-size: 0.9rem;
}

.history-rewards {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.history-reward {
    display: flex;
    align-items: center;
    gap: 4px;
}

.history-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

.history-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 30px 20px;
    font-size: 0.9rem;
}

/* Leaderboard Section */
.leaderboard-section {
    margin-bottom: 40px;
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.leaderboard-tabs {
    display: flex;
    gap: 10px;
}

.lb-tab {
    padding: 10px 20px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(40, 40, 40, 0.8);
    border: 1px solid rgba(80, 80, 80, 0.5);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-normal);
}

.lb-tab:hover {
    color: var(--text-secondary);
    border-color: rgba(139, 0, 0, 0.5);
}

.lb-tab.active {
    color: var(--text-primary);
    background: var(--gradient-lava);
    border-color: transparent;
}

.leaderboard-content {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(139, 0, 0, 0.3);
    border-radius: 16px;
    overflow: hidden;
}

.leaderboard-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(139, 0, 0, 0.3);
    border-top-color: var(--fire-middle);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 15px;
}

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

.leaderboard-table.show {
    display: table;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(80, 80, 80, 0.3);
}

.leaderboard-table th {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    background: rgba(30, 30, 30, 0.8);
}

.leaderboard-table tbody tr {
    transition: var(--transition-fast);
}

.leaderboard-table tbody tr:hover {
    background: rgba(139, 0, 0, 0.1);
}

.leaderboard-table tbody tr:last-child td {
    border-bottom: none;
}

.rank-cell {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-muted);
}

.rank-1 {
    color: #ffd700;
}

.rank-2 {
    color: #c0c0c0;
}

.rank-3 {
    color: #cd7f32;
}

.player-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-lava);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    color: white;
    font-size: 1rem;
}

.player-name {
    font-weight: 600;
    color: var(--text-primary);
}

.value-cell {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--fire-middle);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-logo {
        font-size: 1.4rem;
    }

    .nav-user {
        gap: 15px;
    }

    .user-name {
        font-size: 0.9rem;
    }

    .logout-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
    }

    .logout-btn span {
        display: none;
    }

    .dashboard-container {
        padding: 90px 15px 30px;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
    }

    .stat-value {
        font-size: 1.6rem;
    }

    .leaderboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .leaderboard-tabs {
        width: 100%;
        justify-content: stretch;
    }

    .lb-tab {
        flex: 1;
        text-align: center;
        padding: 10px 15px;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 12px 15px;
    }

    .player-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    /* Redeem Responsive - Tablet */
    .redeem-container {
        grid-template-columns: 1fr;
    }

    .redeem-input-group {
        flex-direction: column;
    }

    .redeem-btn {
        width: 100%;
    }

    .redeem-history {
        max-height: 300px;
    }

    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 15px;
    }

    .user-info {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .combat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .combat-stat {
        padding: 20px 15px;
    }

    .combat-value {
        font-size: 1.5rem;
    }

    .leaderboard-table th:first-child,
    .leaderboard-table td:first-child {
        padding-left: 15px;
    }
}