/* ================================
   FITFORGE - MODERN DESIGN SYSTEM
   ================================ */

/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Modern Professional Colors */
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #34d399;
    --primary-glow: rgba(16, 185, 129, 0.2);
    
    --secondary: #3b82f6;
    --secondary-dark: #2563eb;
    
    --accent: #8b5cf6;
    
    /* Backgrounds */
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-elevated: #334155;
    --bg-hover: #475569;
    
    /* Text */
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-secondary: #cbd5e1;
    
    /* Borders */
    --border: #334155;
    --border-light: #475569;
    
    /* Status */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 20px var(--primary-glow);
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    
    /* Radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, var(--bg-main) 0%, #1e293b 100%);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== TYPOGRAPHY ========== */
h1 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-4);
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space-4);
    letter-spacing: -0.01em;
}

h3 {
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-3);
}

/* ========== CONTAINER & LAYOUT ========== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-4);
}

@media (min-width: 768px) {
    .container {
        padding: var(--space-8);
    }
}

/* ========== HEADER ========== */
header {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

@media (min-width: 768px) {
    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.user-welcome {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: var(--space-2);
}

.streak-counter {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: var(--bg-elevated);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border: 2px solid var(--primary);
    box-shadow: var(--shadow-glow);
}

.streak-counter span:first-child {
    font-size: 1.5rem;
}

.streak-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

/* ========== SECTIONS ========== */
.section {
    background: var(--bg-card);
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.section:hover {
    box-shadow: var(--shadow-md);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    gap: var(--space-4);
    flex-wrap: wrap;
}

.section-title {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    margin: 0;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow);
    min-height: 44px; /* Mobile friendly touch target */
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.btn:active {
    transform: translateY(0);
}

.btn-action {
    padding: var(--space-3) var(--space-5);
    font-size: 0.95rem;
    white-space: nowrap;
    min-width: 160px;
}

@media (max-width: 768px) {
    .btn-action {
        width: 100%;
        min-width: unset;
    }
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--border-light);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-glow);
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: 0.875rem;
    min-height: 36px;
}

/* ========== STATS GRID ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-4);
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
    padding: var(--space-5);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    opacity: 0;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-2);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--space-2);
    line-height: 1.2;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    font-weight: 500;
}

.trend-up {
    color: var(--error);
}

.trend-down {
    color: var(--success);
}

.trend-neutral {
    color: var(--text-muted);
}

/* ========== DAILY FOCUS ========== */
.daily-focus {
    background: linear-gradient(135deg, var(--accent) 0%, #6d28d9 100%);
    color: white;
    padding: var(--space-5);
    border-radius: var(--radius-md);
    text-align: center;
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-md);
    font-size: 1.1rem;
    font-weight: 500;
}

/* ========== NUTRITION ========== */
.nutrition-overview {
    background: var(--bg-elevated);
    padding: var(--space-5);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-5);
}

.nutrition-card {
    text-align: center;
}

.nutrition-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-2);
}

.nutrition-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.nutrition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-5);
}

@media (max-width: 768px) {
    .nutrition-grid {
        grid-template-columns: 1fr;
    }
}

.macro-card {
    background: var(--bg-elevated);
    padding: var(--space-5);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.macro-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-3);
}

.macro-bar {
    width: 100%;
    height: 10px;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    margin: var(--space-3) 0;
}

.macro-fill {
    height: 100%;
    border-radius: var(--radius);
    transition: width 0.5s ease;
}

.protein-fill {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.carbs-fill {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.fats-fill {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.macro-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ========== FOOD LOG ========== */
.food-log {
    margin-top: var(--space-5);
}

.food-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.food-item {
    background: var(--bg-elevated);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    transition: var(--transition);
}

.food-item:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
}

.food-name {
    font-weight: 600;
    color: var(--text);
}

.food-macros {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ========== ACHIEVEMENTS ========== */
.achievements {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-4);
}

@media (max-width: 768px) {
    .achievements {
        grid-template-columns: repeat(2, 1fr);
    }
}

.achievement {
    background: var(--bg-elevated);
    padding: var(--space-5);
    border-radius: var(--radius-md);
    text-align: center;
    border: 2px solid transparent;
    transition: var(--transition);
    cursor: pointer;
}

.achievement:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.achievement.locked {
    opacity: 0.4;
    filter: grayscale(100%);
}

.achievement-icon {
    font-size: 3rem;
    margin-bottom: var(--space-3);
}

.achievement-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: var(--space-2);
}

.achievement-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ========== STATISTICS ========== */
.stats-insights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-4);
}

