/* ===========================================
   RESPONSIVE WORKOUT DESIGN SYSTEM - DARK EDITION
   Mobile-First Approach
   Using ONLY: Graphical White | Red | Black | Navy Blue | 50% Dark Blur Glass
   All text in Graphical White
   =========================================== */

/* CSS Variables for 5-Color System - DARKER VERSION */
:root {
    /* Primary Colors (ONLY these 5) - DARKER */
    --graphical-white: #FFFFFF;        /* Primary text color */
    --red-primary: #FF0000;            /* Brighter red for better contrast */
    --black-primary: #000000;          /* Deep backgrounds */
    --navy-blue: #000814;              /* Darker navy, almost black-blue */
    --dark-blur-glass: rgba(0, 0, 0, 0.5); /* 50% opacity glass - DARKER */
    
    /* Derived Colors (created from primary colors) - DARKER */
    --red-dark: #990000;              /* Much darker red variant */
    --red-glow: rgba(255, 0, 0, 0.4); /* Red glow effect - MORE INTENSE */
    --navy-blue-light: #001122;       /* Darker navy variant */
    --navy-blue-glow: rgba(0, 8, 20, 0.4); /* Darker navy glow effect */
    --glass-border: rgba(255, 255, 255, 0.15); /* Slightly more visible border */
    --glass-highlight: rgba(255, 255, 255, 0.08); /* Subtle highlight */
    
    /* Text Colors (ALL graphical white variations) */
    --text-primary: var(--graphical-white);
    --text-secondary: rgba(255, 255, 255, 0.9);  /* Higher contrast */
    --text-tertiary: rgba(255, 255, 255, 0.7);   /* Better readability */
    
    /* Gradients (using only the 5 colors) - DARKER */
    --gradient-red: linear-gradient(135deg, var(--red-primary), var(--red-dark));
    --gradient-navy: linear-gradient(135deg, var(--navy-blue), var(--navy-blue-light));
    --gradient-glass: linear-gradient(135deg, 
        rgba(0, 0, 0, 0.4), 
        rgba(0, 0, 0, 0.6)); /* DARKER GLASS */
    
    /* Mobile Spacing Variables */
    --mobile-padding: 1rem;
    --mobile-margin: 0.5rem;
    --mobile-gap: 0.75rem;
    
    /* Font Sizes for Mobile */
    --font-xs: 0.75rem;
    --font-sm: 0.875rem;
    --font-base: 1rem;
    --font-lg: 1.125rem;
    --font-xl: 1.25rem;
    --font-2xl: 1.5rem;
    --font-3xl: 1.875rem;
    --font-4xl: 2.25rem;
    
    /* Touch Sizes */
    --touch-min-height: 44px;
    --touch-min-width: 44px;
    
    /* Safe Area Insets for Notched Devices */
    --safe-area-inset-top: env(safe-area-inset-top, 0px);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-inset-left: env(safe-area-inset-left, 0px);
    --safe-area-inset-right: env(safe-area-inset-right, 0px);
}

/* ===========================================
   BASE MOBILE STYLES - DARK BACKGROUND
   =========================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    background: var(--black-primary); /* Full black background */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    padding: 0;
    margin: 0;
}

/* Improved touch targets */
button, 
a,
input,
select,
textarea,
.difficulty-badge,
.workout-preview-card {
    min-height: var(--touch-min-height);
    min-width: var(--touch-min-width);
}

/* ===========================================
   DAILY WORKOUT SECTION - DARKER GLASS
   =========================================== */

.daily-workout-section {
    padding: 1.5rem var(--mobile-padding);
    background: var(--dark-blur-glass); /* 50% opacity black glass */
    backdrop-filter: blur(25px) saturate(200%); /* Stronger blur */
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border-radius: 20px;
    margin: 1.5rem var(--mobile-margin);
    position: relative;
    overflow: hidden;
    max-width: 100%;
    border: 1px solid var(--glass-border);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.6), /* Darker shadow */
        inset 0 1px 0 var(--glass-highlight),
        inset 0 -1px 0 rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

