/* ============================================================
   Workout-Tracker – White & Green Design
   Vanilla CSS, keine externen Frameworks
   ============================================================ */

/* --- Design-Tokens --- */
:root {
    --primary:        #65A30D;   /* Lime Green (600) */
    --primary-light:  #84CC16;   /* Bright Lime (500) */
    --primary-dark:   #3F6212;   /* Dark Lime (800) */
    --primary-bg:     #F1FBE7;   /* Very soft Lime BG */
    --primary-hover:  #4D7C0F;   /* Lime Hover (700) */

    --white:          #FFFFFF;
    --bg:             #FAFDF4;   /* Clean off-white with lime tint */
    --bg-card:        #FFFFFF;
    --border:         #D4E9B3;   /* Soft lime border */
    --border-light:   #F1FBE7;   /* Extra soft border */

    --text-primary:   #1F330E;   /* Deep forest-lime text */
    --text-secondary: #4D6638;   /* Medium forest-lime text */
    --text-muted:     #7C8F70;   /* Muted lime-grey text */

    --danger:         #C62828;
    --danger-light:   #FFEBEE;
    --danger-hover:   #B71C1C;
    --success:        #65A30D;
    --success-light:  #F1FBE7;
    --info:           #0277BD;
    --info-light:     #E1F5FE;
    --warning:        #F57F17;
    --warning-light:  #FFFDE7;

    --radius:         10px;
    --radius-lg:      16px;
    --radius-sm:      6px;
    --shadow-sm:      0 1px 4px rgba(101,163,13,0.08);
    --shadow:         0 4px 16px rgba(101,163,13,0.10);
    --shadow-lg:      0 8px 32px rgba(101,163,13,0.14);

    --transition:     0.2s ease;
    --font:           'Inter', system-ui, -apple-system, sans-serif;
}

/* --- Reset & Basis --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
ul { list-style: none; }

/* --- Layout --- */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* --- Navbar --- */
.navbar {
    background: var(--white);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 1rem;
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-dark);
    text-decoration: none;
    white-space: nowrap;
}
.navbar-brand:hover { color: var(--primary); }
.brand-icon { display: inline-flex; align-items: center; }
.brand-icon svg { width: 22px; height: 22px; stroke-width: 2.5; stroke: currentColor; }
.navbar-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
    white-space: nowrap;
}
.nav-link:hover { color: var(--primary); background: var(--primary-bg); }
.nav-link-cta {
    background: var(--primary-bg);
    color: var(--primary-dark);
    font-weight: 600;
    padding: 0.35rem 0.75rem;
}
.nav-user {
    font-weight: 600;
    color: var(--primary-dark);
    padding: 0.25rem 0.5rem;
    background: var(--primary-bg);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    transition: color var(--transition), background var(--transition);
}
.nav-user:hover {
    color: var(--white);
    background: var(--primary);
}

/* --- Flash-Meldungen --- */
.flash-container { padding: 1rem 0 0; display: flex; flex-direction: column; gap: 0.5rem; }
.alert {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 500;
    border-left: 4px solid transparent;
    animation: slideIn 0.3s ease;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.alert-icon { font-size: 1.1rem; }
.alert-success { background: var(--success-light); border-color: var(--primary); color: var(--primary-dark); }
.alert-danger  { background: var(--danger-light);  border-color: var(--danger);  color: var(--danger); }
.alert-info    { background: var(--info-light);    border-color: var(--info);    color: var(--info); }
.alert-warning { background: var(--warning-light); border-color: var(--warning); color: var(--warning); }

/* --- Hauptinhalt --- */
.main-content { flex: 1; padding: 2rem 0; }

/* --- Seitenkopf --- */
.page-header { margin-bottom: 2rem; }
.page-header-flex { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.page-title { font-size: 1.75rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.25rem; }
.page-subtitle { color: var(--text-muted); font-size: 1rem; }
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    transition: color var(--transition);
}
.back-link:hover { color: var(--primary); }
.workout-notes {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--primary-bg);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-style: italic;
    border-left: 3px solid var(--primary-light);
}

