/* =========================================================
   Gym Tracker - Design System & Stylesheet
   Compatible Mobile-First, Responsive & Modern
   ========================================================= */

:root {
    --primary: #f59e0b;
    --primary-hover: #d97706;
    --primary-light: rgba(245, 158, 11, 0.15);
    --accent: #2a9d8f;
    --bg-page: #f8fafc;
    --surface: #ffffff;
    --surface-subtle: #f1f5f9;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;
    --dark-bg: #0f172a;
    --dark-surface: #1e293b;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
    --shadow-lg: 0 12px 28px rgba(0,0,0,0.12), 0 4px 10px rgba(0,0,0,0.06);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, .brand-icon, .timer-big-digits, .hyrox-big-timer {
    font-family: var(--font-heading);
}

.hidden {
    display: none !important;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 90%;
    width: 360px;
}

.toast {
    padding: 12px 18px;
    border-radius: var(--radius-md);
    background: #1e293b;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    pointer-events: auto;
}

.toast.toast-success { background: #065f46; color: #d1fae5; border: 1px solid #059669; }
.toast.toast-error { background: #991b1b; color: #fee2e2; border: 1px solid #dc2626; }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-15px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* =========================================================
   AUTH VIEW
   ========================================================= */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: radial-gradient(circle at 10% 20%, #1e293b 0%, #0f172a 100%);
}

.auth-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    width: 100%;
    max-width: 440px;
    border-radius: var(--radius-lg);
    padding: 2.2rem 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-header {
    text-align: center;
    margin-bottom: 1.8rem;
}

.auth-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #fef3c7;
    color: #b45309;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: var(--radius-full);
    margin-bottom: 0.8rem;
}

.auth-icon-wrap {
    width: 64px;
    height: 64px;
    margin: 0 auto 0.75rem auto;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35);
}

.auth-icon {
    font-size: 2rem;
}

.auth-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.4rem;
}

.auth-subtitle {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.auth-tabs {
    display: flex;
    background: #f1f5f9;
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 1.6rem;
}

.auth-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.65rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: calc(var(--radius-md) - 2px);
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-tab.active {
    background: white;
    color: #0f172a;
    box-shadow: var(--shadow-sm);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}

.input-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    font-size: 1rem;
    pointer-events: none;
    opacity: 0.6;
}

.input-icon-wrap input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.8rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    font-size: 0.95rem;
    font-family: inherit;
    background: #f8fafc;
    transition: all 0.2s ease;
}

.input-icon-wrap input:focus {
    outline: none;
    border-color: #f59e0b;
    background: white;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.auth-error {
    padding: 0.65rem 0.9rem;
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    border-radius: var(--radius-sm);
    color: #991b1b;
    font-size: 0.85rem;
    font-weight: 500;
}

.btn-primary-auth {
    margin-top: 0.5rem;
    padding: 0.9rem 1.4rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
    transition: all 0.2s ease;
}

.btn-primary-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.45);
}

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

.auth-footer {
    margin-top: 1.8rem;
    text-align: center;
    border-top: 1px solid var(--border);
    padding-top: 1.2rem;
}

.back-to-site {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.back-to-site:hover {
    color: #0f172a;
}

/* =========================================================
   APP SHELL & HEADER
   ========================================================= */

.app-header {
    background: var(--dark-bg);
    color: white;
    padding: 1.25rem 1.5rem 1rem 1.5rem;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 40;
}

.app-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.app-brand {
    font-size: 1.35rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.5px;
}

.brand-icon {
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--dark-surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    color: white;
    background: #334155;
    transform: scale(1.05);
}

.lang-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--dark-surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.lang-btn:hover {
    transform: scale(1.1);
}

.app-header-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.header-subtitle {
    color: #94a3b8;
    font-weight: 400;
}

.user-pill-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--dark-surface);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.user-avatar {
    font-size: 0.85rem;
}

.user-name {
    font-weight: 600;
    color: #f1f5f9;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    background: none;
    border: none;
    color: #f87171;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    text-decoration: underline;
}

/* App Main Container */
.app-main {
    max-width: 680px;
    margin: 0 auto;
    padding: 1.25rem 1rem 4rem 1rem;
}

/* Sub Navbar for views */
.sub-nav {
    display: flex;
    align-items: center;
    margin-bottom: 1.2rem;
}