/* Darker background effects */
.daily-workout-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 10% 20%, var(--red-glow) 0%, transparent 10%),
        radial-gradient(circle at 90% 80%, var(--navy-blue-glow) 0%, transparent 10%);
    opacity: 0.15; /* More subtle */
    pointer-events: none;
    z-index: 0;
    animation: floatParticles 30s ease-in-out infinite;
}

@keyframes floatParticles {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(1px, -1px); }
}

/* Darker neon pulse */
.daily-workout-section::after {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(
        45deg,
        transparent,
        var(--red-primary),
        var(--navy-blue),
        transparent
    );
    border-radius: 21px;
    z-index: -1;
    opacity: 0.1; /* More subtle */
    filter: blur(8px); /* Stronger blur */
    animation: neonPulse 6s ease-in-out infinite;
}

@keyframes neonPulse {
    0%, 100% { opacity: 0.08; }
    50% { opacity: 0.15; }
}

.daily-workout-section h2 {
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 0.75rem;
    font-size: var(--font-3xl);
    font-weight: 800;
    position: relative;
    display: inline-block;
    width: 100%;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.7),
        0 4px 12px rgba(255, 0, 0, 0.3); /* Red glow */
    line-height: 1.2;
    padding: 0 0.5rem;
}

/* Darker underline */
.daily-workout-section h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--red-primary), 
        var(--navy-blue), 
        transparent);
    border-radius: 1px;
    animation: underlineFlow 4s ease-in-out infinite;
}

@keyframes underlineFlow {
    0%, 100% { width: 120px; opacity: 0.5; }
    50% { width: 150px; opacity: 0.9; }
}

.subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: var(--font-sm);
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    padding: 0.75rem 0;
    line-height: 1.4;
}

.subtitle::before,
.subtitle::after {
    content: '◆';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--red-primary);
    font-size: 0.7rem;
}

.subtitle::before { left: 20%; }
.subtitle::after { right: 20%; }

/* ===========================================
   WORKOUT PREVIEW CARD - DARKER GLASS VERSION
   =========================================== */

.workout-preview-card {
    min-height: 110px;
    padding: 1rem;
    background: var(--gradient-glass); /* Darker glass gradient */
    backdrop-filter: blur(25px) saturate(200%); /* Stronger blur */
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border-radius: 18px;
    border: 1px solid var(--glass-border);
    margin: 1.5rem auto;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.5), /* Darker shadow */
        inset 0 1px 0 var(--glass-highlight);
    word-wrap: break-word;
    word-break: break-word;
    -webkit-tap-highlight-color: rgba(255, 0, 0, 0.3); /* Brighter tap feedback */
}

/* Darker border pulse effect */
.workout-preview-card::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 20px;
    background: linear-gradient(
        45deg,
        transparent,
        var(--red-primary),
        var(--navy-blue),
        transparent
    );
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
    filter: blur(10px); /* Stronger blur */
}

/* Darker holographic effect */
.workout-preview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 150%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1), /* More subtle */
        rgba(255, 0, 0, 0.3),     /* Brighter red */
        rgba(0, 8, 20, 0.3),      /* Darker navy */
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: skewX(-20deg);
    transition: left 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;
}