/* --- Karten --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}
.card-title { font-size: 1.05rem; font-weight: 700; color: var(--primary-dark); }

/* --- Statistik-Kacheln --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stats-grid-small { margin-bottom: 1.5rem; }
.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card-sm { padding: 1rem; }
.stat-icon { display: inline-flex; align-items: center; justify-content: center; margin-bottom: 0.5rem; }
.stat-icon svg { width: 28px; height: 28px; stroke: var(--primary); }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--primary-dark); line-height: 1.2; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; font-weight: 500; }

/* --- Dashboard Grid --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
    align-items: start;
}
.dashboard-right { display: flex; flex-direction: column; gap: 1.5rem; }

/* --- Workout-Liste --- */
.workout-list { display: flex; flex-direction: column; gap: 0.5rem; }
.workout-item { border-radius: var(--radius); overflow: hidden; }
.workout-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    color: var(--text-primary);
    text-decoration: none;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
    gap: 1rem;
}
.workout-link:hover {
    background: var(--primary-bg);
    border-color: var(--primary-light);
    transform: translateX(4px);
    color: var(--text-primary);
}
.workout-item-main { display: flex; flex-direction: column; gap: 0.15rem; }
.workout-item-date { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.workout-item-title { font-weight: 600; color: var(--text-primary); }
.workout-item-meta { display: flex; gap: 0.5rem; flex-shrink: 0; }

/* --- PR-Tabelle --- */
.pr-table, .exercises-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.pr-table th, .exercises-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border);
}
.pr-table td, .exercises-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.pr-table tr:last-child td, .exercises-table tr:last-child td { border-bottom: none; }
.pr-table tr:hover td, .exercise-row:hover td { background: var(--primary-bg); }
.pr-name, .exercise-name { font-weight: 600; }
.exercises-total td { background: var(--primary-bg); font-weight: 700; }

/* --- Wochenübersicht --- */
.weekly-list { display: flex; flex-direction: column; gap: 0.6rem; }
.weekly-item { display: flex; align-items: center; gap: 0.75rem; font-size: 0.9rem; }
.weekly-label { min-width: 90px; color: var(--text-secondary); font-size: 0.8rem; font-weight: 500; }
.weekly-bar-wrap { flex: 1; background: var(--border-light); border-radius: 99px; height: 10px; overflow: hidden; }
.weekly-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-light), var(--primary));
    border-radius: 99px;
    transition: width 0.6s ease;
    min-width: 6px;
}
.weekly-count { min-width: 28px; text-align: right; font-weight: 700; color: var(--primary-dark); }

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-green { background: var(--primary-bg); color: var(--primary-dark); }
.badge-light { background: var(--bg); border: 1px solid var(--border); color: var(--text-secondary); }
.badge-strength { background: var(--primary-bg); color: var(--primary-dark); }
.badge-running { background: var(--info-light); color: var(--info); }
.badge-swimming { background: #E1F5FE; color: #0288D1; }
.badge-hiking { background: #FFE0B2; color: #E65100; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    transition: background var(--transition), color var(--transition),
                border-color var(--transition), transform var(--transition), box-shadow var(--transition);
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: var(--white);
}
.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary-bg);
    color: var(--primary-dark);
}
.btn-danger {
    background: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger);
}
.btn-danger:hover {
    background: var(--danger);
    color: var(--white);
}
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.85rem; }
.btn-full { width: 100%; }
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background var(--transition), color var(--transition);
    background: transparent;
}
.btn-icon-danger { color: var(--danger); }
.btn-icon-danger:hover { background: var(--danger-light); }

/* --- Formulare --- */
.form-card, .auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    max-width: 540px;
    margin: 0 auto;
}
.form-group { margin-bottom: 1.25rem; }
.form-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.4rem; }
.form-control {
    width: 100%;
    padding: 0.6rem 0.9rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}
.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(76,175,80,0.15);
}
.form-control::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; }
.required { color: var(--danger); }
.optional { color: var(--text-muted); font-weight: 400; font-size: 0.8rem; }

