:root {
    --font-family: 'Manrope', sans-serif;
    /* Dark Mode - Beibehaltenes "Electric Blue" Neumorphic Theme */
    --bg-color: #2C2F36;
    --primary-text-color: #E0E0E5;
    --secondary-text-color: #8E929C;
    --accent-color: #00A3FF;
    --success-color: #2ED573;
    --error-color: #FF4757;
    --shadow-light: #373A42;
    --shadow-dark: #21232A;
}

body.light-mode {
    --bg-color: #E0E5EC;
    --primary-text-color: #373F51;
    --secondary-text-color: #8E929C;
    --shadow-light: #FFFFFF;
    --shadow-dark: #A3B1C6;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--primary-text-color);
    display: flex;
    justify-content: center;
    transition: background-color 0.4s ease, color 0.4s ease;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    width: 100%; max-width: 450px; min-height: 100vh;
    display: flex; flex-direction: column; position: relative;
    padding-bottom: 90px; overflow: hidden;
}

/* Neumorphismus Helferklassen */
.neumorphic-outset {
    border-radius: 20px; background: var(--bg-color);
    box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
    transition: all 0.3s ease;
}
.neumorphic-inset {
    border-radius: 20px; background: var(--bg-color);
    box-shadow: inset 8px 8px 16px var(--shadow-dark), inset -8px -8px 16px var(--shadow-light);
}
.neumorphic-button {
     border-radius: 50px; background: var(--bg-color);
     box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
     border: none; outline: none; cursor: pointer;
     transition: box-shadow 0.2s ease, transform 0.2s ease;
     color: var(--primary-text-color);
}
.neumorphic-button:active, .neumorphic-button.active {
    box-shadow: inset 6px 6px 12px var(--shadow-dark), inset -6px -6px 12px var(--shadow-light);
    transform: scale(0.98);
}
.neumorphic-inset-input {
    width: 100%; padding: 15px; background: var(--bg-color);
    border-radius: 15px;
    box-shadow: inset 6px 6px 12px var(--shadow-dark), inset -6px -6px 12px var(--shadow-light);
    border: none; color: var(--primary-text-color);
    font-family: var(--font-family); font-size: 1rem; outline: none;
}

/* Seiten-Management */
.page {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    padding: 20px; padding-top: 80px; padding-bottom: 100px;
    opacity: 0; visibility: hidden;
    transition: opacity 0.4s ease, transform 0.4s ease;
    transform: scale(1.05); overflow-y: auto;
}
.page.active { opacity: 1; visibility: visible; transform: scale(1); }

/* Header */
.app-header {
    position: absolute; top: 0; left: 0; width: 100%;
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px; height: 80px; z-index: 100;
}
.app-header h2 { font-size: 1.6rem; font-weight: 700; }
.logo { height: 40px; stroke: var(--primary-text-color); }

/* Allgemeine UI-Elemente */
.section-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 15px; padding-left: 5px; }

/* Dashboard */
.task-card { padding: 20px; display: flex; align-items: center; gap: 20px; cursor: pointer; }
.task-card .icon { width: 50px; height: 50px; display: flex; justify-content: center; align-items: center; font-size: 1.5rem; }
.task-card h4 { font-size: 1.1rem; }
.task-card p { font-size: 0.9rem; color: var(--secondary-text-color); }
.task-card .arrow { margin-left: auto; color: var(--secondary-text-color); }
.discipline-chain { display: flex; justify-content: space-around; padding: 20px; }
.chain-link { text-align: center; }
.chain-link .icon { width: 30px; height: 30px; margin: 0 auto 5px; border-radius: 50%; border: 3px solid var(--secondary-text-color); transition: all 0.3s ease;}
.chain-link .icon.completed { border-color: var(--success-color); background-color: var(--success-color); }
.chain-link .label { font-weight: 600; }
.chain-link.today .label { color: var(--accent-color); }

