.cursor-pointer {
    cursor: pointer;
}

.hover-text-danger:hover {
    color: var(--danger-color) !important;
}

.hover-text-white:hover {
    color: white !important;
}

:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --success-color: #4cc9f0;
    --danger-color: #f72585;
    --dark-bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
}

body {
    background-color: var(--dark-bg);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: row;
}

/* Background Animation */
.bg-gradient-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 15% 50%, rgba(67, 97, 238, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(247, 37, 133, 0.15), transparent 25%);
}

/* Sidebar */
.sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;           /* FIXED: siempre visible, no se corta con scroll */
    top: 0;
    left: 0;
    flex-shrink: 0;
    background: rgba(15, 23, 42, 0.95);
    border-right: var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1045;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;           /* outer: no scroll bars on el sidebar mismo */
}

.brand {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--success-color), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0px 2px 4px rgba(67, 97, 238, 0.3));
}

.brand ion-icon {
    color: var(--success-color);
    -webkit-text-fill-color: var(--success-color);
    /* Override gradient for icon */
}

/* Scrollable inner nav — ensures links never get cut when page is tall */
.sidebar-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(67, 97, 238, 0.3) transparent;
    padding-bottom: 1rem;
    margin-right: -0.5rem;  /* compensate for scrollbar width */
    padding-right: 0.5rem;
}

.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(67, 97, 238, 0.3); border-radius: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }

/* Sidebar Headings */
.sidebar-heading {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
    opacity: 0.6;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    color: var(--text-secondary);
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0.15rem;
    font-weight: 500;
    position: relative;
    border-left: 3px solid transparent;
    /* Prepare for active state */
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(67, 97, 238, 0.15), transparent);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
    font-weight: 600;
}

.nav-link.active ion-icon {
    color: var(--primary-color);
    filter: drop-shadow(0 0 8px rgba(67, 97, 238, 0.6));
}

.nav-link ion-icon {
    font-size: 1.25rem;
}

/* Main Content — offset for fixed sidebar */
.main-content {
    flex-grow: 1;
    min-width: 0;
    margin-left: 260px;         /* Match fixed sidebar width */
    padding: 90px 2rem 2rem 2rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Sidebar Toggle Button (Mobile) */
.btn-sidebar-toggle {
    position: fixed;
    top: 1.25rem;
    left: 1.25rem;
    z-index: 1100; /* Ensure it stays above top-bar (1040) */
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    border: var(--glass-border);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 0.5rem;
    display: none;
    /* Hidden on desktop */
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: none;
    cursor: pointer;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1150;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Responsive Styles */

/* Tablets (Large) - Collapse sidebar to icons */
@media (max-width: 991.98px) {
    .sidebar {
        width: 80px;
        padding: 1rem 0.5rem;
    }

    .brand span,
    .nav-link span,
    .sidebar-heading {
        display: none;
    }

    .nav-link {
        justify-content: center;
        padding: 0.6rem;
    }

    .nav-link ion-icon {
        font-size: 1.5rem;
    }

    .nav-link.active {
        border-left: none;
        background: rgba(67, 97, 238, 0.15);
    }

    .main-content {
        margin-left: 80px;      /* Match collapsed sidebar */
        padding: 80px 1.5rem 1.5rem 1.5rem;
    }
}

/* Mobile Devices - Off-canvas sidebar */
@media (max-width: 767.98px) {
    .btn-sidebar-toggle {
        display: flex;
    }

    .sidebar {
        left: 0;
        top: 0;
        width: 260px;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.5);
    }

    .sidebar.show {
        transform: translateX(0);
        z-index: 1200;
    }

    /* Restore text for off-canvas menu */
    .brand span,
    .nav-link span,
    .sidebar-heading {
        display: inline-flex;
    }

    .sidebar-heading { display: block; }

    .nav-link {
        justify-content: flex-start;
        padding: 0.6rem 1rem;
    }

    .nav-link.active {
        border-left: 3px solid var(--primary-color);
        background: linear-gradient(90deg, rgba(67, 97, 238, 0.15), transparent);
    }

    /* NO margin-left: sidebar is off-canvas */
    .main-content {
        margin-left: 0 !important;
        padding: 70px 0.75rem 1rem 0.75rem;
    }

    .glass-card {
        padding: 1rem !important;
        border-radius: 1rem !important;
    }

    .page-title { font-size: 1.5rem; }
}

/* ── Glass Tabs — unified design used across all modules ─────────────────── */
.glass-tabs {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.3rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 100px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.glass-tabs::-webkit-scrollbar {
    display: none;
}

.glass-tabs .nav-item {
    margin: 0;
}

.glass-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 1.1rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.8);
    /* muted slate */
    background: transparent;
    border: none;
    margin-bottom: 0;
    transition: color 0.2s ease, background 0.2s ease;
    white-space: nowrap;
}