/* --- Auth-Seiten --- */
.auth-wrapper {
    padding: 1rem 0;
}
.auth-container {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    max-width: 960px;
    margin: 2rem auto;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.auth-card-wrapper {
    padding: 3.5rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.auth-card {
    border: none;
    box-shadow: none;
    padding: 0;
    max-width: 100%;
    margin: 0;
}
.auth-image-panel {
    background: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}
.auth-image-panel img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-icon { display: inline-flex; align-items: center; justify-content: center; margin-bottom: 0.75rem; }
.auth-icon svg { width: 44px; height: 44px; stroke: var(--primary); }
.auth-title { font-size: 1.6rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.4rem; }
.auth-subtitle { color: var(--text-muted); }
.auth-form .btn { margin-top: 0.5rem; }
.auth-footer-text { text-align: center; margin-top: 1.25rem; font-size: 0.9rem; color: var(--text-muted); }
.auth-link { color: var(--primary); font-weight: 600; }
.auth-link:hover { color: var(--primary-dark); }

/* --- Empty States --- */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.empty-icon { display: inline-flex; align-items: center; justify-content: center; opacity: 0.4; margin-bottom: 0.5rem; }
.empty-icon svg { width: 40px; height: 40px; stroke: var(--text-muted); }
.empty-text { color: var(--text-muted); font-size: 0.9rem; padding: 1rem 0; }

/* --- Text-Hilfsklassen --- */
.text-right { text-align: right; }
.text-center { text-align: center; }

/* --- Footer --- */
.footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 1.25rem 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.footer-link { color: var(--primary); font-weight: 500; }
.footer-link:hover { color: var(--primary-dark); }

/* --- Responsive --- */
@media (max-width: 1024px) {
    .navbar-inner { gap: 0.5rem; height: 56px; }
    .navbar-brand { font-size: 1.05rem; }
    .navbar-links { gap: 0.5rem; }
    .nav-link { font-size: 0.85rem; padding: 0.2rem 0.4rem; }
    .nav-link-cta { padding: 0.25rem 0.5rem; }
    .nav-user { padding: 0.25rem 0.4rem; font-size: 0.8rem; }
    .nav-user-text { display: none; }
    .nav-user svg { margin-right: 0 !important; }
}

@media (max-width: 768px) {
    .navbar-inner { flex-wrap: wrap; height: auto; padding: 0.5rem 1rem; justify-content: center; }
    .navbar-brand { width: 100%; justify-content: center; margin-bottom: 0.5rem; }
    .navbar-links { width: 100%; justify-content: center; flex-wrap: wrap; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-right { order: -1; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .page-header-flex { flex-direction: column; }
    .exercises-table { font-size: 0.8rem; }
    .exercises-table th, .exercises-table td { padding: 0.5rem; }
    
    /* Collapsing Auth Split */
    .auth-container { grid-template-columns: 1fr; margin: 1rem auto; max-width: 480px; }
    .auth-image-panel { display: none; }
    .auth-card-wrapper { padding: 2.5rem 1.5rem; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .form-card, .auth-card { padding: 1.25rem; }
    .workout-link { flex-direction: column; align-items: flex-start; }
    .card { padding: 1rem; }
    .auth-card-wrapper { padding: 1.5rem 1rem; }
}

/* --- Glocke und Benachrichtigungen --- */
#notification-bell:hover {
    color: var(--primary) !important;
    background: var(--primary-bg);
}

.notification-dropdown-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1rem;
    display: none;
    flex-direction: column;
}

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}

.dropdown-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.btn-text:hover {
    color: var(--primary-hover);
    background: var(--primary-bg);
}

#notification-list {
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notification-item {
    padding: 0.75rem;
    border-radius: var(--radius);
    background: var(--bg);
    border-left: 4px solid var(--primary);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.notification-item:hover {
    background: var(--border-light);
    transform: translateX(2px);
}

.notification-item.read {
    border-left-color: transparent;
    opacity: 0.55;
    background: var(--white);
}

.notification-item.read:hover {
    background: var(--border-light);
}

.notification-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-message {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.notification-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.notification-dot {
    width: 6px;
    height: 6px;
    background-color: var(--primary);
    border-radius: 50%;
}

.notification-item.read .notification-dot {
    display: none;
}

.notification-empty {
    padding: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.dropdown-footer {
    border-top: 2px solid var(--border-light);
    padding-top: 0.5rem;
    margin-top: 0.75rem;
    text-align: center;
}

.dropdown-footer .footer-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.dropdown-footer .footer-link:hover {
    color: var(--primary);
}

/* Scrollbar für Benachrichtigungen */
#notification-list::-webkit-scrollbar {
    width: 5px;
}
#notification-list::-webkit-scrollbar-track {
    background: transparent;
}
#notification-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}
#notification-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