/* Active Workout */
.exercise-block { padding: 20px; margin-bottom: 20px; }
.exercise-block-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.exercise-block-header h4 { font-size: 1.2rem; }
.exercise-block-header p { font-size: 0.9rem; color: var(--secondary-text-color); }
.sets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 15px; }
.set-bubble { width: 60px; height: 60px; display: flex; justify-content: center; align-items: center; font-size: 1rem; font-weight: 600; color: var(--secondary-text-color); }
.set-bubble.completed { color: var(--accent-color); }
.finish-workout-button { padding: 20px; width: 100%; font-size: 1.2rem; font-weight: 700; color: var(--accent-color); }

/* Plans Page */
.plan-card { padding: 20px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; margin-bottom: 15px; }
.plan-card h4 { font-size: 1.1rem; }
.plan-card p { font-size: 0.9rem; color: var(--secondary-text-color); }
.fab { position: fixed; bottom: 100px; right: 30px; width: 60px; height: 60px; font-size: 2rem; z-index: 101; }

/* Plan Editor */
.exercise-editor-item { display: flex; gap: 10px; margin-bottom: 15px; align-items: center; }
.exercise-editor-item input { flex-grow: 1; }
.exercise-editor-item .delete-exercise-btn { width: 40px; height: 40px; font-size: 1.5rem; color: var(--error-color); }

/* Progress Page */
.stats-overview { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 25px; }
.stat-card { padding: 15px; text-align: center; }
.stat-card .value { font-size: 1.5rem; font-weight: 800; }
.stat-card .label { font-size: 0.8rem; color: var(--secondary-text-color); }
.history-item { padding: 15px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--shadow-dark); }
body.light-mode .history-item { border-bottom-color: var(--shadow-light); }
.history-list .neumorphic-outset:last-child .history-item { border-bottom: none; }
.history-item h5 { font-weight: 600; }
.history-item p { font-size: 0.9rem; color: var(--secondary-text-color); }
.chart-container { padding: 20px; margin-top: 20px; }

/* Navigation */
.bottom-nav { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); width: calc(100% - 40px); max-width: 410px; height: 70px; display: flex; justify-content: space-around; align-items: center; z-index: 100; }
.nav-item { width: 55px; height: 55px; display: flex; justify-content: center; align-items: center; color: var(--secondary-text-color); }
.nav-item.active svg { color: var(--accent-color); }
.nav-item svg { width: 28px; height: 28px; }

/* Profile & Settings */
.settings-card { padding: 10px 20px; }
.settings-item { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; font-size: 1.1rem; }
.switch { position: relative; display: inline-block; width: 60px; height: 34px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--shadow-dark); border-radius: 34px; transition: .4s; }
.slider:before { position: absolute; content: ""; height: 26px; width: 26px; left: 4px; bottom: 4px; background-color: var(--bg-color); border-radius: 50%; transition: .4s; }
input:checked + .slider { background-color: var(--accent-color); }
input:checked + .slider:before { transform: translateX(26px); }

/* Auth & Loader & Modal */
.auth-container, .loader-container, .modal-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; padding: 20px; background-color: var(--bg-color); z-index: 998; }
.auth-container { background-color: var(--bg-color); }
.modal-container { background-color: rgba(0,0,0,0.5); }
.auth-card, .modal-card { width: 100%; max-width: 400px; padding: 30px; text-align: center; }
.auth-card h3, .modal-card h3 { font-size: 1.5rem; margin-bottom: 10px; }
.auth-card p, .modal-card p { color: var(--secondary-text-color); margin-bottom: 30px; line-height: 1.5; }
.input-group { margin-bottom: 20px; }
.auth-buttons { display: flex; gap: 15px; }
.auth-buttons button { flex: 1; padding: 15px; }
.auth-error { color: var(--error-color); margin-top: 20px; height: 20px; font-size: 0.9rem; }
.loader-container { z-index: 999; }
.spinner { width: 50px; height: 50px; border: 5px solid var(--shadow-dark); border-top-color: var(--accent-color); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

