/* Typemaster - Main CSS */
:root {
    --primary: #6C63FF;
    --secondary: #FF6B9D;
    --accent: #00D9A5;
    --warning: #FFB84D;
    --error: #FF6B6B;
    --bg-dark: #1a1a2e;
    --bg-medium: #16213e;
    --bg-light: #0f3460;
    --text-color: #fff;
    --text-muted: #aaa;
    --card-bg: rgba(255,255,255,0.05);
}

/* Hell-Modus */
body.light-mode {
    --bg-dark: #f5f5f5;
    --bg-medium: #e8e8e8;
    --bg-light: #ffffff;
    --text-color: #1a1a2e;
    --text-muted: #666;
    --card-bg: rgba(0,0,0,0.05);
}

body.light-mode { color: var(--text-color); }
body.light-mode .card { background: var(--card-bg); border-color: rgba(0,0,0,0.1); }
body.light-mode .dashboard-header { background: rgba(255,255,255,0.8); }
body.light-mode .nav-links a { color: #666; }
body.light-mode .nav-links a:hover { color: var(--primary); }
body.light-mode .welcome-text p { color: var(--text-muted); }
body.light-mode .stat-label { color: var(--text-muted); }
body.light-mode .level-item.locked { background: rgba(0,0,0,0.1); color: #999; }
body.light-mode .level-item-name { color: rgba(0,0,0,0.8); }
body.light-mode input, body.light-mode select, body.light-mode textarea {
    background: rgba(0,0,0,0.05); color: var(--text-color); border-color: rgba(0,0,0,0.2);
}

/* Theme Hintergründe mit Icons */
.theme-icons-container {
    position: fixed;
    top: 80px; left: 0; right: 0; bottom: 60px;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
    opacity: 0.1;
}

.theme-icon {
    position: absolute;
    font-size: 2rem;
    animation: floatIcon 20s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(5deg); }
    50% { transform: translateY(0) rotate(0deg); }
    75% { transform: translateY(20px) rotate(-5deg); }
}

/* Theme-Farben - Dunkel-Modus (auf html und body anwenden) */
html.theme-safari, body.theme-safari { background: linear-gradient(135deg, #2d5016 0%, #1a3a0a 50%, #0d2605 100%) !important; }
html.theme-zoo, body.theme-zoo { background: linear-gradient(135deg, #4a3728 0%, #2d2118 50%, #1a130e 100%) !important; }
html.theme-ocean, body.theme-ocean { background: linear-gradient(135deg, #006994 0%, #004466 50%, #002233 100%) !important; }
html.theme-space, body.theme-space { background: linear-gradient(135deg, #1a1a3e 0%, #0d0d2e 50%, #05051e 100%) !important; }
html.theme-princess, body.theme-princess { background: linear-gradient(135deg, #ff69b4 0%, #da70d6 50%, #ba55d3 100%) !important; }
html.theme-rainbow, body.theme-rainbow { background: linear-gradient(135deg, #ff6b6b 0%, #ffd93d 25%, #6bcb77 50%, #4d96ff 75%, #9b59b6 100%) !important; }
html.theme-candy, body.theme-candy { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #ffecd2 100%) !important; }
html.theme-forest, body.theme-forest { background: linear-gradient(135deg, #134e5e 0%, #1a3c34 50%, #0d261f 100%) !important; }
html.theme-dinosaur, body.theme-dinosaur { background: linear-gradient(135deg, #4a6741 0%, #2d402a 50%, #1a2618 100%) !important; }
html.theme-arctic, body.theme-arctic { background: linear-gradient(135deg, #74b9ff 0%, #5a9fd4 50%, #4089be 100%) !important; }
html.theme-farm, body.theme-farm { background: linear-gradient(135deg, #8b7355 0%, #6b5344 50%, #4a3a30 100%) !important; }
html.theme-garden, body.theme-garden { background: linear-gradient(135deg, #56ab2f 0%, #3d7a22 50%, #255015 100%) !important; }
html.theme-jungle, body.theme-jungle { background: linear-gradient(135deg, #11998e 0%, #0d7d74 50%, #065a54 100%) !important; }
html.theme-pirates, body.theme-pirates { background: linear-gradient(135deg, #2c3e50 0%, #1a252f 50%, #0d1318 100%) !important; }
html.theme-superhero, body.theme-superhero { background: linear-gradient(135deg, #c0392b 0%, #8e2420 50%, #5c1815 100%) !important; }

/* Hell-Modus Theme Anpassungen (auf html und body) */
html.light-mode.theme-safari, body.light-mode.theme-safari { background: linear-gradient(135deg, #90EE90 0%, #7CCD7C 50%, #68B868 100%) !important; }
html.light-mode.theme-zoo, body.light-mode.theme-zoo { background: linear-gradient(135deg, #DEB887 0%, #D2B48C 50%, #C4A67D 100%) !important; }
html.light-mode.theme-ocean, body.light-mode.theme-ocean { background: linear-gradient(135deg, #87CEEB 0%, #6BB3D9 50%, #4FA3CF 100%) !important; }
html.light-mode.theme-space, body.light-mode.theme-space { background: linear-gradient(135deg, #E6E6FA 0%, #D8BFD8 50%, #DDA0DD 100%) !important; }
html.light-mode.theme-princess, body.light-mode.theme-princess { background: linear-gradient(135deg, #FFB6C1 0%, #FFA0B0 50%, #FF8A9F 100%) !important; }
html.light-mode.theme-forest, body.light-mode.theme-forest { background: linear-gradient(135deg, #90EE90 0%, #7CCD7C 50%, #68B868 100%) !important; }
html.light-mode.theme-rainbow, body.light-mode.theme-rainbow { background: linear-gradient(135deg, #ffb3b3 0%, #ffeda0 25%, #b3e6b3 50%, #a0cfff 75%, #d9b3ff 100%) !important; }
html.light-mode.theme-candy, body.light-mode.theme-candy { background: linear-gradient(135deg, #ffcccc 0%, #ffe6f0 50%, #fff5e6 100%) !important; }
html.light-mode.theme-dinosaur, body.light-mode.theme-dinosaur { background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 50%, #81c784 100%) !important; }
html.light-mode.theme-arctic, body.light-mode.theme-arctic { background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 50%, #90caf9 100%) !important; }
html.light-mode.theme-farm, body.light-mode.theme-farm { background: linear-gradient(135deg, #fff8e1 0%, #ffe0b2 50%, #ffcc80 100%) !important; }
html.light-mode.theme-garden, body.light-mode.theme-garden { background: linear-gradient(135deg, #f1f8e9 0%, #c8e6c9 50%, #a5d6a7 100%) !important; }
html.light-mode.theme-jungle, body.light-mode.theme-jungle { background: linear-gradient(135deg, #e0f2f1 0%, #b2dfdb 50%, #80cbc4 100%) !important; }
html.light-mode.theme-pirates, body.light-mode.theme-pirates { background: linear-gradient(135deg, #eceff1 0%, #cfd8dc 50%, #b0bec5 100%) !important; }
html.light-mode.theme-superhero, body.light-mode.theme-superhero { background: linear-gradient(135deg, #ffcdd2 0%, #ef9a9a 50%, #e57373 100%) !important; }

/* ===========================================
   DUNKEL-MODUS TEXT-KONTRAST
   Themes mit dunklem Hintergrund -> helle Schrift
   =========================================== */

/* Standard Dunkel-Modus: Weiße Schrift */
body { color: #ffffff; }
.nav-links a { color: rgba(255,255,255,0.7); }
.stat-label { color: rgba(255,255,255,0.6); }
.activity-stats { color: rgba(255,255,255,0.6); }
.empty-state { color: rgba(255,255,255,0.5); }
.welcome-text p { color: rgba(255,255,255,0.7); }
.form-group label { color: rgba(255,255,255,0.9); }
.leaderboard-pos .label { color: rgba(255,255,255,0.6); }

/* Themes mit HELLEM Hintergrund im Dunkel-Modus brauchen DUNKLE Schrift */
body.theme-princess,
body.theme-rainbow,
body.theme-candy,
body.theme-arctic {
    color: #1a1a2e !important;
}

body.theme-princess .nav-links a,
body.theme-rainbow .nav-links a,
body.theme-candy .nav-links a,
body.theme-arctic .nav-links a {
    color: rgba(0,0,0,0.6) !important;
}

body.theme-princess .nav-links a:hover,
body.theme-rainbow .nav-links a:hover,
body.theme-candy .nav-links a:hover,
body.theme-arctic .nav-links a:hover {
    color: #1a1a2e !important;
}

body.theme-princess .stat-label,
body.theme-rainbow .stat-label,
body.theme-candy .stat-label,
body.theme-arctic .stat-label,
body.theme-princess .activity-stats,
body.theme-rainbow .activity-stats,
body.theme-candy .activity-stats,
body.theme-arctic .activity-stats {
    color: rgba(0,0,0,0.6) !important;
}

body.theme-princess .empty-state,
body.theme-rainbow .empty-state,
body.theme-candy .empty-state,
body.theme-arctic .empty-state {
    color: rgba(0,0,0,0.5) !important;
}

body.theme-princess .welcome-text p,
body.theme-rainbow .welcome-text p,
body.theme-candy .welcome-text p,
body.theme-arctic .welcome-text p {
    color: rgba(0,0,0,0.7) !important;
}

body.theme-princess .form-group label,
body.theme-rainbow .form-group label,
body.theme-candy .form-group label,
body.theme-arctic .form-group label {
    color: rgba(0,0,0,0.8) !important;
}

body.theme-princess .leaderboard-pos .label,
body.theme-rainbow .leaderboard-pos .label,
body.theme-candy .leaderboard-pos .label,
body.theme-arctic .leaderboard-pos .label {
    color: rgba(0,0,0,0.6) !important;
}

body.theme-princess .legal-footer a,
body.theme-rainbow .legal-footer a,
body.theme-candy .legal-footer a,
body.theme-arctic .legal-footer a {
    color: rgba(0,0,0,0.5) !important;
}

body.theme-princess .card,
body.theme-rainbow .card,
body.theme-candy .card,
body.theme-arctic .card {
    background: rgba(0,0,0,0.1) !important;
    border-color: rgba(0,0,0,0.1) !important;
}

body.theme-princess .dashboard-header,
body.theme-rainbow .dashboard-header,
body.theme-candy .dashboard-header,
body.theme-arctic .dashboard-header,
body.theme-princess .header,
body.theme-rainbow .header,
body.theme-candy .header,
body.theme-arctic .header {
    background: rgba(255,255,255,0.3) !important;
}

body.theme-princess .level-item.locked,
body.theme-rainbow .level-item.locked,
body.theme-candy .level-item.locked,
body.theme-arctic .level-item.locked {
    color: rgba(0,0,0,0.4) !important;
}

body.theme-princess .stat-card,
body.theme-rainbow .stat-card,
body.theme-candy .stat-card,
body.theme-arctic .stat-card,
body.theme-princess .activity-item,
body.theme-rainbow .activity-item,
body.theme-candy .activity-item,
body.theme-arctic .activity-item {
    background: rgba(0,0,0,0.1) !important;
}

body.theme-princess input,
body.theme-rainbow input,
body.theme-candy input,
body.theme-arctic input,
body.theme-princess select,
body.theme-rainbow select,
body.theme-candy select,
body.theme-arctic select,
body.theme-princess textarea,
body.theme-rainbow textarea,
body.theme-candy textarea,
body.theme-arctic textarea {
    background: rgba(255,255,255,0.5) !important;
    color: #1a1a2e !important;
    border-color: rgba(0,0,0,0.2) !important;
}

/* ===========================================
   HELL-MODUS TEXT-KONTRAST
   Alle Themes haben hellen Hintergrund -> dunkle Schrift
   =========================================== */

html.light-mode, body.light-mode {
    color: #1a1a2e !important;
}

body.light-mode h1,
body.light-mode h2,
body.light-mode h3 {
    color: #1a1a2e !important;
}

body.light-mode .card {
    background: rgba(255,255,255,0.8) !important;
    border-color: rgba(0,0,0,0.1) !important;
}

body.light-mode .header,
body.light-mode .dashboard-header {
    background: rgba(255,255,255,0.9) !important;
}

body.light-mode .nav-links a {
    color: rgba(0,0,0,0.6) !important;
}

body.light-mode .nav-links a:hover,
body.light-mode .nav-links a.active {
    color: #6C63FF !important;
}

body.light-mode .stat-label,
body.light-mode .activity-stats {
    color: rgba(0,0,0,0.6) !important;
}

body.light-mode .empty-state {
    color: rgba(0,0,0,0.5) !important;
}

body.light-mode .welcome-text p {
    color: rgba(0,0,0,0.7) !important;
}

body.light-mode .form-group label {
    color: rgba(0,0,0,0.8) !important;
}

body.light-mode .leaderboard-pos .label {
    color: rgba(0,0,0,0.6) !important;
}

body.light-mode .legal-footer {
    background: rgba(255,255,255,0.9) !important;
}

body.light-mode .legal-footer a {
    color: rgba(0,0,0,0.5) !important;
}

body.light-mode .legal-footer a:hover {
    color: rgba(0,0,0,0.8) !important;
}

body.light-mode .level-item.locked {
    background: rgba(0,0,0,0.1) !important;
    color: rgba(0,0,0,0.4) !important;
}

body.light-mode .level-item-name {
    color: rgba(255,255,255,0.95) !important;
}

body.light-mode .level-item.locked .level-item-name {
    color: rgba(0,0,0,0.5) !important;
}

body.light-mode .stat-card,
body.light-mode .activity-item {
    background: rgba(0,0,0,0.05) !important;
}

body.light-mode .welcome-section {
    background: linear-gradient(135deg, rgba(255,217,61,0.3), rgba(255,107,107,0.2)) !important;
}

body.light-mode input,
body.light-mode select,
body.light-mode textarea {
    background: rgba(255,255,255,0.8) !important;
    color: #1a1a2e !important;
    border-color: rgba(0,0,0,0.2) !important;
}

body.light-mode input::placeholder {
    color: rgba(0,0,0,0.4) !important;
}

/* Logo im Light-Mode - dunkle Farbe für besseren Kontrast */
body.light-mode .logo,
html.light-mode .logo {
    color: #6C63FF !important;
}

/* Auch für helle Themes im Dunkel-Modus */
body.theme-princess .logo,
body.theme-rainbow .logo,
body.theme-candy .logo,
body.theme-arctic .logo {
    color: #6C63FF !important;
}

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

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-medium) 50%, var(--bg-light) 100%);
    min-height: 100vh;
    color: #fff;
}

/* Typography */
h1, h2, h3 {
    font-family: 'Fredoka One', cursive;
}

a { color: var(--warning); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.header {
    background: rgba(0,0,0,0.3);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 100;
}

.logo {
    font-family: 'Fredoka One', cursive;
    font-size: 1.8rem;
    color: var(--warning);
    text-decoration: none;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--warning), #ff9500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.user-stats {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
}

.stat-badge {
    background: rgba(255,255,255,0.1);
    padding: 5px 12px;
    border-radius: 20px;
}

.stat-badge.xp { color: var(--warning); }
.stat-badge.coins { color: var(--accent); }

.nav-links a {
    color: #aaa;
    text-decoration: none;
    margin-left: 20px;
    transition: color 0.3s;
}

.nav-links a:hover { color: var(--warning); }

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
}

/* Cards */
.card {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 25px;
}

.card h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--warning), #ff9500);
    color: var(--bg-dark);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--accent), #00b389);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255,217,61,0.3);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #ddd;
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    color: white;
    font-size: 1rem;
    transition: border-color 0.3s;
}

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

input::placeholder { color: #666; }

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.alert-success {
    background: rgba(0,217,165,0.2);
    border: 1px solid var(--accent);
    color: var(--accent);
}

.alert-error {
    background: rgba(255,107,107,0.2);
    border: 1px solid var(--error);
    color: var(--error);
}

.alert-info {
    background: rgba(108,99,255,0.2);
    border: 1px solid var(--primary);
    color: #a5a0ff;
}

/* Progress Bar */
.progress-bar {
    background: rgba(0,0,0,0.3);
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--warning));
    border-radius: 5px;
    transition: width 0.5s;
}

/* Level Grid */
.level-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
    margin-top: 15px;
}

.level-item {
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s;
    text-decoration: none;
    color: white;
}

.level-item:hover { transform: scale(1.1); }

.level-item.completed {
    background: linear-gradient(135deg, var(--accent), #00b389);
}

.level-item.current {
    background: linear-gradient(135deg, var(--warning), #ff9500);
    animation: pulse 2s infinite;
}

.level-item.locked {
    background: rgba(255,255,255,0.1);
    color: #555;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,217,61,0.4); }
    50% { box-shadow: 0 0 0 10px rgba(255,217,61,0); }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-item {
    background: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--warning);
}

.stat-label {
    font-size: 0.85rem;
    color: #888;
    margin-top: 5px;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-item {
    background: rgba(0,0,0,0.2);
    padding: 12px 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-level {
    font-weight: 700;
    color: var(--warning);
}

.activity-stats {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #888;
}

/* Achievement List */
.achievement-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.achievement-item {
    background: rgba(255,217,61,0.1);
    border: 1px solid rgba(255,217,61,0.3);
    padding: 10px 15px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.achievement-icon {
    font-size: 1.3rem;
}

/* Welcome Section */
.welcome-section {
    background: linear-gradient(135deg, rgba(255,217,61,0.2), rgba(255,107,107,0.1));
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-text h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.welcome-text p {
    color: #aaa;
}

.start-btn {
    background: linear-gradient(135deg, var(--warning), #ff9500);
    color: var(--bg-dark);
    padding: 15px 40px;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255,217,61,0.3);
    text-decoration: none;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 30px;
    color: #666;
}

/* Legal Footer */
.legal-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(5px);
    z-index: 50;
}

.legal-footer a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    margin: 0 15px;
    font-size: 0.85rem;
}

.legal-footer a:hover { color: white; }

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .welcome-section {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .level-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
