:root {
    --bg-base: #0a0a0f;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    --primary: #00f0ff;
    --primary-glow: rgba(0, 240, 255, 0.5);
    
    --accent: #ff0055;
    --accent-glow: rgba(255, 0, 85, 0.5);
    
    --success: #00ff88;
    --error: #ff3366;
    
    --text-main: #ffffff;
    --text-muted: #8892b0;
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body.loading::after {
    content: "Lade Daten...";
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    z-index: 9999;
}

/* --- AMBIENT BACKGROUND --- */
.ambient-background {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #11111a 0%, #050508 100%);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: drift 20s infinite alternate ease-in-out;
}

.orb-1 {
    width: 400px; height: 400px;
    background: #00f0ff;
    top: -100px; left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px; height: 500px;
    background: #ff0055;
    bottom: -150px; right: -100px;
    animation-delay: -5s;
}

.orb-3 {
    width: 300px; height: 300px;
    background: #7000ff;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation: drift-center 25s infinite alternate ease-in-out;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.2); }
}
@keyframes drift-center {
    0% { transform: translate(-50%, -50%) scale(1); }
    100% { transform: translate(-30%, -60%) scale(1.5); }
}

/* --- LAYOUT --- */
.app-container {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 1;
    position: relative;
    padding-bottom: 100px; /* Space for nav on mobile */
}

/* --- GLASSMORPHISM --- */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
}

/* --- HEADER --- */
.header {
    padding: 20px;
    text-align: center;
    border-radius: 100px;
}
.header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 1px;
}
.highlight {
    background: linear-gradient(90deg, var(--primary), #0077ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    font-style: italic;
    padding-left: 5px;
}

/* --- NAVIGATION --- */
.nav {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-radius: 100px;
    gap: 5px;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 12px 16px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-btn:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.05);
}
.nav-btn.active {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 15px var(--primary-glow);
}

/* --- CARDS --- */
.card {
    padding: 30px;
    text-align: center;
    margin-bottom: 20px;
}
.card-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}
.text-gradient {
    background: linear-gradient(135deg, #fff, #a0a5ba);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}
.tip-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

/* --- FORM ELEMENTS --- */
.form-group {
    margin-bottom: 15px;
}
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}
.input-icon {
    position: absolute;
    left: 15px;
    opacity: 0.5;
    font-size: 1.2rem;
}
.modern-input, .modern-textarea {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    outline: none;
}
.input-wrapper .modern-input {
    padding-left: 45px;
}
.modern-input:focus, .modern-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.15);
    background: rgba(0,0,0,0.4);
}
.modern-input::placeholder { color: rgba(255,255,255,0.3); }
.modern-textarea {
    min-height: 120px;
    resize: vertical;
}

/* --- BUTTONS --- */
.btn {
    border: none;
    border-radius: 12px;
    padding: 15px 20px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.btn-full { width: 100%; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }
.mb-4 { margin-bottom: 20px; }

.btn-primary {
    background: var(--text-main);
    color: #000;
}
.glow-effect {
    position: relative;
}
.glow-effect:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px #fff;
}
.btn-primary.glow-effect:hover {
    background: var(--primary);
    box-shadow: 0 10px 25px -10px var(--primary);
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
}
.btn-outline:hover {
    background: rgba(255,255,255,0.05);
}
.btn-danger {
    background: rgba(255, 51, 102, 0.1);
    color: var(--error);
    border: 1px solid rgba(255, 51, 102, 0.3);
}
.btn-danger:hover {
    background: var(--error);
    color: #fff;
    box-shadow: 0 8px 20px -5px var(--error);
}
.glow-effect-danger:hover {
    transform: translateY(-2px);
}
.btn-save {
    background: rgba(0, 255, 136, 0.1);
    color: var(--success);
    border: 1px solid rgba(0, 255, 136, 0.3);
}
.btn-save:hover {
    background: var(--success);
    color: #000;
    box-shadow: 0 8px 20px -5px var(--success);
    transform: translateY(-2px);
}