.glass-tabs .nav-link ion-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.glass-tabs .nav-link:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.05);
}

.glass-tabs .nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.glass-tabs .nav-link.active ion-icon {
    color: #ffffff;
}


/* Cards & Glassmorphism */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: none;
}

/* Forms */
.form-control,
.form-select {
    background: rgba(15, 23, 42, 0.6);
    border: var(--glass-border);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
}

.form-control:focus,
.form-select:focus {
    background: rgba(15, 23, 42, 0.8);
    border-color: var(--primary-color);
    box-shadow: none;
    color: var(--text-primary);
}

.form-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

/* Buttons - Global Glassmorphism Redesign */
:root {
    --btn-primary-rgb: 67, 97, 238;
    --btn-success-rgb: 76, 201, 240;
    --btn-danger-rgb: 247, 37, 133;
    --btn-warning-rgb: 245, 158, 11;
    --btn-info-rgb: 13, 202, 240;
    --btn-secondary-rgb: 148, 163, 184;
}

.btn {
    box-shadow: none !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
}

.btn:hover {
    box-shadow: none !important;
    transform: translateY(-2px);
}

/* Color Variants */
.btn-primary,
.btn-outline-primary {
    background: rgba(var(--btn-primary-rgb), 0.12) !important;
    border-color: rgba(var(--btn-primary-rgb), 0.3) !important;
    color: var(--primary-color) !important;
}

.btn-primary:hover,
.btn-outline-primary:hover {
    background: rgba(var(--btn-primary-rgb), 0.25) !important;
    color: #fff !important;
}

.btn-success,
.btn-outline-success {
    background: rgba(var(--btn-success-rgb), 0.12) !important;
    border-color: rgba(var(--btn-success-rgb), 0.3) !important;
    color: var(--success-color) !important;
}

.btn-success:hover,
.btn-outline-success:hover {
    background: rgba(var(--btn-success-rgb), 0.25) !important;
    color: #fff !important;
}

.btn-danger,
.btn-outline-danger {
    background: rgba(var(--btn-danger-rgb), 0.12) !important;
    border-color: rgba(var(--btn-danger-rgb), 0.3) !important;
    color: var(--danger-color) !important;
}

.btn-danger:hover,
.btn-outline-danger:hover {
    background: rgba(var(--btn-danger-rgb), 0.25) !important;
    color: #fff !important;
}

.btn-warning,
.btn-outline-warning {
    background: rgba(var(--btn-warning-rgb), 0.12) !important;
    border-color: rgba(var(--btn-warning-rgb), 0.3) !important;
    color: #f59e0b !important;
}

.btn-warning:hover,
.btn-outline-warning:hover {
    background: rgba(var(--btn-warning-rgb), 0.25) !important;
    color: #fff !important;
}

.btn-info,
.btn-outline-info {
    background: rgba(var(--btn-info-rgb), 0.12) !important;
    border-color: rgba(var(--btn-info-rgb), 0.3) !important;
    color: #0dcaf0 !important;
}

.btn-info:hover,
.btn-outline-info:hover {
    background: rgba(var(--btn-info-rgb), 0.25) !important;
    color: #fff !important;
}

.btn-secondary,
.btn-outline-secondary {
    background: rgba(var(--btn-secondary-rgb), 0.12) !important;
    border-color: rgba(var(--btn-secondary-rgb), 0.3) !important;
    color: #94a3b8 !important;
}

.btn-secondary:hover,
.btn-outline-secondary:hover {
    background: rgba(var(--btn-secondary-rgb), 0.25) !important;
    color: #fff !important;
}

