/* ============================================
   FitLife - Fitness Tracking App Styles
   Light Theme
   ============================================ */

/* CSS Variables - Light Theme */
:root {
    /* Colors */
    --primary: #6366F1;
    --primary-light: #818CF8;
    --primary-dark: #4F46E5;
    --secondary: #10B981;
    --secondary-light: #34D399;
    --accent: #F59E0B;
    --accent-light: #FBBF24;
    --danger: #EF4444;
    --danger-light: #F87171;
    
    /* Background Colors - Light Theme */
    --bg-dark: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F1F5F9;
    --bg-sidebar: #FFFFFF;
    --bg-input: #F1F5F9;
    --bg-body: linear-gradient(180deg, #F8FAFC 0%, #E2E8F0 100%);
    
    /* Text Colors - Light Theme */
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    --gradient-secondary: linear-gradient(135deg, #10B981 0%, #34D399 100%);
    --gradient-accent: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
    --gradient-bg: linear-gradient(180deg, #F8FAFC 0%, #E2E8F0 100%);
    
    /* Shadows - Light Theme */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.25);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s ease;
    
    /* Layout */
    --sidebar-width: 260px;
    --header-height: 80px;
    --bottom-nav-height: 70px;
}

/* Reset & Base Styles */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }

p {
    color: var(--text-secondary);
    font-size: 14px;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   Layout Structure
   ============================================ */

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-card);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    z-index: 100;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    transition: transform var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: var(--space-lg);
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.logo-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.logo span {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navigation Menu */
.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.nav-item:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary);
}

.nav-item.active::before {
    opacity: 1;
}

.nav-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    width: 100%;
    height: 100%;
}

.nav-item span {
    font-weight: 500;
    font-size: 15px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    margin-top: var(--space-lg);
}

