/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-color);
    min-height: 100vh;
    color: var(--text-primary);
}

/* Navigation */
.navbar {
    background: var(--card-bg);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 16px;
    color: var(--primary);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.btn-logout {
    color: var(--text-secondary);
    text-decoration: none;
}

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

/* Tages-Auswahl */
.day-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px 0;
}

.day-nav {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
}

.current-day {
    text-align: center;
}

.day-name {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.day-date {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Haupt-Kalorien-Kreis */
.main-calories {
    text-align: center;
    padding: 20px 0;
}

.calorie-circle {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.calorie-circle svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.calorie-circle circle {
    fill: none;
    stroke-width: 8;
}

.calorie-circle .bg {
    stroke: #e5e7eb;
}

.calorie-circle .progress {
    stroke: var(--primary);
    stroke-linecap: round;
    transition: stroke-dasharray 0.5s ease;
}

.calorie-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.calorie-text .current {
    font-size: 42px;
    font-weight: 700;
    color: var(--text-primary);
}

.calorie-text .separator,
.calorie-text .target {
    font-size: 24px;
    color: var(--text-secondary);
}

.calorie-text .unit {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
}

.remaining-text {
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Mahlzeiten-Übersicht */
.meals-overview {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 16px;
    margin: 20px 0;
    box-shadow: var(--shadow);
}

.meals-overview h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.link-more {
    font-size: 14px;
    color: var(--primary);
    text-decoration: none;
}

/* Mahlzeit-Kategorie */
.meal-category {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.meal-category:last-child {
    border-bottom: none;
}

.meal-category:hover {
    background: #f9fafb;
}

.meal-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.meal-icon.breakfast {
    background: #fef3c7;
    color: #d97706;
}

.meal-icon.lunch {
    background: #dbeafe;
    color: #2563eb;
}

.meal-icon.dinner {
    background: #e0e7ff;
    color: #4f46e5;
}

.meal-icon.snacks {
    background: #fce7f3;
    color: #db2777;
}

.meal-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.meal-name {
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.meal-name i {
    font-size: 12px;
    color: var(--text-secondary);
}

.meal-cals {
    font-size: 14px;
    color: var(--text-secondary);
}

.meal-detail {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-add {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1f2937;
    color: white;
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.btn-add:hover {
    transform: scale(1.1);
}

/* Meal Details */
.meal-details {
    background: #f9fafb;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 8px 0;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.detail-item:last-child {
    border-bottom: none;
}

.btn-delete-small {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 14px;
}

/* Wasser-Tracker */
.water-tracker {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 16px;
    margin: 20px 0;
    box-shadow: var(--shadow);
}

.water-tracker h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.water-glasses {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.water-glass {
    font-size: 28px;
    color: #e5e7eb;
    cursor: pointer;
    transition: color 0.2s;
}

.water-glass.filled {
    color: #3b82f6;
}

.water-count {
    text-align: center;
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Wochenübersicht */
.week-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 16px;
    margin: 20px 0;
    box-shadow: var(--shadow);
}

.week-section h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.week-grid {
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.week-day {
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 12px;
    background: #f3f4f6;
    min-width: 50px;
}

.week-day.active {
    background: var(--primary);
    color: white;
}

.week-day .day-name {
    font-size: 12px;
    text-transform: uppercase;
}

.week-day .day-calories {
    font-size: 14px;
    font-weight: 600;
    display: block;
    margin-top: 4px;
}

/* Einstellungen */
.settings-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 16px;
    margin: 20px 0;
    box-shadow: var(--shadow);
}

.settings-section h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.settings-form {
    display: flex;
    gap: 8px;
}

.settings-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
}

.btn-secondary {
    padding: 10px 16px;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    position: relative;
}

.modal-content h3 {
    margin-bottom: 16px;
}

.modal-content .close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 24px;
    cursor: pointer;
}

.modal-content .form-group {
    margin-bottom: 16px;
}

.modal-content label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.logo {
    margin-bottom: 30px;
}

.logo i {
    font-size: 48px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    margin-top: 10px;
}

.logo .subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 5px;
}

.login-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
}

.error-message {
    background: #fee2e2;
    color: #dc2626;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.login-hint {
    background: #f3f4f6;
    padding: 12px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.features {
    display: flex;
    justify-content: space-around;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.feature i {
    font-size: 20px;
    color: var(--primary);
}

.login-footer {
    margin-top: 30px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}
