/* HP UP 99 - Global Styles */
/* Gaming font */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&display=swap');

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --glass: rgba(255,255,255,0.05);
    --glass-hover: rgba(255,255,255,0.1);
    --glass-border: rgba(255,255,255,0.1);
    --glass-border-hover: rgba(255,255,255,0.2);
    --text-primary: #fff;
    --text-secondary: #aaa;
    --text-muted: #888;
    --text-dim: #666;
    --accent-green: #00ff88;
    --accent-blue: #00d4ff;
    --accent-red: #ff4444;
    --accent-gold: #FFD700;
    --accent-silver: #C0C0C0;
    --accent-bronze: #CD7F32;
    --gradient-primary: linear-gradient(90deg, #00ff88, #00d4ff);
    --gradient-bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --gradient-hp: linear-gradient(90deg, #ff4444, #ff8844);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 50px;
    --shadow-card: 0 8px 32px rgba(0,0,0,0.3);
    --shadow-header: 0 2px 10px rgba(0,0,0,0.3);
    --font-game: 'Orbitron', sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
    font-family: var(--font-body);
    background: var(--gradient-bg);
    min-height: 100vh;
    color: var(--text-primary);
}

/* Header */
header {
    background: rgba(10,10,15,0.85);
    backdrop-filter: blur(12px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-header);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-family: var(--font-game);
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

nav {
    display: flex;
    gap: 1.5rem;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.95rem;
}

nav a:hover,
nav a.active {
    color: var(--accent-green);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.username {
    color: var(--accent-green);
    font-weight: 500;
}

.logout-btn {
    background: rgba(255,68,68,0.2);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: rgba(255,68,68,0.3);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Cards */
.card {
    background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

.card h2,
.card h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Primary card with gradient border */
.card-primary {
    background: linear-gradient(var(--bg-secondary), var(--bg-secondary)) padding-box,
                linear-gradient(135deg, #00ff88, #00d4ff) border-box;
    border: 1px solid transparent;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 30px rgba(0,255,136,0.05);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    background: var(--glass-hover);
    border: 1px solid var(--glass-border-hover);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-green);
}

input::placeholder {
    color: var(--text-dim);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--bg-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,255,136,0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-green);
    border: 2px solid var(--accent-green);
}

.btn-secondary:hover {
    background: rgba(0,255,136,0.1);
}

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

.btn-full {
    width: 100%;
}

/* Messages */
.message {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.message-success {
    background: rgba(0,255,136,0.2);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
}

.message-error {
    background: rgba(255,68,68,0.2);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
}

/* Progress Bars */
.progress-bar {
    height: 10px;
    background: rgba(255,255,255,0.08);
    border-radius: 5px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(0,255,136,0.4);
}

.progress-fill.hp {
    background: var(--gradient-hp);
    box-shadow: 0 0 8px rgba(255,68,68,0.4);
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-box {
    background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
    border: 1px solid var(--glass-border);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.stat-box:hover {
    border-color: rgba(0,255,136,0.3);
    box-shadow: 0 0 20px rgba(0,255,136,0.08);
}

.stat-value {
    font-family: var(--font-game);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-green);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Level Badge */
.level-badge {
    display: inline-block;
    font-family: var(--font-game);
    background: var(--gradient-primary);
    color: var(--bg-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.9rem;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: var(--glass-hover);
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid rgba(0,255,136,0.3);
}

.table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--glass-border);
}

.table tr:hover {
    background: var(--glass);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tab {
    flex: 1;
    min-width: 100px;
    padding: 1rem;
    background: var(--glass);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.tab:hover {
    background: var(--glass-hover);
}

.tab.active {
    border-color: var(--accent-green);
    background: rgba(0,255,136,0.1);
}

.tab-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.tab-title {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Sliders */
.slider-container {
    margin: 1rem 0;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.slider-value {
    color: var(--accent-green);
    font-weight: 700;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    background: var(--glass-hover);
    border-radius: 4px;
    outline: none;
    padding: 0;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--gradient-primary);
    border-radius: 50%;
    cursor: pointer;
}

/* Live Feed */
.live-feed {
    background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    height: fit-content;
    max-height: 500px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.live-feed h3 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.live-indicator {
    width: 8px;
    height: 8px;
    background: var(--accent-red);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.feed-items {
    overflow-y: auto;
    flex: 1;
}

.feed-item {
    background: var(--glass);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    animation: slideIn 0.3s ease-out;
    border-left: 3px solid transparent;
}

.feed-item.new {
    border-left-color: var(--accent-green);
    background: rgba(0,255,136,0.1);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.feed-user {
    font-weight: 600;
    color: var(--accent-green);
    font-size: 0.9rem;
}

.feed-action {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.25rem 0;
}

.feed-xp {
    font-size: 0.8rem;
    color: var(--accent-blue);
}

.feed-time {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    border: 1px solid var(--glass-border);
}

.auth-card h1 {
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-card p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.auth-link {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-secondary);
}

.auth-link a {
    color: var(--accent-green);
    text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════
   LEVEL UP MODAL
   ═══════════════════════════════════════════════════════════ */
.levelup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.levelup-modal {
    text-align: center;
    padding: 3rem;
    animation: levelUpBounce 0.5s ease-out;
}

.levelup-modal h1 {
    font-family: var(--font-game);
    font-size: 4rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    text-shadow: none;
}

.levelup-modal .level-transition {
    font-family: var(--font-game);
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.levelup-modal .levelup-btn {
    background: var(--gradient-primary);
    color: var(--bg-primary);
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform 0.2s;
}

.levelup-modal .levelup-btn:hover {
    transform: scale(1.05);
}

.levelup-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.levelup-particles span {
    position: absolute;
    font-size: 2rem;
    animation: particleFall 2s linear infinite;
}

@keyframes levelUpBounce {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

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

@keyframes particleFall {
    0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE BOTTOM NAVIGATION
   ═══════════════════════════════════════════════════════════ */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10,10,15,0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    z-index: 1000;
    padding: 0.5rem 0;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

.mobile-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-items a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.7rem;
    gap: 0.2rem;
    padding: 0.25rem 0.5rem;
    transition: color 0.2s;
}

.mobile-nav-items a.active {
    color: var(--accent-green);
}

.mobile-nav-items .nav-icon {
    font-size: 1.4rem;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* Section titles (gaming font) */
.section-title {
    font-family: var(--font-game);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    /* Hide desktop nav on mobile, show bottom nav */
    header nav {
        display: none;
    }

    .mobile-nav {
        display: block;
    }

    body {
        padding-bottom: 70px;
    }

    .container {
        padding: 0 1rem;
        margin: 1rem auto;
    }

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

    .tabs {
        flex-direction: column;
    }

    .tab {
        min-width: auto;
    }

    .levelup-modal h1 {
        font-size: 2.5rem;
    }

    .levelup-modal .level-transition {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Utilities */
.text-center { text-align: center; }
.text-green { color: var(--accent-green); }
.text-blue { color: var(--accent-blue); }
.text-red { color: var(--accent-red); }
.text-muted { color: var(--text-secondary); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none; }
.font-game { font-family: var(--font-game); }