/* Fallback for existing specific glass buttons */
.btn-glass {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Tabs */
.nav-tabs {
    border-bottom: var(--glass-border);
    margin-bottom: 1.5rem;
}

.nav-tabs .nav-link {
    color: var(--text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 1rem 1.5rem;
    margin-bottom: -1px;
    background: transparent;
}

.nav-tabs .nav-link:hover {
    color: var(--text-primary);
    background: transparent;
}

/* Gym AI Modes */
.gym-mode-technique {
    --mode-color: var(--primary-color);
}

.gym-mode-performance {
    --mode-color: #00b894;
    /* Vivid Green for Performance */
}

/* Apply mode color to Glass Cards in that section */
.gym-mode-performance .glass-card {
    border-color: rgba(0, 184, 148, 0.3);
    box-shadow: none;
}

.gym-mode-performance .text-primary {
    color: #00b894 !important;
}

.gym-mode-performance .btn-primary {
    background-color: #00b894;
    border-color: #00b894;
}

.gym-mode-performance .btn-outline-primary {
    color: #00b894;
    border-color: #00b894;
}

/* Custom Scrollbar for Glass Cards */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.3);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(67, 97, 238, 0.5);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(67, 97, 238, 0.8);
}

.gym-mode-performance .btn-outline-primary:hover {
    background-color: #00b894;
    color: white;
}

/* HUD Overlay Theme Override */
.gym-mode-performance .gym-hud-overlay .badge.bg-primary {
    background-color: #00b894 !important;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background: transparent;
    border-bottom-color: var(--primary-color);
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--glass-border);
    border-radius: 1rem;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(67, 97, 238, 0.02);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(67, 97, 238, 0.05);
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Result Box */
.ai-result-box {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 0.75rem;
    padding: 1rem;
    min-height: 200px;
    border: var(--glass-border);
}

/* Utilities */
.text-accent {
    color: var(--primary-color);
}

.text-muted {
    color: var(--text-secondary) !important;
}

/* Removed deprecated media query */


/* AI Scanning Overlay */
.scanning-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, transparent, #0dcaf0, transparent);
    box-shadow: 0 0 15px #0dcaf0;
    animation: scan 3s linear infinite;
}

@keyframes scan {
    0% {
        top: 0;
    }

    100% {
        top: 100%;
    }
}

/* Gym HUD Overlay */
.gym-hud-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.glass-panel {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.glass-card {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1.5rem;
    padding: 2rem;
    transition: all 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(30, 41, 59, 0.5);
}

/* HUD Corners */
.hud-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    opacity: 0.5;
    pointer-events: none;
}

.hud-corner-tl {
    top: 10px;
    left: 10px;
    border-right: 0;
    border-bottom: 0;
}

.hud-corner-tr {
    top: 10px;
    right: 10px;
    border-left: 0;
    border-bottom: 0;
}

.hud-corner-bl {
    bottom: 10px;
    left: 10px;
    border-right: 0;
    border-top: 0;
}

.hud-corner-br {
    bottom: 10px;
    right: 10px;
    border-left: 0;
    border-top: 0;
}


#hudRepCounter {
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.overlay-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    padding: 0;
}

.overlay-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.overlay-btn.btn-play i {
    color: #10b981;
}

.overlay-btn.btn-pause i {
    color: #f59e0b;
}

.overlay-btn.btn-stop i {
    color: #ef4444;
}

/* Pause State Animation */
.floating-timer-overlay.paused .timer-icon {
    animation: pulse-pause 2s infinite;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

@keyframes pulse-pause {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.95);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Gym Calculator Utilities */
.hover-lift {
    transition: transform 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: none !important;
}

.hover-bg-light {
    transition: background-color 0.2s ease;
}

.hover-bg-light:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.glow-primary {
    position: relative;
    z-index: 1;
}

.glow-primary::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: inherit;
    z-index: -1;
    filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.glow-primary:hover::before {
    opacity: 0.6;
}


.text-shadow-sm {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.text-shadow-lg {
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.7);
}

/* Video Container Responsive */
.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Pulse & Glow Animations */
@keyframes pulse-slow {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(0.98);
    }
}

