:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-light: #f8fafc;
    --bg-dark: #0f172a;
    --card-light: #ffffff;
    --card-dark: #1e293b;
    --text-light: #1e293b;
    --text-dark: #f1f5f9;
    --text-muted: #64748b;
    --accent: #f43f5e;
    --success: #10b981;
    --warning: #f59e0b;
    --radius: 16px;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
}

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

body {
    background-color: var(--bg-light);
    color: var(--text-light);
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
    padding-bottom: 80px; /* Space for bottom nav */
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
}

body.dark-mode {
    background-color: var(--bg-dark);
    color: var(--text-dark);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* Typography */
h1, h2, h3 {
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* Layout */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Cards */
.card {
    background: var(--card-light);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.05);
}

.dark-mode .card {
    background: var(--card-dark);
    border-color: rgba(255,255,255,0.05);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
}

input, select {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    background: var(--card-light);
    color: var(--text-light);
    transition: var(--transition);
    font-size: 1rem;
}

.dark-mode input, .dark-mode select {
    border-color: #334155;
    background: #0f172a;
    color: var(--text-dark);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    width: 100%;
    text-decoration: none;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--card-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 1100;
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.05);
}

.dark-mode .theme-toggle {
    background: var(--card-dark);
    border-color: rgba(255,255,255,0.1);
}

/* Glassmorphism elements */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: none; }
}

.animate-in {
    animation: fadeIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    border-top: 1px solid var(--glass-border);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    transition: var(--transition);
}

.nav-item.active {
    color: var(--primary);
}

.nav-item i {
    font-size: 22px;
    margin-bottom: 4px;
}

/* Custom Checkbox/Combobox Styling */
.saved-accounts-wrapper {
    margin-bottom: 20px;
}

#savedAccounts {
    margin-top: 5px;
}

/* Sticker Grid */
.sticker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

@media (max-width: 400px) {
    .sticker-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.sticker-card {
    min-height: 80px;
    background: var(--card-light);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid rgba(0,0,0,0.05);
    cursor: pointer;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    padding: 6px 4px;
}

.dark-mode .sticker-card {
    background: var(--card-dark);
    border-color: rgba(255,255,255,0.05);
}

.sticker-card:hover {
    transform: translateY(-2px);
}

.sticker-card.owned {
    background: #dcfce7 !important;
    border: 2px solid #22c55e !important;
    color: #166534 !important;
}

.dark-mode .sticker-card.owned {
    background: #064e3b !important;
    border-color: #10b981 !important;
    color: #ecfdf5 !important;
}

.sticker-card.repeated {
    background: #ffedd5 !important;
    border: 2px solid #f97316 !important;
    color: #9a3412 !important;
}

.dark-mode .sticker-card.repeated {
    background: #7c2d12 !important;
    border-color: #fb923c !important;
    color: #fff7ed !important;
}

.sticker-card .number {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 2px;
}

.sticker-card .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #f97316;
    color: white;
    font-size: 8px;
    padding: 1px 5px;
    border-radius: 10px;
    font-weight: 800;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.stat-box {
    padding: 16px;
    border-radius: 16px;
    background: var(--primary);
    color: white;
}

.stat-box.alt {
    background: var(--accent);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
}

.stat-label {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* Chips and Info Boxes */
.chip {
    background: var(--bg-light);
    color: var(--text-light);
}
.dark-mode .chip {
    background: #334155;
    color: var(--text-dark);
}

.info-box {
    background: var(--bg-light);
    color: var(--text-light);
}
.dark-mode .info-box {
    background: #334155;
    color: var(--text-dark);
}