/* Desktop Hover Effects - Darker with stronger contrast */
@media (hover: hover) and (pointer: fine) {
    .workout-preview-card:hover {
        transform: translateY(-8px) scale(1.03);
        background: linear-gradient(135deg, 
            rgba(0, 0, 0, 0.6), 
            rgba(0, 0, 0, 0.7)); /* Darker on hover */
        box-shadow: 
            0 30px 80px rgba(0, 0, 0, 0.7),
            0 20px 50px var(--navy-blue-glow),
            0 0 100px rgba(255, 0, 0, 0.3), /* Stronger red glow */
            inset 0 1px 0 var(--glass-highlight);
        border-color: rgba(255, 255, 255, 0.3);
    }
    
    .workout-preview-card:hover::before {
        left: 150%;
        transition: left 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    
    .workout-preview-card:hover::after {
        opacity: 0.5;
        animation: borderPulse 2s ease-in-out infinite;
    }
    
    .workout-preview-card:hover .preview-content h3 {
        text-shadow: 
            0 0 15px rgba(255, 0, 0, 0.7), /* Stronger red glow */
            0 0 30px rgba(255, 0, 0, 0.4),
            0 2px 4px rgba(0, 0, 0, 0.7);
        transform: scale(1.05);
    }
    
    .workout-preview-card:hover .preview-content h3::before {
        animation: pulseArrow 0.6s ease-in-out infinite;
    }
    
    .workout-preview-card:hover .preview-meta {
        color: var(--text-primary);
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
    }
}

/* Mobile Touch Feedback - Darker */
.workout-preview-card:active {
    transform: translateY(-4px) scale(1.02);
    background: linear-gradient(135deg, 
        rgba(0, 0, 0, 0.5), 
        rgba(0, 0, 0, 0.65));
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(255, 0, 0, 0.4),
        inset 0 1px 0 var(--glass-highlight);
    border-color: rgba(255, 255, 255, 0.25);
    transition: all 0.2s ease;
}

.workout-preview-card:active::before {
    left: 150%;
    transition: left 0.6s ease;
}

.preview-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    padding: 0;
    position: relative;
    z-index: 1;
}

.preview-content h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: clamp(1.25rem, 4.5vw, 1.8rem);
    margin: 0 0 0.75rem 0;
    padding: 0;
    line-height: 1.2;
    text-align: center;
    flex-wrap: wrap;
    justify-content: center;
    color: var(--text-primary); /* Graphical white text */
    font-weight: 800;
    letter-spacing: -0.5px;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.8),
        0 4px 16px rgba(255, 0, 0, 0.3);
}

/* Arrow indicator - More prominent red */
.preview-content h3::before {
    content: '▶';
    color: var(--red-primary);
    font-size: 1em;
    display: inline-block;
    position: static;
    transform: none;
    animation: bounceArrow 2s ease-in-out infinite;
    text-shadow: 0 0 15px rgba(255, 0, 0, 0.6);
    transition: all 0.3s ease;
}

.preview-meta {
    font-size: clamp(0.875rem, 3.5vw, 1rem);
    color: var(--text-secondary);
    text-align: center;
    padding: 0 0.5rem;
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    position: relative;
}

.preview-meta::after {
    content: ' →';
    color: var(--red-primary);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    .workout-preview-card:hover .preview-meta::after {
        opacity: 1;
        transform: translateX(3px);
    }
}

/* ===========================================
   ANIMATIONS - DARKER THEME
   =========================================== */

@keyframes bounceArrow {
    0%, 100% { 
        transform: translateX(0);
        text-shadow: 0 0 12px rgba(255, 0, 0, 0.6);
    }
    50% { 
        transform: translateX(4px);
        text-shadow: 0 0 20px rgba(255, 0, 0, 0.9);
    }
}

@keyframes pulseArrow {
    0%, 100% { 
        transform: scale(1);
        text-shadow: 0 0 15px rgba(255, 0, 0, 0.6);
    }
    50% { 
        transform: scale(1.2);
        text-shadow: 0 0 25px rgba(255, 0, 0, 1);
    }
}

@keyframes borderPulse {
    0%, 100% { 
        opacity: 0.3;
        filter: blur(10px);
    }
    50% { 
        opacity: 0.6;
        filter: blur(8px);
    }
}

/* ===========================================
   RESPONSIVE ENHANCEMENTS
   =========================================== */