.animate-pulse-slow {
    animation: pulse-slow 3s ease-in-out infinite;
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-in {
    animation: slide-in 0.5s ease-out forwards;
}

/* Specific Glows */
.glow-success:hover {
    box-shadow: 0 0 20px rgba(25, 135, 84, 0.4);
    border-color: rgba(25, 135, 84, 0.6) !important;
}

.glow-danger:hover {
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.4);
    border-color: rgba(220, 53, 69, 0.6) !important;
}

.glow-warning:hover {
    box-shadow: 0 0 20px rgba(253, 126, 20, 0.4);
    border-color: rgba(253, 126, 20, 0.6) !important;
}

.glow-info:hover {
    box-shadow: 0 0 20px rgba(13, 202, 240, 0.4);
    border-color: rgba(13, 202, 240, 0.6) !important;
}

/* Typography & Layout Utilities */
.ls-1 {
    letter-spacing: 1px !important;
}

.ls-2 {
    letter-spacing: 2px !important;
}

/* Premium Input Styling */
.input-dark {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    padding: 0.6rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.input-dark:focus {
    background: rgba(15, 23, 42, 0.8) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 15px rgba(67, 97, 238, 0.2);
    outline: none;
}

.input-dark::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* --- Routine Builder Specifics --- */

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(67, 97, 238, 0.3);
    border-radius: 4px;
    transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(67, 97, 238, 0.6);
}

/* Exercise Browser Cards */
.exercise-card-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    /* Softer border */
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.4), rgba(15, 23, 42, 0.4));
    animation: fadeInUp 0.4s ease-out forwards;
    opacity: 0;
    /* Star hidden for animation */
}

.exercise-card-item:hover {
    transform: translateY(-2px) translateX(4px);
    background: linear-gradient(145deg, rgba(67, 97, 238, 0.1), rgba(15, 23, 42, 0.6));
    border-color: rgba(67, 97, 238, 0.3);
    box-shadow: none;
}

.exercise-card-item img {
    transition: transform 0.3s ease;
}

.exercise-card-item:hover img {
    transform: scale(1.05);
}

/* Routine Items (Right Side) */
.routine-item {
    background: rgba(30, 41, 59, 0.6);
    border-left: 3px solid var(--primary-color);
    animation: slideInRight 0.3s ease-out forwards;
}

.routine-item.sortable-ghost {
    opacity: 0.4;
    background: var(--primary-color);
}

.drag-handle {
    cursor: grab;
    transition: color 0.2s;
}

.drag-handle:hover {
    color: var(--primary-color) !important;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Input Fields in Routine */
.routine-item input {
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.routine-item input:focus {
    background: rgba(0, 0, 0, 0.5) !important;
    border-color: var(--success-color) !important;
    transform: scale(1.05);
}


/* --- Form & Button Polish --- */

/* Custom Input Styling for Routine Builder */
#searchExercise,
#filterMuscle,
#filterEquipment {
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    transition: all 0.3s ease;
    box-shadow: none;
}

#searchExercise:focus,
#filterMuscle:focus,
#filterEquipment:focus {
    background: rgba(15, 23, 42, 0.8) !important;
    border-color: var(--primary-color) !important;
    box-shadow: none;
    outline: none;
}

#searchExercise::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Adjust Selects */
#filterMuscle,
#filterEquipment {
    border-radius: 12px;
    height: 100%;
    /* Match height if needed */
}

/* Input Group Text (Search Icon) */
.input-group-text {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-right: none !important;
    border-radius: 50px 0 0 50px;
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Fix search input radius when in group */
#searchExercise {
    border-radius: 0 50px 50px 0;
    border-left: none !important;
}