@media (max-width: 768px) {
    .stats-insights {
        grid-template-columns: 1fr;
    }
}

.insight-card {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
    padding: var(--space-5);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.insight-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: var(--space-2);
}

.insight-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--space-2);
    line-height: 1;
}

.insight-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ========== CALENDAR ========== */
.calendar-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--space-2);
    margin-top: var(--space-5);
}

@media (max-width: 768px) {
    .calendar-grid {
        gap: var(--space-1);
    }
}

.calendar-day-header {
    text-align: center;
    padding: var(--space-3);
    font-weight: 700;
    color: var(--primary);
    font-size: 0.85rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    padding: var(--space-2);
    min-height: 60px;
}

@media (max-width: 768px) {
    .calendar-day {
        min-height: 50px;
    }
}

.calendar-day:hover {
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.calendar-day.other-month {
    opacity: 0.3;
    pointer-events: none;
}

.calendar-day.today {
    border-color: var(--secondary);
    background: linear-gradient(135deg, var(--secondary) 0%, #1e40af 100%);
    color: white;
    font-weight: 700;
}

.calendar-day.has-data {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    border-color: var(--primary);
    color: white;
}

.calendar-day.has-data::after {
    content: '•';
    position: absolute;
    bottom: 4px;
    font-size: 1.2em;
    color: white;
}

.calendar-day-number {
    font-size: 1.1rem;
    font-weight: 600;
}

.day-details {
    margin-top: var(--space-5);
    padding: var(--space-5);
    background: var(--bg-elevated);
    border: 2px solid var(--primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-glow);
}

.day-details.hidden {
    display: none;
}

.day-details h3 {
    color: var(--primary);
    margin-bottom: var(--space-4);
}

.day-detail-item {
    padding: var(--space-4);
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: var(--space-3);
    border: 1px solid var(--border);
}

/* ========== CHARTS ========== */
.chart-controls {
    margin-bottom: var(--space-5);
}

.chart-tabs,
.time-range-tabs {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}

.chart-tab,
.time-tab {
    flex: 1;
    min-width: 100px;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    text-align: center;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .chart-tab,
    .time-tab {
        min-width: 80px;
        padding: var(--space-2) var(--space-3);
        font-size: 0.875rem;
    }
}

.chart-tab:hover,
.time-tab:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
}

.chart-tab.active,
.time-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.chart-container {
    position: relative;
    height: 400px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    border: 1px solid var(--border);
}

@media (max-width: 768px) {
    .chart-container {
        height: 300px;
        padding: var(--space-4);
    }
}

/* ========== MODALS ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content.modal-large {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-4);
    border-bottom: 2px solid var(--border);
}

.modal-header h2 {
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}

.close-btn:hover {
    color: var(--error);
    background: var(--bg-elevated);
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: var(--space-5);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 1rem;
    transition: var(--transition);
    min-height: 44px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ========== FOOD INPUT METHODS ========== */
.food-input-methods {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
    flex-wrap: wrap;
}

.method-btn {
    flex: 1;
    min-width: 120px;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    min-height: 44px;
}

.method-btn:hover {
    border-color: var(--primary);
}

.method-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary);
    color: white;
}

.food-method {
    display: none;
}

.food-method.active {
    display: block;
}

/* ========== ONBOARDING ========== */
.onboarding-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.onboarding-card {
    background: var(--bg-card);
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 100%;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
    .onboarding-card {
        padding: var(--space-6);
    }
}

.onboarding-header {
    text-align: center;
    margin-bottom: var(--space-6);
}

.tagline {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-top: var(--space-2);
}

.step-indicator {
    display: flex;
    justify-content: center;
    gap: var(--space-3);
    margin-bottom: var(--space-8);
}

.step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border);
    transition: var(--transition);
}

.step-dot.active {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
    transform: scale(1.3);
}

.onboarding-step {
    display: none;
}

.onboarding-step.active {
    display: block;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.goal-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-4);
}