/* Small phones (up to 360px) */
@media (max-width: 360px) {
    .workout-preview-card {
        min-height: 95px;
        padding: 0.875rem;
        border-radius: 16px;
    }
    
    .preview-content h3 {
        font-size: 1.125rem;
        gap: 0.375rem;
    }
    
    .preview-content h3::before {
        font-size: 0.9em;
    }
    
    .preview-meta {
        font-size: 0.75rem;
    }
}

/* Larger phones (361px - 767px) */
@media (min-width: 361px) and (max-width: 767px) {
    .workout-preview-card {
        min-height: 105px;
    }
    
    .preview-content h3 {
        font-size: 1.375rem;
    }
    
    .preview-meta {
        font-size: 0.875rem;
    }
}

/* Tablets (768px and up) */
@media (min-width: 768px) {
    .workout-preview-card {
        min-height: 130px;
        padding: 1.5rem;
        border-radius: 20px;
    }
    
    .preview-content h3 {
        font-size: 1.6rem;
        gap: 0.75rem;
    }
    
    .preview-content h3::before {
        font-size: 1.1em;
    }
    
    .preview-meta {
        font-size: 1rem;
    }
}

/* Desktop (1024px and up) */
@media (min-width: 1024px) {
    .workout-preview-card {
        min-height: 150px;
        padding: 2rem;
        border-radius: 24px;
        max-width: 800px;
    }
    
    .preview-content h3 {
        font-size: 1.8rem;
        gap: 1rem;
    }
    
    .preview-meta {
        font-size: 1.1rem;
    }
}

/* Landscape mode optimizations */
@media (orientation: landscape) and (max-height: 600px) {
    .workout-preview-card {
        min-height: 90px;
        padding: 0.75rem;
        margin: 1rem auto;
    }
    
    .preview-content h3 {
        font-size: 1.125rem;
        margin-bottom: 0.375rem;
    }
    
    .preview-meta {
        font-size: 0.75rem;
    }
}

/* ===========================================
   ACCESSIBILITY & FOCUS STATES
   =========================================== */

.workout-preview-card:focus {
    outline: 2px solid var(--red-primary);
    outline-offset: 2px;
    box-shadow: 
        0 0 0 4px rgba(255, 0, 0, 0.3),
        0 20px 50px rgba(0, 0, 0, 0.6);
}

.workout-preview-card:focus-visible {
    outline: 3px solid var(--red-primary);
    outline-offset: 3px;
}

/* Keyboard navigation indicator */
.workout-preview-card:focus .preview-content h3::before {
    animation: pulseArrow 0.8s ease-in-out infinite;
}

/* ===========================================
   DARK BACKGROUND OPTIMIZATIONS
   =========================================== */

/* Ensure text remains highly visible on dark backgrounds */
.daily-workout-section h2,
.preview-content h3,
.preview-meta,
.subtitle {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Dark loading state */
.workout-preview-card.loading {
    cursor: wait;
}

.workout-preview-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.08),
        transparent
    );
    animation: loadingShimmer 1.5s ease-in-out infinite;
    z-index: 2;
}

@keyframes loadingShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.workout-preview-card.loading .preview-content {
    opacity: 0.8;
}

/* ===========================================
   WORKOUT CARD - MOBILE OPTIMIZED
   =========================================== */

.workout-card {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(30px) saturate(160%);
    -webkit-backdrop-filter: blur(30px) saturate(160%);
    border-radius: 22px;
    padding: 1.5rem var(--mobile-padding);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 var(--glass-highlight),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    animation: cardReveal 0.6s ease-out forwards;
    margin: 1rem 0;
}

@keyframes cardReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Simplify grid pattern on mobile */
.workout-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
    opacity: 0.2;
    pointer-events: none;
    z-index: 0;
}

.workout-header {
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.workout-header h2 {
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    font-size: var(--font-3xl);
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
    text-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.5),
        0 2px 8px rgba(255, 59, 48, 0.2);
}

