/* ══════════════════════════════════════════
   GYM LOGGER — Custom CSS (Cyberpunk Theme)
   ══════════════════════════════════════════ */

/* ─── Design Tokens (Minimalist) ─── */
:root {
    --bg-void: #000000;
    --bg-surface: #000000;
    --bg-card: #1C1C1E;
    --bg-elevated: #2C2C2E;
    
    --accent-main: #FFD60A;
    --accent-dim: rgba(255, 214, 10, 0.15);
    
    --color-success: #34C759;
    --color-danger: #FF3B30;
    --color-blue: #0A84FF;
    
    --text-primary: #FFFFFF;
    --text-secondary: #8E8E93;
    --text-muted: rgba(255, 255, 255, 0.4);
    
    --border-subtle: #2C2C2E;
    --border-active: #FFD60A;
    
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
    --tab-bar-height: 64px;
    --header-height: 56px;
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    height: 100%;
    height: -webkit-fill-available;
    overflow: hidden;
    -webkit-text-size-adjust: 100%;
}

body {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    font-family: 'Inter', sans-serif;
    background: #3A3A3C; /* Darker gray background for desktop empty space */
    color: var(--text-primary);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

/* ─── Typography ─── */
.font-display { font-family: 'Inter', sans-serif; }
.font-mono { font-family: 'Roboto Mono', 'Inter', monospace; }

.text-accent { color: var(--accent-main); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* ─── Glassmorphism ─── */
/* ─── Buttons ─── */
.btn-primary {
    background: var(--accent-main);
    color: #000;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.15s ease;
}
.btn-primary:active {
    transform: scale(0.97);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-weight: 600;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.15s ease;
}
.btn-secondary:active {
    transform: scale(0.97);
}

/* ─── App Shell ─── */
.app-shell {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    background: var(--bg-void);
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-top: var(--safe-top);
}

.app-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    z-index: 20;
}

.app-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(var(--tab-bar-height) + var(--safe-bottom) + 8px);
}

/* ─── Bottom Tab Bar ─── */
.tab-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: calc(var(--tab-bar-height) + var(--safe-bottom));
    background: #1C1C1E;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: 8px;
    padding-bottom: var(--safe-bottom);
    z-index: 50;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px 16px;
    color: var(--text-muted);
    transition: color 0.2s;
    background: none;
    border: none;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}
.tab-item.active { color: var(--accent-main); }
.tab-item svg { width: 24px; height: 24px; }

/* ─── Cards ─── */
.card {
    background: var(--bg-card);
    border: none;
    border-radius: 24px;
    padding: 20px;
}

.card-muscle {
    background: var(--bg-card);
    border: none;
    border-radius: 24px;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.card-muscle:active {
    border-color: var(--border-active);
    background: var(--accent-dim);
    transform: scale(0.97);
}

/* ─── Steppers ─── */
.stepper {
    display: flex;
    align-items: center;
    gap: 0;
}
.stepper-btn {
    width: 56px; height: 56px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--neon-green);
    font-size: 24px; font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    -webkit-user-select: none;
}
.stepper-btn:first-child { border-radius: 12px 0 0 12px; }
.stepper-btn:last-child { border-radius: 0 12px 12px 0; }
.stepper-btn:active { background: var(--accent-dim); transform: scale(0.95); }

.stepper-value {
    min-width: 80px; height: 56px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    font-family: 'Inter', sans-serif;
    font-size: 24px; font-weight: 700;
    color: var(--text-primary);
}

/* ─── Rest Timer Ring ─── */
.timer-ring {
    position: relative;
    width: 200px; height: 200px;
    margin: 0 auto;
}
.timer-ring svg { transform: rotate(-90deg); }
.timer-ring circle {
    fill: none;
    stroke-width: 6;
    stroke-linecap: round;
}
.timer-ring .bg { stroke: var(--border-subtle); }
.timer-ring .progress { transition: stroke-dashoffset 0.5s linear; }
.timer-ring .time-display {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Inter', sans-serif;
    font-size: 3rem; font-weight: 700;
    line-height: 1;
}

/* Timer color states */
.timer-red .progress { stroke: var(--color-danger); }
.timer-red .time-display { color: var(--color-danger); }
.timer-orange .progress { stroke: var(--accent-main); }
.timer-orange .time-display { color: var(--accent-main); }
.timer-green .progress { stroke: var(--color-success); }
.timer-green .time-display { color: var(--color-success); }

/* ─── Bottom Sheet ─── */
.bottom-sheet-overlay {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 60;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.bottom-sheet-overlay.open { opacity: 1; pointer-events: auto; }

.bottom-sheet {
    position: absolute; bottom: 0; left: 0; right: 0;
    max-height: 80vh;
    z-index: 61;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--safe-bottom);
}
.bottom-sheet.open { transform: translateY(0); }

.sheet-handle {
    width: 40px; height: 5px;
    background: #E5E5EA;
    border-radius: 3px;
    margin: 12px auto;
}

/* ─── AI Suggestion Chip ─── */
.ai-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 214, 10, 0.08);
    border: 1px solid rgba(255, 214, 10, 0.2);
    border-radius: 12px;
    font-size: 14px;
    color: var(--accent-main);
    cursor: pointer;
    transition: all 0.2s;
}
.ai-chip:active {
    background: rgba(255, 214, 10, 0.15);
    transform: scale(0.97);
}

/* ─── Badge ─── */
.badge-unilateral {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(10, 132, 255, 0.1);
    border: 1px solid rgba(10, 132, 255, 0.3);
    border-radius: 8px;
    font-size: 11px;
    color: var(--color-blue);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}



/* ─── Hydration Icon ─── */
.hydration-drop {
    width: 20px; height: 24px;
    position: relative;
}
.hydration-drop svg { fill: rgba(0, 212, 255, 0.3); transition: fill 0.5s; }
.hydration-drop.warn svg { fill: rgba(0, 212, 255, 0.8); animation: pulse 1.5s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.4; }
}

/* ─── Scrollbar ─── */
.app-content::-webkit-scrollbar { width: 0; }

/* ─── RPE Slider ─── */
input[type="range"] {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 6px;
    background: var(--bg-elevated);
    border-radius: 3px;
    outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--accent-main);
    cursor: pointer;
    box-shadow: none;
}

/* ─── Particle Canvas ─── */
#celebration-canvas {
    position: fixed; inset: 0;
    z-index: 70;
    pointer-events: none;
}

/* ─── Media Controller ─── */
.media-ctrl {
    display: flex; align-items: center; gap: 12px;
}
.media-ctrl button {
    background: none; border: none; color: var(--text-secondary);
    cursor: pointer; padding: 4px; transition: color 0.2s;
}
.media-ctrl button:active { color: var(--accent-main); }
.media-ctrl svg { width: 20px; height: 20px; }

/* ─── Custom Scrollbar for inner elements ─── */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent; 
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15); 
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25); 
}
