/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
    /* Brand Colors */
    --color-brand: #7c3aed;
    --color-brand-dark: #563b82;

    /* Text Colors */
    --color-text-primary: #1a1a2e;
    --color-text-secondary: #64748b;
    --color-text-tertiary: #475569;
    --color-text-muted: #94a3b8;

    /* Background Colors */
    --color-bg-page: #f8f9fa;
    --color-bg-subtle: #f8fafc;

    /* Border Colors */
    --color-border: #e9ecef;
    --color-border-light: #e2e8f0;
    --color-border-subtle: #f1f5f9;
    --color-border-medium: #cbd5e1;

    /* Semantic Colors */
    --color-success: #10b981;
    --color-success-dark: #059669;
    --color-teal: #0d9488;
    --color-teal-dark: #0f766e;
    --color-danger: #dc3545;
    --color-danger-light: #ef4444;

    /* Gradients */
    --gradient-purple: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-brand: linear-gradient(135deg, #7c3aed, #563b82);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-pill: 24px;

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    --font-size-base: 1rem;      /* 16px - minimum */
    --font-size-md: 1.1rem;      /* 17.6px */
    --font-size-lg: 1.25rem;     /* 20px */
    --font-size-xl: 1.5rem;      /* 24px */
    --font-size-2xl: 1.75rem;    /* 28px */
    --font-size-3xl: 2rem;       /* 32px */
}

/* ==================== Base Styles ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    background: var(--color-bg-page);
    color: #333;
}

button {
    font-family: inherit;
}

.hidden {
    display: none !important;
}


@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.progress-alert {
    animation: slideIn 0.3s ease-out;
}

/* ==================== Today's Workout Card (Tailwind) ==================== */
/* Card container kept for JS population. Interior content styles moved to app.js Tailwind. */

#todays-workout-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    padding: 1.5rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    max-width: 700px;
}

/* ==================== Progress Ring Styles (Chart.js) ==================== */
#todays-progress-ring,
#playlist-view-progress-ring {
    display: block;
}

/* ==================== Video Player Modal (Tailwind) ==================== */
/* Tracking header, sets-list, set-row, set-label, rep-counter, reps-label,
   set-checkbox-wrapper all moved to inline Tailwind in videos.js + manual_entry.js.
   Modal base, shared controls, and done button kept below. */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 1100px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.video-modal {
    width: 100%;
}

/* Rep button (shared: videos.js + manual_entry.js) */
.rep-btn {
    width: 32px;
    height: 32px;
    background: var(--color-bg-subtle);
    border: none;
    font-size: 1rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.rep-btn:hover {
    background: var(--color-border-subtle);
    color: var(--color-text-primary);
}
.rep-btn:active {
    background: var(--color-border-light);
}

/* Rep input (shared) */
.rep-input {
    width: 40px;
    height: 32px;
    border: none;
    border-left: 1px solid var(--color-border-light);
    border-right: 1px solid var(--color-border-light);
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-primary);
    background: white;
}
.rep-input::-webkit-inner-spin-button,
.rep-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.rep-input[type=number] {
    -moz-appearance: textfield;
}

/* Checkbox (shared) */
.set-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}
.checkmark-box {
    width: 22px;
    height: 22px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.checkmark-box i {
    color: white;
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.set-checkbox:checked + .checkmark-box {
    background: var(--color-brand);
    border-color: var(--color-brand);
}
.set-checkbox:checked + .checkmark-box i {
    opacity: 1;
}
label:hover .checkmark-box {
    border-color: var(--color-brand);
}

/* Done button */
.done-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: white;
    color: var(--color-brand);
    border: 2px solid var(--color-brand);
    border-radius: var(--radius-pill);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.done-btn:hover {
    background: var(--color-brand);
    color: white;
}

/* Chart.js canvas override (must stay in CSS for !important) */
.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ==================== Manual Entry Modal (Tailwind) ==================== */
/* Static modal HTML and JS-generated exercise cards moved to Tailwind.
   Thumb wrapper base + preview-active kept (JS toggles .preview-active class). */

.manual-exercise-thumb-wrapper {
    position: relative;
    width: 90px;
    height: 56px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    background: #000;
}

.manual-exercise-thumb-wrapper.preview-active {
    width: 200px;
    height: 113px;
    cursor: default;
    border: 2px solid var(--color-brand);
    border-radius: var(--radius-md);
}

.manual-check-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.35rem;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.08);
    border: 1.5px solid rgba(124, 58, 237, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.manual-check-all-btn:hover {
    background: rgba(124, 58, 237, 0.15);
    border-color: rgba(124, 58, 237, 0.4);
}

#manual-entry-playlist:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
/* ============================================================
   RESPONSIVE BREAKPOINTS (consolidated)
   ============================================================ */

/* --- max-width: 1024px --- */
@media (max-width: 1024px) {
    #todays-workout-card {
        flex-direction: column;
        max-width: 100%;
    }
}

/* --- max-width: 900px --- */
@media (max-width: 900px) {
    .modal-content {
        padding: 1.5rem;
    }
}

/* --- max-width: 768px --- */
@media (max-width: 768px) {
    /* Manual entry preview - mobile */
    .manual-exercise-thumb-wrapper.preview-active {
        width: 100%;
        height: 0;
        padding-bottom: 56.25%;
        position: relative;
    }
    .manual-exercise-thumb-wrapper.preview-active > div {
        position: absolute;
        inset: 0;
    }
}

/* ============================================================
   EDUCATION VIEW (fullscreen iframe takeover)
   ============================================================ */
#education-view {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    z-index: 50;
    display: flex;
    flex-direction: column;
    background: var(--color-bg-page);
}

.education-iframe {
    flex: 1;
    width: 100%;
    border: none;
}