/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a3e;
    --bg-card: #1a1a3e;
    --bg-card-hover: #232350;
    --accent-primary: #6c63ff;
    --accent-secondary: #00d2ff;
    --success: #00e676;
    --error: #ff5252;
    --warning: #ffab40;
    --text-primary: #ffffff;
    --text-secondary: #b0b0c0;
    --text-muted: #6a6a8a;
    --border-color: rgba(108, 99, 255, 0.2);
    --glass-bg: rgba(26, 26, 62, 0.7);
    --glass-border: rgba(108, 99, 255, 0.15);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(108, 99, 255, 0.3);
    --radius: 16px;
    --radius-sm: 8px;
    --radius-lg: 24px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ===== Reset ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
    color: inherit;
}

input, select {
    font-family: inherit;
    outline: none;
    border: none;
    background: none;
    color: inherit;
}

/* ===== Layout ===== */
.app-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 2rem;
    padding-bottom: 100px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ===== Sidebar Navigation (Desktop) ===== */
.sidebar {
    width: 240px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1rem;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition);
    overflow-y: auto;
}

.sidebar-logo {
    text-align: center;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.sidebar-logo h1 {
    font-size: 1.4rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-logo .subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.sidebar-nav {
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition);
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.sidebar-nav a:hover {
    background: rgba(108, 99, 255, 0.1);
    color: var(--text-primary);
}

.sidebar-nav a.active {
    background: rgba(108, 99, 255, 0.15);
    color: var(--accent-primary);
    font-weight: 600;
}

.sidebar-nav a .nav-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.sidebar-level {
    padding: 1rem;
    background: rgba(108, 99, 255, 0.1);
    border-radius: var(--radius-sm);
    text-align: center;
    margin-top: auto;
}

.sidebar-level .level-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-level .level-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin: 0.25rem 0;
}

.sidebar-level .xp-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.sidebar-level .xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 2px;
    transition: width 0.5s ease;
}

.sidebar-level .xp-text {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* With sidebar offset */
.has-sidebar .main-content {
    margin-left: 240px;
}

/* ===== Bottom Navigation (Mobile) ===== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    z-index: 100;
    padding: 0.5rem 0;
    backdrop-filter: blur(10px);
}

.bottom-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.65rem;
    transition: all var(--transition);
}

.bottom-nav a .nav-icon {
    font-size: 1.3rem;
}

.bottom-nav a.active {
    color: var(--accent-primary);
}

.bottom-nav a:hover {
    color: var(--text-primary);
}

/* ===== Page Header ===== */
.page-header {
    margin-bottom: 2rem;
}

.page-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-accent { color: var(--accent-primary); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.grid { display: grid; }
.hidden { display: none !important; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* ===== Background decoration ===== */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 20% 50%, rgba(108, 99, 255, 0.05) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 20%, rgba(0, 210, 255, 0.03) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}