.workout-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

/* ===========================================
   DIFFICULTY BADGES - TOUCH OPTIMIZED
   =========================================== */

.difficulty-badge {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: var(--font-xs);
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid transparent;
    backdrop-filter: blur(15px);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    touch-action: manipulation;
}

.difficulty-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.15), 
        rgba(255, 255, 255, 0.05));
    z-index: -1;
}

.difficulty-badge.rx {
    background: var(--gradient-red);
    border-color: var(--red-primary);
    box-shadow: 
        0 4px 15px var(--red-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.difficulty-badge.scaled {
    background: var(--gradient-navy);
    border-color: var(--navy-blue-light);
    box-shadow: 
        0 4px 15px var(--navy-blue-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.difficulty-badge.beginner {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1), 
        rgba(255, 255, 255, 0.05));
    border-color: var(--glass-border);
    color: var(--text-secondary);
}

.difficulty-badge:active {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.duration, .date {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: var(--font-xs);
    font-weight: 600;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    color: var(--text-secondary);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.duration:active, .date:active {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ===========================================
   WORKOUT SECTIONS - MOBILE LAYOUT
   =========================================== */

.workout-section {
    margin-bottom: 1.5rem;
    padding: 1.5rem var(--mobile-padding);
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(20px);
    border-radius: 18px;
    border-left: 4px solid;
    border-top: 1px solid var(--glass-border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.workout-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--glass-border), 
        transparent);
}

.workout-section:active {
    background: rgba(0, 0, 0, 0.35);
    transform: translateX(5px);
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.2),
        0 4px 20px rgba(255, 59, 48, 0.1);
}

.workout-section.warm-up {
    border-left-color: var(--navy-blue);
    box-shadow: 0 6px 25px var(--navy-blue-glow);
}

.workout-section.workout {
    border-left-color: var(--red-primary);
    box-shadow: 0 6px 25px var(--red-glow);
}

.workout-section h3 {
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    font-size: var(--font-xl);
    font-weight: 700;
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 2.5rem;
}

/* Simplified icon markers */
.workout-section h3::before {
    content: '';
    position: absolute;
    left: 0;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-sm);
    color: var(--text-primary);
}

.workout-section.warm-up h3::before {
    content: 'WU';
    background: var(--navy-blue);
    box-shadow: 0 0 15px var(--navy-blue-glow);
}

.workout-section.workout h3::before {
    content: 'W';
    background: var(--red-primary);
    box-shadow: 0 0 15px var(--red-glow);
}

/* ===========================================
   SECTION ELEMENTS - MOBILE TYPOGRAPHY
   =========================================== */

.section-rounds {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    font-size: var(--font-base);
    letter-spacing: 1px;
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 59, 48, 0.15);
    border-radius: 50px;
    border: 1px solid var(--red-primary);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    width: 100%;
    text-align: center;
}

.for-time {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    font-size: var(--font-base);
    letter-spacing: 1px;
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: rgba(0, 31, 63, 0.15);
    border-radius: 50px;
    border: 1px solid var(--navy-blue-light);
    backdrop-filter: blur(10px);
    width: 100%;
    text-align: center;
    margin: 0.5rem 0;
}

.time-cap {
    background: linear-gradient(135deg, 
        rgba(255, 59, 48, 0.2), 
        rgba(204, 0, 0, 0.2));
    color: var(--text-primary);
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: var(--font-sm);
    border: 1px solid rgba(255, 59, 48, 0.3);
    backdrop-filter: blur(10px);
    width: 100%;
    text-align: center;
}

/* ===========================================
   SECTION ITEMS - SINGLE COLUMN FOR MOBILE
   =========================================== */

.section-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.workout-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.workout-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--glass-border), 
        transparent);
}

.workout-item:active {
    background: rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.3),
        0 6px 20px rgba(255, 59, 48, 0.15);
}