.user-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: rgba(99, 102, 241, 0.08);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.user-card:hover {
    background: rgba(99, 102, 241, 0.12);
    transform: translateX(4px);
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 2px solid var(--primary);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.user-level {
    font-size: 12px;
    color: var(--primary);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--space-lg);
    padding-bottom: calc(var(--bottom-nav-height) + var(--space-xl));
    min-height: 100vh;
    background: var(--bg-body);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.menu-toggle:hover {
    background: var(--primary);
    color: white;
}

.menu-toggle svg {
    width: 22px;
    height: 22px;
}

.greeting h1 {
    font-size: 28px;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.greeting p {
    font-size: 15px;
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.date-display {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    box-shadow: var(--shadow-sm);
}

.date-display svg {
    width: 18px;
    height: 18px;
}

.notification-btn {
    position: relative;
    width: 42px;
    height: 42px;
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.notification-btn:hover {
    background: var(--primary);
    color: white;
}

.notification-btn svg {
    width: 20px;
    height: 20px;
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    background: var(--danger);
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.header-avatar {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 2px solid var(--primary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.header-avatar:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Dashboard */
.dashboard {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card.steps::before { background: var(--gradient-primary); }
.stat-card.calories::before { background: var(--gradient-accent); }
.stat-card.distance::before { background: var(--gradient-secondary); }
.stat-card.heart::before { background: linear-gradient(135deg, #EF4444 0%, #F87171 100%); }

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-sm);
}

.stat-card.steps .stat-icon { background: rgba(99, 102, 241, 0.12); color: var(--primary); }
.stat-card.calories .stat-icon { background: rgba(245, 158, 11, 0.12); color: var(--accent); }
.stat-card.distance .stat-icon { background: rgba(16, 185, 129, 0.12); color: var(--secondary); }
.stat-card.heart .stat-icon { background: rgba(239, 68, 68, 0.12); color: var(--danger); }

.stat-icon svg {
    width: 26px;
    height: 26px;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.stat-value {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-value small {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-progress {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--gradient-primary);
    transition: width 1s ease;
    animation: progressFill 1.5s ease;
}

@keyframes progressFill {
    from { width: 0; }
}

.stat-card.calories .progress-fill { background: var(--gradient-accent); }
.stat-card.distance .progress-fill { background: var(--gradient-secondary); }
.stat-card.heart .progress-fill { background: linear-gradient(135deg, #EF4444 0%, #F87171 100%); }

.progress-text {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

/* Dashboard Main Section */
.dashboard-main {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: var(--space-lg);
}

/* Chart Card */
.chart-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.card-header h3 {
    color: var(--text-primary);
}

.card-actions {
    display: flex;
    gap: var(--space-sm);
}

.filter-btn {
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-base);
}

.filter-btn:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Bar Chart - Weekly Activity */
.bar-chart {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 180px;
    padding: var(--space-md) 0;
    gap: var(--space-sm);
}

.bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    flex: 1;
    height: 100%;
    justify-content: flex-end;
}

.bar {
    width: 100%;
    max-width: 40px;
    min-height: 20px;
    height: var(--height);
    background: var(--gradient-primary);
    border-radius: var(--radius-sm) var(--radius-sm) 4px 4px;
    position: relative;
    animation: barGrow 1s ease;
    transition: all var(--transition-base);
    cursor: pointer;
    box-shadow: 0 -2px 10px rgba(99, 102, 241, 0.3);
}

.bar:hover {
    filter: brightness(1.1);
    transform: scaleY(1.02);
    transform-origin: bottom;
}

@keyframes barGrow {
    from { height: 0; }
}

.bar-value {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    opacity: 0;
    transition: opacity var(--transition-base);
    white-space: nowrap;
}

.bar:hover .bar-value {
    opacity: 1;
}

.bar-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* Goals Card */
.goals-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.view-all {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color var(--transition-base);
}

.view-all:hover {
    color: var(--primary-dark);
}

.goals-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.goal-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-md);
    background: rgba(0, 0, 0, 0.02);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.goal-item:hover {
    background: rgba(99, 102, 241, 0.06);
    transform: translateY(-2px);
}

.goal-ring {
    width: 45px;
    height: 45px;
    position: relative;
    flex-shrink: 0;
    margin-bottom: var(--space-xs);
}

.goal-ring svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.ring-bg {
    fill: none;
    stroke: rgba(0, 0, 0, 0.08);
    stroke-width: 3.5;
}

.ring-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 3.5;
    stroke-linecap: round;
    transition: stroke-dasharray 1.5s ease;
    animation: ringFill 2s ease;
}

@keyframes ringFill {
    from { stroke-dasharray: 0, 100; }
}

.goal-ring .ring-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
}

.calories-ring .ring-fill { stroke: var(--accent); }
.water-ring .ring-fill { stroke: #3B82F6; }
.sleep-ring .ring-fill { stroke: #8B5CF6; }

.goal-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.goal-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.goal-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Workouts Section */
.workouts-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.section-header h3 {
    color: var(--text-primary);
}

.start-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-glow);
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.4);
}

.start-btn svg {
    width: 16px;
    height: 16px;
}

.workouts-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.workout-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: rgba(0, 0, 0, 0.02);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    transition: all var(--transition-base);
}

.workout-card:hover {
    background: rgba(99, 102, 241, 0.06);
    border-color: rgba(99, 102, 241, 0.2);
    transform: translateX(4px);
}

.workout-card.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
}

.workout-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.workout-icon svg {
    width: 24px;
    height: 24px;
}

.workout-icon.running { background: rgba(99, 102, 241, 0.12); color: var(--primary); }
.workout-icon.strength { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.workout-icon.yoga { background: rgba(139, 92, 246, 0.12); color: #8B5CF6; }

.workout-details {
    flex: 1;
    min-width: 0;
}

.workout-details h4 {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.workout-details p {
    font-size: 13px;
    color: var(--text-muted);
}

.workout-stats {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    min-width: 80px;
    text-align: right;
}

.cal-burned {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
}

.workout-progress {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.workout-progress .progress-fill {
    height: 100%;
    background: var(--secondary);
}

.workout-status {
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.workout-status.completed {
    background: rgba(16, 185, 129, 0.12);
    color: var(--secondary);
}

.workout-status.upcoming {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary);
}

/* Activities Section */
.activities-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.activities-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.activity-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: rgba(0, 0, 0, 0.02);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.activity-item:hover {
    background: rgba(99, 102, 241, 0.06);
    transform: translateX(4px);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon svg {
    width: 20px;
    height: 20px;
}

.activity-icon.swimming { background: rgba(59, 130, 246, 0.12); color: #3B82F6; }
.activity-icon.cycling { background: rgba(16, 185, 129, 0.12); color: var(--secondary); }
.activity-icon.meditation { background: rgba(139, 92, 246, 0.12); color: #8B5CF6; }
.activity-icon.hiking { background: rgba(245, 158, 11, 0.12); color: var(--accent); }

.activity-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.activity-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.activity-time {
    font-size: 12px;
    color: var(--text-muted);
}

.activity-cal {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
}

/* Bottom Navigation (Mobile) */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--bg-card);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0 var(--space-md);
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: var(--space-sm);
    color: var(--text-muted);
    transition: all var(--transition-base);
    flex: 1;
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-icon {
    width: 24px;
    height: 24px;
}

.bottom-nav-icon svg {
    width: 100%;
    height: 100%;
}

.bottom-nav-item span {
    font-size: 11px;
    font-weight: 500;
}

.bottom-nav-item.center-btn {
    position: relative;
    top: -20px;
}

.center-icon {
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow), var(--shadow-md);
    transition: all var(--transition-base);
}

.center-icon:hover {
    transform: scale(1.1);
}

.center-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

/* ============================================
   Responsive Design
   ============================================ */

/* Tablet Breakpoint */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-main {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        width: 80px;
        padding: var(--space-md);
    }
    
    .logo span,
    .nav-item span,
    .user-info {
        display: none;
    }
    
    .logo {
        justify-content: center;
    }
    
    .nav-item {
        justify-content: center;
        padding: var(--space-md);
    }
    
    .sidebar-footer .user-card {
        justify-content: center;
        padding: var(--space-sm);
    }
    
    .main-content {
        margin-left: 80px;
    }
}

/* Mobile Breakpoint */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
        padding: var(--space-lg);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar.open ~ .sidebar-overlay {
        display: block;
    }
    
    .logo span,
    .nav-item span,
    .user-info {
        display: block;
    }
    
    .logo {
        justify-content: flex-start;
    }
    
    .nav-item {
        justify-content: flex-start;
        padding: var(--space-md) var(--space-lg);
    }
    
    .sidebar-footer .user-card {
        justify-content: flex-start;
        padding: var(--space-md);
    }
    
    .main-content {
        margin-left: 0;
        padding: var(--space-md);
        padding-top: var(--space-lg);
        padding-bottom: calc(var(--bottom-nav-height) + var(--space-xl));
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .header {
        flex-direction: column;
        gap: var(--space-md);
        align-items: flex-start;
    }
    
    .header-left {
        width: 100%;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .date-display {
        display: none;
    }
    
    .greeting h1 {
        font-size: 22px;
    }
    
    /* Mobile Stats Grid - 2x2 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
    
    .stat-card {
        flex-direction: column;
        padding: var(--space-md);
        text-align: center;
    }
    
    .stat-icon {
        width: 44px;
        height: 44px;
        margin: 0 auto var(--space-sm);
    }
    
    .stat-icon svg {
        width: 22px;
        height: 22px;
    }
    
    .stat-value {
        font-size: 22px;
    }
    
    .stat-progress {
        width: 100%;
    }
    
    .bar-chart {
        height: 140px;
    }
    
    .bar {
        max-width: 32px;
    }
    
    .goals-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
    
    .goal-item {
        flex-direction: column;
        text-align: center;
        padding: var(--space-sm);
    }
    
    .workout-card {
        flex-wrap: wrap;
    }
    
    .workout-stats {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }
    
    .bottom-nav {
        display: flex;
    }
    
    .card-header {
        flex-direction: column;
        gap: var(--space-md);
        align-items: flex-start;
    }
    
    .card-actions {
        width: 100%;
    }
    
    .filter-btn {
        flex: 1;
        text-align: center;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    :root {
        --space-lg: 16px;
        --space-xl: 24px;
    }
    
    .stat-card {
        padding: var(--space-sm);
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
    }
    
    .stat-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    /* Keep 2x2 grid on small mobile too */
    .goals-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .goal-item {
        padding: var(--space-xs);
    }
    
    .goal-ring {
        width: 38px;
        height: 38px;
    }
    
    .goal-title {
        font-size: 12px;
    }
    
    .goal-desc {
        font-size: 10px;
    }
    
    .bar-chart {
        height: 120px;
        gap: var(--space-xs);
    }
    
    .bar {
        max-width: 28px;
    }
    
    .bar-label {
        font-size: 10px;
    }
}

/* Animation Utilities */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-card {
    animation: fadeIn 0.5s ease backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.15s; }
.stat-card:nth-child(3) { animation-delay: 0.2s; }
.stat-card:nth-child(4) { animation-delay: 0.25s; }

.chart-card,
.goals-card {
    animation: fadeIn 0.6s ease backwards;
    animation-delay: 0.3s;
}

.workouts-section,
.activities-section {
    animation: fadeIn 0.6s ease backwards;
    animation-delay: 0.4s;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Selection */
::selection {
    background: var(--primary);
    color: white;
}

/* Focus States */
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
    display: block;
}