/* Buttons Polish */
.btn-add-exercise {
    border-radius: 50%;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    box-shadow: none;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-add-exercise:hover {
    transform: scale(1.15) rotate(90deg);
}



.app-top-bar .dropdown-toggle::after {
    display: none;
}

.app-top-bar .dropdown-menu {
    border-radius: 12px !important;
    padding: 8px !important;
    min-width: 180px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.app-top-bar .dropdown-item {
    border-radius: 8px;
    transition: all 0.2s ease;
    padding: 8px 12px;
}

.app-top-bar .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: translateX(4px);
    color: #fff;
}

.app-top-bar .dropdown-item.text-danger:hover {
    background: rgba(220, 53, 69, 0.1) !important;
}

.hover-opacity:hover {
    opacity: 0.8;
}

#btnClearRoutine,
.btn-remove {
    border-color: rgba(244, 63, 94, 0.3);
    color: #f43f5e;
    border-radius: 8px;
    transition: all 0.2s ease;
}

#btnClearRoutine:hover,
.btn-remove:hover {
    background: rgba(244, 63, 94, 0.1);
    border-color: #f43f5e;
    color: #fff;
    box-shadow: none;
}

/* Muscle Tags */
.muscle-tag {
    display: inline-block;
    padding: 0.35em 0.8em;
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 50rem;
    /* Pill shape */
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.4), rgba(63, 55, 201, 0.6));
    border: 1px solid rgba(160, 190, 255, 0.2);
    box-shadow: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
    margin-bottom: 2px;
}

/* --- Dual Color Utilities --- */
.text-cyan {
    color: #00ffff !important;
    text-shadow: 0 0 5px #00ffff;
}

.text-magenta {
    color: #ff00ff !important;
    text-shadow: 0 0 5px #ff00ff;
}

.bg-cyan {
    background-color: #00ffff !important;
}

.bg-magenta {
    background-color: #ff00ff !important;
}

/* --- Premium UI Utilities (RM Calc) --- */

/* Video Player Wrapper */
#gymVideoPlayer {
    background: #000;
}

/* Upload Area Overlay */
#gymUploadArea {
    backdrop-filter: blur(5px);
    transition: opacity 0.3s ease;
}

#gymUploadArea.d-none {
    opacity: 0;
    pointer-events: none;
}

/* --- ANTIGRAVITY GYM STYLES --- */