.movement-name {
    font-weight: 700;
    font-size: var(--font-lg);
    margin-bottom: 1rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.measurement {
    font-size: var(--font-xl);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 1.5rem;
}

.measurement::before {
    content: '▶';
    position: absolute;
    left: 0;
    font-size: var(--font-lg);
    color: var(--red-primary);
}

/* ===========================================
   WEIGHTS & DETAILS - MOBILE STACKING
   =========================================== */

.weights {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.weight-type {
    background: rgba(0, 31, 63, 0.3);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: var(--font-xs);
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    letter-spacing: 0.5px;
    align-self: flex-start;
}

.weight-values {
    font-weight: 800;
    color: var(--text-primary);
    font-size: var(--font-lg);
    letter-spacing: 0.3px;
}

.rest-time {
    color: var(--text-tertiary);
    font-size: var(--font-sm);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    font-weight: 600;
    position: relative;
    padding-left: 1.5rem;
}

.rest-time::before {
    content: '⏱';
    position: absolute;
    left: 0;
    font-size: var(--font-base);
    opacity: 0.7;
}

.notes {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.1), 
        rgba(255, 255, 255, 0.05));
    border-left: 2px solid rgba(255, 255, 255, 0.2);
    padding: 1rem;
    font-size: var(--font-sm);
    color: var(--text-primary);
    border-radius: 0 12px 12px 0;
    backdrop-filter: blur(10px);
    margin-top: 1rem;
    line-height: 1.5;
}

/* ===========================================
   WORKOUT FOOTER - MOBILE STACKED BUTTONS
   =========================================== */

.workout-footer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.workout-footer button {
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    font-size: var(--font-base);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: var(--touch-min-height);
    touch-action: manipulation;
}

.workout-footer button:active {
    transform: translateY(-1px) scale(1.02);
}

.btn-share {
    background: var(--gradient-navy);
    box-shadow: 0 4px 20px var(--navy-blue-glow);
}

.btn-share:active {
    box-shadow: 0 8px 35px var(--navy-blue-glow);
}

.btn-refresh {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.btn-refresh:active {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 35px rgba(255, 255, 255, 0.1);
}

/* ===========================================
   ERROR & LOADING STATES - MOBILE OPTIMIZED
   =========================================== */

.workout-error, .loading-spinner {
    text-align: center;
    padding: 3rem var(--mobile-padding);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 18px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(30px);
    margin: 1.5rem var(--mobile-margin);
}

.workout-error {
    background: linear-gradient(135deg, 
        rgba(255, 59, 48, 0.1), 
        rgba(204, 0, 0, 0.05));
    border-color: rgba(255, 59, 48, 0.2);
    color: var(--text-primary);
}

.workout-error button {
    background: var(--gradient-red);
    color: var(--text-primary);
    border: 1px solid var(--red-primary);
    padding: 1rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 1.5rem;
    font-weight: 700;
    transition: all 0.2s ease;
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 20px var(--red-glow);
    width: 100%;
    min-height: var(--touch-min-height);
}

.workout-error button:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 8px 35px var(--red-glow);
}

/* ===========================================
   FULLSCREEN POPUP - MOBILE OPTIMIZED
   =========================================== */

.workout-fullscreen-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: var(--safe-area-inset-top) var(--safe-area-inset-right) 
             var(--safe-area-inset-bottom) var(--safe-area-inset-left);
}

.workout-fullscreen-popup.active {
    display: block;
    opacity: 1;
}

.popup-container {
    width: 100%;
    min-height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-radius: 0;
    border: none;
    box-shadow: none;
    overflow-y: auto;
    animation: popupElevate 0.4s ease-out forwards;
    padding-bottom: 2rem;
}

@keyframes popupElevate {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem var(--mobile-padding);
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.4) 100%
    );
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 10;
    padding-top: calc(1.5rem + var(--safe-area-inset-top));
}