@media (max-width: 768px) {
    .goal-options {
        grid-template-columns: 1fr;
    }
}

.goal-card {
    background: var(--bg-elevated);
    padding: var(--space-5);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.goal-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.goal-card.selected {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary);
    color: white;
}

.goal-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-3);
}

.goal-title {
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.goal-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.goal-card.selected .goal-desc {
    color: rgba(255, 255, 255, 0.8);
}

.btn-group {
    display: flex;
    gap: var(--space-4);
    margin-top: var(--space-6);
}

@media (max-width: 768px) {
    .btn-group {
        flex-direction: column;
    }
}

.btn-next,
.btn-group .btn {
    flex: 1;
}

/* ========== EMPTY STATES ========== */
.empty-state {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    color: var(--text-muted);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

/* ========== UTILITIES ========== */
.hidden {
    display: none !important;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-card);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ========== RESPONSIVE IMPROVEMENTS ========== */
@media (max-width: 768px) {
    h1 {
        font-size: 1.75rem;
    }
    
    .section {
        padding: var(--space-4);
        margin-bottom: var(--space-4);
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .btn-action {
        width: 100%;
    }
    
    .modal-content {
        padding: var(--space-4);
        margin: var(--space-2);
    }
}

/* ========== ANIMATIONS ========== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ========== ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ========== RADIO BUTTONS (ONBOARDING) ========== */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.radio-option {
    position: relative;
    display: flex;
    align-items: center;
    padding: var(--space-4);
    background: var(--bg-elevated);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.radio-option:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-option input[type="radio"]:checked ~ .radio-label {
    color: var(--primary);
    font-weight: 600;
}

.radio-option input[type="radio"]:checked ~ .radio-circle {
    background: var(--primary);
    border-color: var(--primary);
}

.radio-option input[type="radio"]:checked ~ .radio-circle::after {
    opacity: 1;
    transform: scale(1);
}

.radio-circle {
    position: relative;
    width: 24px;
    height: 24px;
    min-width: 24px;
    margin-right: var(--space-3);
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    background: var(--bg);
    transition: all 0.2s var(--ease-out);
}

.radio-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: all 0.2s var(--ease-out);
}

.radio-label {
    flex: 1;
    color: var(--text);
    transition: all 0.2s var(--ease-out);
}

.radio-option:has(input[type="radio"]:checked) {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* ========== CHECKBOXES (ONBOARDING) ========== */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.checkbox-option {
    position: relative;
    display: flex;
    align-items: center;
    padding: var(--space-4);
    background: var(--bg-elevated);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.checkbox-option:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.checkbox-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-option input[type="checkbox"]:checked ~ .checkbox-label {
    color: var(--primary);
    font-weight: 600;
}

.checkbox-option input[type="checkbox"]:checked ~ .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-option input[type="checkbox"]:checked ~ .checkbox-custom::after {
    opacity: 1;
    transform: scale(1) rotate(45deg);
}

.checkbox-custom {
    position: relative;
    width: 24px;
    height: 24px;
    min-width: 24px;
    margin-right: var(--space-3);
    border: 2px solid var(--text-muted);
    border-radius: var(--radius-sm);
    background: var(--bg);
    transition: all 0.2s var(--ease-out);
}

.checkbox-custom::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: scale(0) rotate(45deg);
    opacity: 0;
    transition: all 0.2s var(--ease-out);
}

.checkbox-label {
    flex: 1;
    color: var(--text);
    transition: all 0.2s var(--ease-out);
}

.checkbox-option:has(input[type="checkbox"]:checked) {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}
/* ===== Calendar compact mode ===== */
.calendar-grid {
  gap: var(--space-1);
  margin-top: var(--space-4);
}

.calendar-day-header {
  padding: var(--space-2);
  font-size: 0.75rem;
}

.calendar-day {
  aspect-ratio: auto;          /* <-- eemaldab suured ruudud */
  height: 46px;                /* <-- kompaktne kõrgus */
  min-height: 46px;
  padding: 6px;
  justify-content: center;
}

.calendar-day:hover {
  transform: none;             /* vähem hüplemist */
}

.calendar-day-number {
  font-size: 0.95rem;
  line-height: 1;
}

@media (max-width: 768px) {
  .calendar-day {
    height: 40px;
    min-height: 40px;
    padding: 4px;
  }
}
