:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --accent-primary: #0284c7;
    --accent-secondary: #0ea5e9;
    --accent-light: #e0f2fe;
    --status-danger: #dc2626;
    --status-warning: #d97706;
    --status-success: #16a34a;
    --border-color: #cbd5e1;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    
    /* Accessibility */
    --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --radius: 12px;
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Layout */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    background-color: var(--text-primary);
    color: white;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.main-content {
    padding: 2rem;
    overflow-y: auto;
}

/* Sidebar Nav */
.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 600;
    transition: all 0.2s;
}

.nav-item.active {
    background-color: var(--accent-primary);
    color: white;
}

.nav-item:hover:not(.active) {
    background-color: #334155;
    color: white;
}

/* Gamification Header */
.gamified-header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--card-shadow);
}

.progress-track {
    flex: 1;
    max-width: 600px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.progress-bar-bg {
    background: rgba(255,255,255,0.1);
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar-fill {
    background: var(--accent-secondary);
    height: 100%;
    border-radius: 6px;
}

.streak-badge {
    background: rgba(255,255,255,0.1);
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
}

.streak-number {
    font-size: 2rem;
    font-weight: 800;
    display: block;
    color: #fbbf24;
}

/* Grid Layouts */
.patient-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.exercise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: transform 0.2s, border-color 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.patient-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.patient-avatar {
    width: 64px;
    height: 64px;
    background-color: var(--accent-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-primary);
}

.badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-danger { background: #fee2e2; color: #991b1b; border: 1px solid #f87171; }
.badge-success { background: #dcfce7; color: #166534; border: 1px solid #4ade80; }
.badge-warning { background: #fef3c7; color: #92400e; border: 1px solid #fbbf24; }

/* Session Mode Layout */
.session-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    height: calc(100vh - 120px);
}

.video-area {
    background: #000;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    position: relative;
}

.controls-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.big-btn {
    padding: 2rem;
    font-size: 1.5rem;
    font-weight: 800;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: center;
    text-decoration: none;
    display: block;
}

.btn-primary { background: var(--accent-primary); color: white; }
.btn-danger { background: var(--status-danger); color: white; }
.btn-outline { background: white; border: 3px solid var(--border-color); color: var(--text-primary); }

/* Range/Sliders */
.slider-group {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 2px solid var(--border-color);
}

input[type="range"] {
    width: 100%;
    height: 20px;
    margin: 1rem 0;
}

/* Typography & Utilities */
h1 { font-size: 2.5rem; margin: 0 0 1.5rem 0; }
h2 { font-size: 1.75rem; margin: 0 0 1rem 0; }
.text-large { font-size: 1.25rem; }
.mt-auto { margin-top: auto; }

.placeholder-icon {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 1rem;
}

/* Summary Styles */
.summary-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.chart-placeholder {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    height: 300px;
    display: flex;
    align-items: flex-end;
    padding: 2rem;
    gap: 1rem;
}

.chart-bar {
    background: var(--accent-primary);
    width: 100%;
    border-radius: 4px 4px 0 0;
}

.recommendation-card {
    background: var(--accent-light);
    border: 2px solid var(--accent-primary);
    padding: 1.5rem;
    border-radius: var(--radius);
}