.popup-header h2 {
    color: var(--text-primary);
    margin: 0;
    font-size: var(--font-2xl);
    font-weight: 800;
    letter-spacing: -0.3px;
    text-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.5),
        0 2px 8px rgba(255, 59, 48, 0.2);
    max-width: calc(100% - 60px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.close-popup-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(15px);
    font-weight: 300;
    flex-shrink: 0;
    touch-action: manipulation;
}

.close-popup-btn:active {
    background: var(--gradient-red);
    border-color: var(--red-primary);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 25px var(--red-glow);
}

.popup-content {
    padding: 1.5rem var(--mobile-padding);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

/* Simplified scrollbar for mobile */
.popup-content::-webkit-scrollbar {
    width: 6px;
}

.popup-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.popup-content::-webkit-scrollbar-thumb {
    background: var(--gradient-red);
    border-radius: 3px;
}

/* ===========================================
   ENHANCED MOBILE RESPONSIVENESS
   =========================================== */

/* Small phones (up to 360px) */
@media (max-width: 360px) {
    :root {
        --mobile-padding: 0.75rem;
        --mobile-margin: 0.25rem;
        --font-3xl: 1.625rem;
        --font-2xl: 1.25rem;
        --font-xl: 1.125rem;
    }
    
    .daily-workout-section h2 {
        font-size: var(--font-2xl);
    }
    
    .workout-header h2 {
        font-size: var(--font-2xl);
    }
    
    .preview-content h3 {
        font-size: var(--font-xl);
    }
}

/* Tablets and larger phones (min-width: 768px) */
@media (min-width: 768px) {
    :root {
        --mobile-padding: 2rem;
        --mobile-margin: 1rem;
        --mobile-gap: 1.5rem;
    }
    
    .daily-workout-section {
        max-width: 90%;
        margin: 2rem auto;
        padding: 2rem;
    }
    
    .section-items {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.5rem;
    }
    
    .workout-footer {
        flex-direction: row;
    }
    
    .workout-footer button {
        width: auto;
        flex: 1;
    }
    
    .popup-container {
        max-width: 90%;
        margin: 2rem auto;
        border-radius: 24px;
        border: 1px solid var(--glass-border);
        min-height: auto;
    }
}

/* Desktop (min-width: 1024px) */
@media (min-width: 1024px) {
    .daily-workout-section {
        max-width: 900px;
        padding: 2.5rem;
    }
    
    .popup-container {
        max-width: 1000px;
        margin: 3rem auto;
    }
    
    .popup-header {
        padding: 2rem 3rem;
    }
    
    .popup-content {
        padding: 3rem;
    }
}

/* Landscape orientation optimizations */
@media (orientation: landscape) and (max-height: 600px) {
    .daily-workout-section {
        margin: 1rem auto;
        padding: 1.5rem;
    }
    
    .daily-workout-section h2 {
        font-size: var(--font-2xl);
        margin-bottom: 0.5rem;
    }
    
    .subtitle {
        margin-bottom: 1rem;
        font-size: var(--font-xs);
    }
    
    .workout-preview-card {
        min-height: 100px;
        padding: 1rem;
        margin: 1rem auto;
    }
    
    .workout-card {
        padding: 1.5rem;
    }
    
    .workout-header {
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }
    
    .workout-section {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #FFFFFF;
        --text-secondary: #FFFFFF;
        --text-tertiary: #FFFFFF;
        --glass-border: rgba(255, 255, 255, 0.5);
    }
    
    .daily-workout-section {
        border: 2px solid var(--glass-border);
    }
    
    .workout-preview-card,
    .workout-card,
    .workout-section,
    .workout-item {
        border: 2px solid var(--glass-border);
    }
}

/* Dark mode support (already dark, but for consistency) */
@media (prefers-color-scheme: dark) {
    /* Already optimized for dark mode */
}