/* Animación de giro infinito */
@keyframes spin-cw {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.refresh-spin {
    animation: spin-cw 2s linear infinite;
    font-size: 5rem;
    color: #00f2ff;
    /* Cyan Neon */
}

/* Efecto cristal oscuro */
.glass-overlay {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Tipografía */
.tracking-wide {
    letter-spacing: 3px;
}

.tracking-tight {
    letter-spacing: -1px;
}

.ls-2 {
    letter-spacing: 2px;
}

.text-neon {
    color: #00f2ff;
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.5);
}

.text-warn {
    color: #ffcc00;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

/* Animación de entrada de Toasts */
.animate-slide-in {
    animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.refresh-spin {
    animation: spin-cw 2s linear infinite;
    /* Gira infinitamente */
    font-size: 4rem;
    /* Grande */
    color: #00f2ff;
    /* Cyan futurista */
}

/* Fondo difuminado elegante */
.glass-overlay {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

/* Group Radio Button Hover Glow */
.group-hover-glow:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

.btn-check:checked+.btn-outline-light {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    box-shadow: none;
}

/* Text Shadow for HUD reading */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Gradient Backgrounds for HUD Visibility */
.bg-gradient-to-b {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
}

.bg-gradient-to-t {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
}

.backdrop-blur {
    backdrop-filter: blur(4px);
}

/* Result Box Animation */
#gymResultBox {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- AI Analyzer Overlay (Sci-Fi Scanner) --- */
.ai-status-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
    transition: opacity 0.5s ease;
}

.ai-status-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.ai-scanner-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #00f2ff;
    box-shadow: none;
    animation: scan-vertical 2s linear infinite;
    opacity: 0.8;
    z-index: 15;
}

@keyframes scan-vertical {
    0% {
        top: 0%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

.ai-pulse-text {
    animation: pulse-opacity 1.5s ease-in-out infinite;
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.5);
}

@keyframes pulse-opacity {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* --- Swimming Module Specific Styles --- */
.glass-card {
    background: rgba(40, 44, 52, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: none;
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.glass-card:hover {
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Premium Button */
.btn-premium {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    z-index: -1;
    transition: opacity 0.3s ease;
    opacity: 0;
}



.btn-premium:active {
    transform: translateY(1px);

}

.btn-premium.success {
    background: linear-gradient(135deg, #10b981, #059669);

}


.fw-mono {
    font-family: 'Courier New', Courier, monospace;
}

.active-mode-btn {
    background-color: white !important;
    color: black !important;
    box-shadow: none;
    transition: all 0.2s ease;
}

.dashed-border {
    border: 2px dashed rgba(255, 255, 255, 0.2);
}

/* Background Gradients */
.blur-3xl {
    filter: blur(64px);
}

.bg-gradient-to-r {
    background: linear-gradient(to right, var(--bs-primary), var(--bs-info));
}

/* Form Controls in Glass Cards */
.glass-card .form-control,
.glass-card .form-select {
    background-color: rgba(0, 0, 0, 0.3);
}

/* Typography Utilities */
.letter-spacing-1 {
    letter-spacing: 1px;
}

.letter-spacing-2 {
    letter-spacing: 2px;
}

.letter-spacing-3 {
    letter-spacing: 3px;
}



.glass-card .form-control:focus,
.glass-card .form-select:focus {
    background-color: rgba(0, 0, 0, 0.5);
    border-color: var(--bs-primary);
    box-shadow: none;
}

/* --- Global Floating Timer Overlay --- */
.floating-timer-overlay {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 2000;
    min-width: 180px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.25rem;
    padding: 0.75rem 1.25rem;
    box-shadow: none;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    text-decoration: none !important;
}

.floating-timer-overlay.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.floating-timer-overlay:hover {
    background: rgba(30, 41, 59, 1);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: none;
}

.floating-timer-overlay .timer-icon {
    font-size: 1.8rem;
    color: var(--primary-color);
    background: rgba(67, 97, 238, 0.1);
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-timer-overlay .timer-content {
    display: flex;
    flex-direction: column;
}

.floating-timer-overlay .timer-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
}

.floating-timer-overlay .timer-time {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.2;
}

.floating-timer-overlay .timer-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none !important;
}

.overlay-btns {
    display: flex;
    gap: 0.5rem;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.overlay-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.overlay-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.overlay-btn.btn-start:hover {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border-color: #10b981;
}

.overlay-btn.btn-stop:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: #ef4444;
}

.overlay-btn.btn-sw-lap:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border-color: #3b82f6;
}

.overlay-btn ion-icon {
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .floating-timer-overlay {
        bottom: 1.5rem;
        right: 1.5rem;
        min-width: 150px;
        padding: 0.5rem 1rem;
    }
}

/* --- Global Context Top Bar --- */
.app-top-bar {
    position: fixed;
    top: 0;
    left: 260px;
    /* Sidebar width */
    right: 0;
    height: 70px;
    z-index: 1040;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(100, 116, 139, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

@media (max-width: 991.98px) {
    .app-top-bar {
        left: 80px;
    }
}

@media (max-width: 767.98px) {
    .app-top-bar {
        left: 0;
        padding-left: 4.5rem !important;
    }
}

.client-sport-badge {
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
}

.glass-blue-btn {
    background: rgba(13, 110, 253, 0.1) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(13, 110, 253, 0.3) !important;
    color: #0dcaf0 !important;
    transition: all 0.3s ease !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    min-height: 32px !important;
    font-size: 0.85rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}

.glass-blue-btn:hover {
    background: rgba(13, 110, 253, 0.2) !important;
    border-color: rgba(13, 110, 253, 0.5) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

/* Finito Modifiers */
.form-control-finito,
.form-select-finito {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    font-size: 0.95rem !important;
    min-height: 35px !important;
    height: 35px !important;
    text-align: center !important;
    font-weight: 400 !important;
    line-height: 35px !important;
}

.input-group-finito .input-group-text {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    font-size: 0.8rem !important;
    min-height: 35px !important;
    height: 35px !important;
}

/* Card Metric Inputs */
.card-metric-input {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: white;
    font-weight: bold;
    font-family: 'JetBrains Mono', 'Roboto Mono', monospace;
    width: 60px;
    text-align: right;
    padding: 0;
    transition: all 0.3s ease;
    outline: none;
}

.card-metric-input:focus {
    border-bottom-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px 4px 0 0;
}

/* Remove spin buttons */
.card-metric-input::-webkit-outer-spin-button,
.card-metric-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.card-metric-input[type=number] {
    -moz-appearance: textfield;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE OPTIMISATION LAYER  — Mobile-first, app-wide
   Breakpoints: xs <576 / sm 576-767 / md 768-991 / lg 992+
═══════════════════════════════════════════════════════════════════ */

/* ─── 1. Touch targets ───────────────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
    /* Enlarge tap areas on touch screens */
    .btn { min-height: 42px; }
    .nav-link { min-height: 44px; }
    .form-control, .form-select { min-height: 44px; font-size: 16px; /* prevent iOS zoom */ }
    input[type="number"], input[type="email"], input[type="text"], input[type="password"] {
        font-size: 16px !important; /* prevent iOS auto-zoom */
    }
    /* Remove hover transforms that feel laggy on touch */
    .btn:hover { transform: none !important; }
    .hover-scale:hover { transform: none !important; }
    .nav-link:hover { transform: none !important; }
}

/* ─── 2. Very small screens (<480px) ────────────────────────────── */
@media (max-width: 479.98px) {
    .page-title { font-size: 1.25rem; }
    .page-header { margin-bottom: 1rem; }

    /* Glass cards: reduce padding */
    .glass-card { padding: 1rem !important; border-radius: 0.75rem !important; }

    /* Row gap reduction */
    .row.g-4 { --bs-gutter-x: 0.75rem; --bs-gutter-y: 0.75rem; }
    .row.g-3 { --bs-gutter-x: 0.5rem; --bs-gutter-y: 0.5rem; }

    /* Hide decorative elements on very small screens */
    .d-xs-none { display: none !important; }

    /* Full-width single column override */
    .col-md-6, .col-md-4, .col-lg-4, .col-lg-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Buttons: limit width to keep readable */
    .btn-sm { font-size: 0.75rem; padding: 0.35rem 0.7rem; }

    /* Glass tabs wrap */
    .glass-tabs { flex-wrap: wrap; border-radius: 12px; }
    .glass-tabs .nav-link { font-size: 0.7rem; padding: 0.4rem 0.7rem; }

    /* Top bar coach name overflow */
    #topBarCoachName { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    /* Chat modal */
    #modalGlobalChat .modal-dialog { margin: 0; max-width: 100vw; height: 100dvh; }
    #modalGlobalChat .modal-content { height: 100dvh; border-radius: 0 !important; }
    #chatInboxSidebar { width: 100% !important; min-height: 180px; max-height: 200px; }
}

/* ─── 3. Mobile (max 767px) ─────────────────────────────────────── */
@media (max-width: 767.98px) {
    /* sidebar is off-canvas: no left margin */
    .main-content { margin-left: 0 !important; padding: 64px 0.75rem 1.5rem 0.75rem; }

    /* Glass cards */
    .glass-card { padding: 1rem !important; }

    /* Overflowing tables → scroll */
    .table-responsive-force { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 500px; }

    /* Page header: stack on mobile */
    .page-header { flex-direction: column; align-items: flex-start !important; gap: 0.75rem; }
    .page-header > *:last-child { width: 100%; }

    /* Modals: fullscreen on mobile */
    .modal-dialog:not(.modal-sm):not(.modal-dialog-centered-sm) {
        margin: 0;
        max-width: 100%;
        min-height: 100dvh;
    }
    .modal-content:not(.modal-sm .modal-content) {
        border-radius: 0 !important;
        min-height: 100dvh;
    }

    /* Flex: stack action groups */
    .d-flex.gap-3.flex-row { flex-wrap: wrap; }

    /* Fix top-bar on mobile (hamburger + content) */
    .app-top-bar { left: 0 !important; padding-left: 4.5rem !important; }

    /* Cards: full width on single column */
    .col-md-6:not(.no-stack), .col-md-4:not(.no-stack), .col-md-3:not(.no-stack) {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Floating timer: smaller  */
    .floating-timer-overlay { right: 0.75rem; bottom: 0.75rem; min-width: 140px; padding: 0.5rem 0.8rem; }
    .floating-timer-overlay .timer-time { font-size: 1rem; }
    .floating-timer-overlay .timer-icon { font-size: 1.4rem; padding: 0.35rem; }

    /* Glass tabs scroll */
    .glass-tabs { overflow-x: auto; border-radius: 12px; }

    /* Upload area */
    .upload-area { padding: 2rem 1rem; }

    /* Input groups */
    .input-group-text { font-size: 0.8rem; }

    /* Stat cards in grids */
    .row-cols-2 > * { flex: 0 0 50%; max-width: 50%; }
    .row-cols-3 > *, .row-cols-4 > * { flex: 0 0 50%; max-width: 50%; }

    /* Hide extended labels in top bar */
    .topbar-label-desktop { display: none !important; }

    /* Inbox sidebar for chat: toggle hidden by default on mobile */
    #chatInboxSidebar { width: 100% !important; }
}

/* ─── 4. Tablet portrait (768–991px) ────────────────────────────── */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Sidebar collapses to icons (80px wide) */
    .main-content { margin-left: 80px; padding: 80px 1.25rem 1.5rem 1.25rem; }

    /* Top bar: offset for icon sidebar (80px) */
    .app-top-bar { left: 80px; }

    /* Glass tabs bigger tap area */
    .glass-tabs .nav-link { padding: 0.5rem 1rem; }

    /* Cards: 2-col grid */
    .col-lg-4 { flex: 0 0 50%; max-width: 50%; }
    .col-lg-3 { flex: 0 0 50%; max-width: 50%; }

    /* Modals: reasonable size */
    .modal-dialog { max-width: 600px; }
}

/* ─── 5. Desktop (≥992px) ───────────────────────────────────────── */
@media (min-width: 992px) {
    .app-top-bar { left: 260px; }
    .main-content { margin-left: 260px; padding: 90px 2rem 2rem 2rem; }
}

/* ─── 6. Modal improvements (cross-breakpoint) ──────────────────── */
.modal-content {
    background: rgba(15, 23, 42, 0.97) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
}

/* Prevent body scroll when modal open on iOS */
body.modal-open { overflow: hidden; position: fixed; width: 100%; }

/* ─── 7. Utility: safe-area insets (notch phones) ───────────────── */
@supports (padding: env(safe-area-inset-bottom)) {
    .main-content { padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }
    .app-top-bar { padding-top: env(safe-area-inset-top); height: calc(70px + env(safe-area-inset-top)); }
    .floating-timer-overlay { bottom: calc(1.5rem + env(safe-area-inset-bottom)); }
}

/* ─── 8. Print — clean layout ───────────────────────────────────── */
@media print {
    .sidebar, .app-top-bar, .btn-sidebar-toggle, .floating-timer-overlay { display: none !important; }
    .main-content { padding: 0 !important; margin: 0 !important; }
    body { background: white !important; color: black !important; }
    .glass-card { background: white !important; border: 1px solid #ddd !important; color: black !important; }
}

/* ─── 9. Scrollbar — thinner on mobile ─────────────────────────── */
@media (max-width: 767.98px) {
    ::-webkit-scrollbar { width: 4px; height: 4px; }
}

/* ─── 10. Overflow-x prevention ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { max-width: 100vw; overflow-x: hidden; }
img, video, canvas, iframe { max-width: 100%; height: auto; }

/* ─── 11. Chat modal responsive ─────────────────────────────────── */
@media (max-width: 575.98px) {
    #modalGlobalChat .modal-dialog { margin: 0; max-width: 100vw; }
    #modalGlobalChat .modal-content { height: 100dvh; height: 100vh; border-radius: 0 !important; }
    #modalGlobalChat .modal-body { flex-direction: column; }
    #chatInboxSidebar { width: 100% !important; max-height: 180px; border-right: none !important; border-bottom: 1px solid rgba(255,255,255,0.07); flex-direction: column; }
    #chatInboxSidebar .d-flex.text-center { font-size: 0.75rem; }
}

/* ─── 12. Performance: will-change for animated elements ────────── */
.sidebar, .app-top-bar, .floating-timer-overlay, .modal, .modal-dialog {
    will-change: transform;
}
.glass-card, .btn, .nav-link { will-change: auto; } /* reset on static elements */