.back-link {
    background: white;
    border: 1px solid var(--border);
    padding: 0.55rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.back-link:hover {
    background: #f1f5f9;
    transform: translateX(-3px);
}

/* =========================================================
   CATALOG OF EXERCISES
   ========================================================= */

.category-group {
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
}

.category-group-header {
    padding: 0.85rem 1.15rem;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    color: #334155;
}

.category-group-header.hyrox-header {
    background: #fefce8;
    color: #854d0e;
}

.category-group-header.cardio-header {
    background: #fff7ed;
    color: #9a3412;
}

.exercise-list-item {
    width: 100%;
    padding: 0.85rem 1.15rem;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    background: white;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: #1e293b;
    transition: background 0.15s ease;
}

.exercise-list-item:last-child {
    border-bottom: none;
}

.exercise-list-item:hover {
    background: #f8fafc;
}

.exercise-item-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.exercise-badge {
    font-size: 0.72rem;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.exercise-badge.badge-pr {
    background: #fef3c7;
    color: #b45309;
}

.item-arrow {
    color: #cbd5e1;
    font-weight: bold;
    font-size: 1.1rem;
    transition: transform 0.2s ease, color 0.2s ease;
}

.exercise-list-item:hover .item-arrow {
    transform: translateX(4px);
    color: var(--primary);
}

/* =========================================================
   EXERCISE DETAIL / LOG VIEW
   ========================================================= */

.last-session-card {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    color: white;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.last-session-card::after {
    content: '🏆';
    position: absolute;
    right: -10px;
    bottom: -15px;
    font-size: 5rem;
    opacity: 0.08;
    pointer-events: none;
}

.ls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.1rem;
}

.ls-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ls-pr-badge {
    background: #f59e0b;
    color: #78350f;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.05); }
}

.ls-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.ls-stat-val {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
}

.ls-stat-unit {
    font-size: 0.85rem;
    font-weight: 500;
    color: #94a3b8;
}

.ls-stat-lbl {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 2px;
}

.ls-onerm-box {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
}

.ls-date {
    margin-top: 0.8rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    color: #64748b;
}

.ls-empty {
    text-align: center;
    padding: 1.5rem 1rem;
    color: #94a3b8;
    font-style: italic;
    font-size: 0.95rem;
}

/* Media Player */
.media-container {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    background: #0f172a;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    max-height: 360px;
    height: 300px;
}

.media-container video, .media-container img {
    width: 100%;
    height: 100%;
    max-height: 300px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    background: #0f172a;
}

.media-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: var(--radius-full);
}

/* Card & Form Styles */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.card-title-bordered {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
}

.grid-cols-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.gap-4 {
    gap: 1rem;
}

.input-num-box {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.input-num-box label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

.input-num-box input {
    width: 100%;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: #f8fafc;
    outline: none;
    transition: all 0.2s ease;
}

.input-num-box input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-action-primary {
    width: 100%;
    margin-top: 1.25rem;
    padding: 0.95rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
    transition: all 0.2s ease;
}

.btn-action-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

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

/* History */
.history-section {
    padding-bottom: 2rem;
}

.history-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.15rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.history-main {
    display: flex;
    flex-direction: column;
}

.history-vals {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.history-date {
    font-size: 0.78rem;
    color: #94a3b8;
    text-transform: capitalize;
}

.history-secondary {
    text-align: right;
    font-weight: 700;
}

.text-reps { color: #059669; }
.text-duration { color: #d97706; }

/* =========================================================
   TIMERS & TOOLS MENUS
   ========================================================= */

.menu-choice-btn {
    width: 100%;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    text-align: left;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.menu-choice-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.menu-choice-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.menu-choice-text h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2px;
}

.menu-choice-text p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.menu-arrow {
    margin-left: auto;
    font-size: 1.25rem;
    color: #cbd5e1;
}

/* =========================================================
   TABATA TIMER
   ========================================================= */

.timer-fullscreen {
    min-height: 85vh;
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: background-color 0.4s ease;
    box-shadow: var(--shadow-lg);
}

.timer-fullscreen.phase-work { background-color: #16a34a !important; }
.timer-fullscreen.phase-rest { background-color: #dc2626 !important; }
.timer-fullscreen.phase-prep { background-color: #d97706 !important; }
.timer-fullscreen.phase-finished { background-color: #2563eb !important; }
.timer-fullscreen.phase-idle { background-color: #0f172a !important; }

.timer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
}

.icon-btn-ghost {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.icon-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.15);
}

.timer-top-title {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.9);
}

.timer-top-actions {
    display: flex;
    gap: 6px;
}

.timer-display-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.timer-phase-title {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 3px;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.timer-big-digits {
    font-size: 8rem;
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -4px;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.tabata-rounds-counter {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rounds-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    opacity: 0.7;
}

.rounds-val {
    font-size: 2.2rem;
    font-weight: 800;
}

.timer-controls {
    padding: 2rem 1.5rem;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.btn-timer-primary {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    transition: transform 0.15s ease;
}

.btn-timer-primary:active {
    transform: scale(0.92);
}

.btn-timer-secondary {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-timer-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Modal Tabata */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
}

.modal-card {
    background: white;
    width: 100%;
    max-width: 380px;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
}

.input-number-large {
    width: 100%;
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    padding: 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #f8fafc;
}

/* =========================================================
   HYROX TIMER
   ========================================================= */

.timer-hyrox-container {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    min-height: 85vh;
    display: flex;
    flex-direction: column;
}

.hyrox-time-banner {
    padding: 1.5rem 1rem;
    text-align: center;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-bottom: 1px solid #334155;
}

.hyrox-status-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.hyrox-big-timer {
    font-size: 4.5rem;
    font-weight: 900;
    letter-spacing: -2px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.hyrox-stage-card {
    background: #1e293b;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #334155;
}

.hyrox-stage-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.stage-tag {
    font-size: 0.72rem;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 1px;
}

.stage-num {
    font-family: monospace;
    font-size: 0.85rem;
    color: #cbd5e1;
}

.hyrox-stage-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
}

.hyrox-next-stage {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 8px;
}

.hyrox-controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1.25rem 1rem;
}

.hyrox-btn {
    border: none;
    border-radius: var(--radius-md);
    padding: 1.4rem 0.5rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-md);
    transition: all 0.15s ease;
}

.hyrox-btn:active {
    transform: scale(0.96);
}

.hyrox-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.hyrox-btn-icon {
    font-size: 1.5rem;
}

.hyrox-btn-label {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.hyrox-splits-section {
    flex: 1;
    background: #0f172a;
    padding: 1rem;
    overflow-y: auto;
}

.splits-table-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #64748b;
    padding: 0 8px 8px 8px;
    border-bottom: 1px solid #1e293b;
}

.splits-col-times {
    display: flex;
    gap: 1.5rem;
}

.split-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0.6rem;
    background: rgba(30, 41, 59, 0.4);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.split-stage-title {
    font-weight: 500;
    color: #cbd5e1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 8px;
}

.split-times {
    display: flex;
    gap: 1.5rem;
    font-family: monospace;
}

.split-lap-time {
    color: #facc15;
    font-weight: 700;
}

.split-cumul-time {
    color: #94a3b8;
}

/* =========================================================
   CONVERTERS
   ========================================================= */

.converter-container {
    max-width: 440px;
    margin: 0 auto;
    padding: 1rem;
}

.converter-box {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.converter-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.6rem;
    display: block;
}

.converter-input {
    width: 100%;
    text-align: center;
    font-size: 2.4rem;
    font-weight: 800;
    padding: 0.8rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: #f8fafc;
    outline: none;
    transition: all 0.2s ease;
}

.converter-input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.converter-arrow {
    text-align: center;
    font-size: 2rem;
    color: #cbd5e1;
}

.pace-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pace-sep {
    font-size: 2rem;
    font-weight: 800;
    color: #94a3b8;
}

/* =========================================================
   EXERCISE MANAGER
   ========================================================= */

.manage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    background: white;
    border-bottom: 1px solid #f1f5f9;
}

.manage-item.is-hidden {
    background: #f8fafc;
    opacity: 0.6;
}

.manage-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-icon-manage {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: none;
    background: #f1f5f9;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-icon-manage:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-icon-manage.btn-delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Edit Form */
.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: white;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* =========================================================
   SEARCH & FILTERS FOR EXERCISES
   ========================================================= */

.search-filter-section {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.search-bar-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.search-bar-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-icon {
    position: absolute;
    left: 14px;
    font-size: 1.1rem;
    pointer-events: none;
    opacity: 0.6;
}

#catalog-search-input {
    width: 100%;
    padding: 0.9rem 2.8rem 0.9rem 2.9rem;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    color: var(--text-main);
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e2e8f0;
    border: none;
    color: #475569;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
}

.clear-search-btn:hover {
    background: #cbd5e1;
    color: #0f172a;
}

.filter-chips-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.filter-chips-scroll::-webkit-scrollbar {
    display: none;
}

.chip {
    white-space: nowrap;
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-full);
    background: white;
    border: 1px solid var(--border);
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chip:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

.chip.active {
    background: var(--dark-bg);
    color: white;
    border-color: var(--dark-bg);
    box-shadow: var(--shadow-sm);
}

.catalog-results-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    padding-left: 4px;
}

/* Thumbnail in exercise item */
.exercise-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    background: #f8fafc;
    border: 1px solid var(--border);
    flex-shrink: 0;
    padding: 2px;
}

.exercise-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.exercise-item-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.exercise-item-name {
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.exercise-item-sub {
    font-size: 0.75rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Instructions Step-by-Step Card in Details */
.instructions-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.instructions-header {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.6rem;
}

.instructions-steps-list {
    list-style: none;
    counter-reset: step-counter;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.instructions-steps-list li {
    counter-increment: step-counter;
    position: relative;
    padding-left: 2rem;
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.5;
}

.instructions-steps-list li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 1px;
    width: 22px;
    height: 22px;
    background: #fef3c7;
    color: #b45309;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.instructions-text-block {
    font-size: 0.92rem;
    color: #334155;
    line-height: 1.6;
}

.load-more-container {
    text-align: center;
    padding: 1.5rem 0;
}

.btn-load-more {
    padding: 0.75rem 1.8rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-load-more:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