/* --- LERNEN --- */
.card-interactive {
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.card-interactive:hover {
    transform: translateY(-5px);
    border-color: rgba(255,255,255,0.2);
}
::selection { background: var(--primary); color: #000; }

.emoji-display {
    font-size: clamp(80px, 15vw, 120px);
    display: block;
    margin: 20px 0;
    filter: drop-shadow(0 10px 10px rgba(0,0,0,0.5));
}
.floating { animation: float 6s ease-in-out infinite; }
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

.item-name {
    font-size: clamp(2rem, 6vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: -1px;
}

.plu-wrapper { min-height: 70px; display:flex; justify-content:center; align-items:center; }
.plu-badge {
    background: linear-gradient(135deg, var(--accent), #ff5e00);
    color: white;
    padding: 8px 30px;
    border-radius: 100px;
    font-size: 2.5rem;
    font-weight: 900;
    box-shadow: 0 8px 20px var(--accent-glow);
}

/* --- QUIZ --- */
.stats-glass {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    padding: 12px 25px;
    backdrop-filter: blur(10px);
}
.stat-item {
    font-size: 1.2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}
.stat-item.correct { color: var(--success); }
.stat-item.wrong { color: var(--error); }
.stat-val {
    background: rgba(255,255,255,0.1);
    padding: 2px 10px;
    border-radius: 10px;
}

.input-large .modern-input {
    font-size: 2rem;
    padding: 20px;
    font-weight: 900;
    letter-spacing: 5px;
}
.btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* --- LISTE --- */
.search-container {
    position: relative;
    margin-bottom: 20px;
    border-radius: 16px;
    padding: 5px;
}
.search-container .input-icon { left: 20px; top: 50%; transform: translateY(-50%); }
.search-container .modern-input {
    padding-left: 50px;
    border: none;
    background: transparent;
    font-size: 1.1rem;
}

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

/* This targets the cards generated by script.js! */
.list-grid .card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 15px 20px !important;
    border-radius: 16px;
    margin-bottom: 0 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}
.list-grid .card:hover {
    background: rgba(255,255,255,0.08);
    transform: translateX(5px);
}
.list-grid .card span:first-child {
    font-size: 1.1rem;
}

/* --- ADMIN TABELLEN --- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    margin-bottom: 10px;
}
.modern-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    white-space: nowrap;
}
.modern-table th, .modern-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}
.modern-table th {
    background: rgba(255,255,255,0.05);
    font-weight: 600;
    color: var(--text-muted);
}
.modern-table tr:hover {
    background: rgba(255,255,255,0.02);
}

/* --- ANIMATIONS & UTILITIES --- */
.hidden { display: none !important; }

/* In-Out Animations */
.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Quiz Feedback Animations */
.success-flash {
    animation: successPulse 0.5s ease;
    border-color: var(--success) !important;
    color: var(--success) !important;
}
@keyframes successPulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(0, 255, 136, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

.error-flash {
    border-color: var(--error) !important;
    color: var(--error) !important;
    background: rgba(255, 51, 102, 0.1) !important;
}
.shake {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes shake {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-8px, 0, 0); }
    40%, 60% { transform: translate3d(8px, 0, 0); }
}

.login-message {
    color: var(--error);
    margin-top: 15px;
    font-weight: 500;
}

/* --- RESPONSIVE MOBILE FIXES --- */
@media (max-width: 600px) {
    .app-container {
        padding: 15px;
    }
    .nav {
        position: fixed;
        bottom: 20px;
        left: 15px;
        right: 15px;
        z-index: 100;
        background: rgba(10, 10, 15, 0.85);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
    }
    .nav-btn {
        flex-direction: column;
        font-size: 0.75rem;
        padding: 8px;
        border-radius: 12px;
        gap: 4px;
        flex: 1;
    }
    .nav-btn .nav-icon {
        font-size: 1.2rem;
    }
    .nav-btn.active {
        box-shadow: none;
    }
    body { padding-bottom: 80px; }
}

@media (min-width: 601px) {
    .nav-btn .nav-text {
        font-size: 0.95rem;
    }
}
