/* Main stylesheet for the workout tracker */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* overflow-x: scroll; */
    touch-action: manipulation;
    -webkit-touch-callout: none;
}

/* Prevent zooming on mobile devices for all interactive elements */
button, input, select, textarea, a {
    touch-action: manipulation;
    -webkit-touch-callout: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: white;
    line-height: 1.6;
    position: relative;
    display: flex;
    flex-direction: column;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/static/img/gym-bg.png');
    background-repeat: repeat;
    background-size: 400px 400px; 
    opacity: 0.05;
    z-index: 1;
    pointer-events: none;
}

.header-landing .logo {
    color: white;
    margin: 0 auto 1rem;
    display: block;
    text-align: center;
    position: relative;
    right: 20px;
}

.trust-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 16px 0;
    font-size: 14px;
    color: #4CAF50;
}

.trust-badges span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stats-bar {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin: 1rem auto 2rem;
    font-size: 1rem;
    opacity: 0.9;
    flex-wrap: wrap;
    /* white-space: nowrap; */
}

.stats-bar span {
    white-space: nowrap;
}

.header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    padding: 1rem 0 0;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #4a5568;
    padding: 8px 16px 8px;
    position: relative;
    right: 20px;
}

.logo-link {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.logo-link:hover {
    opacity: 0.8;
    text-decoration: none;
}

.logo-image {
    height: 4.5rem;
    width: auto;
    vertical-align: middle;
    position: relative;
    left: 20px;
}

.yaki-image {
    height: 2rem;
    width: auto;
    vertical-align: middle;
    margin-right: 0.25rem;
}

.nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x mandatory;
    padding: 0.5rem;
}

/* User Welcome Banner (inside header) */
.user-welcome-banner {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    padding: 0.5rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 1rem;
}

.user-welcome-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #333;
    font-size: 0.9rem;
    font-weight: 500;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.user-welcome-text {
    color: #666;
    font-size: .6rem;
}

.user-id-display {
    color: #007bff;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* Mobile marquee for user-id-display (< 576px) */
@media (max-width: 575px) {
    .user-welcome-content {
        overflow: hidden;
        position: relative;
        align-items: center;
    }

    .user-welcome-content > div:first-child {
        overflow: hidden;
        flex: 1;
        min-width: 0;
        max-width: calc(100vw - 8rem);
        display: flex;
        align-items: center;
        width: calc(100vw - 8rem);
    }

    .user-id-display {
        overflow: hidden;
        white-space: nowrap;
        position: relative;
        display: block;
        width: 100%;
        max-width: 100%;
        text-overflow: clip;
    }

    /* Only animate if content overflows (marquee-active class) */
    .user-id-display.marquee-active {
        overflow: hidden;
        display: flex;
        white-space: nowrap;
    }

    .user-id-display.marquee-active > * {
        display: inline-block;
        flex-shrink: 0;
        animation: scroll-marquee var(--marquee-duration, 20s) linear infinite;
        will-change: transform;
    }

    /* Ensure duplicate is positioned right after original with spacing */
    .user-id-display.marquee-active .marquee-duplicate {
        margin-left: 3rem; /* Space between original and duplicate for seamless loop */
    }

    /* Pause animation on hover/touch for better UX */
    .user-id-display.marquee-active:hover > *,
    .user-id-display.marquee-active:active > * {
        animation-play-state: paused;
    }

    /* No animation if content doesn't overflow */
    .user-id-display:not(.marquee-active) > * {
        animation: none;
    }
}

/* Desktop: no marquee, keep existing behavior */
@media (min-width: 576px) {
    .user-id-display {
        overflow: visible;
        white-space: normal;
        width: auto;
        max-width: none;
    }

    .user-id-display > * {
        animation: none;
    }
}

@keyframes scroll-marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-100% - 3rem));
    }
}

.user-id-display a {
    color: #007bff;
    text-decoration: underline;
    transition: color 0.2s ease;
    background: rgba(0, 123, 255, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    border: 1px solid rgba(0, 123, 255, 0.2);
}

.user-id-display a:hover {
    color: #dc2626;
    opacity: .5;
}

.nav-btn {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 8px;
    background: #4299e1;
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer;
    flex-shrink: 0;
    scroll-snap-align: start;
    min-height: 2.2rem;
    max-height: 2.5rem;
}

.nav-btn:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

.nav-btn.active {
    background: #2b6cb0;
}

.logout-btn {
    background: #8c95a7 !important;
    color: white !important;
    padding: 0.75rem 1.25rem !important;
    height: 2.5rem !important;
    display: inline-flex !important;
    align-items: center !important;
    /* border: 1px solid #6b7280 !important; */
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    text-decoration: none !important;
    flex-shrink: 0 !important;
    scroll-snap-align: start !important;
}

.logout-btn:hover {
    background: #69768a !important;
}

.nav::-webkit-scrollbar {
    display: none;
}

.online-badge {
    font-size: 0.75rem;
    margin-left: 0.5rem;
    opacity: 0.8;
}

.login.container {
  max-width: 1200px;
  padding: 1.25rem !important;
  margin: 0 auto;
}

.main .container {
    max-width: 1200px;
    padding: 1.5rem 0;
    flex: 1;
    margin: 0 auto;
    font-size: .8rem;
    line-height: 1rem;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page h2 {
    color: white;
    font-size: 2rem;
    font-weight: 700;
    margin: .5rem 0 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.workout-controls {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 12px;
    margin: 2.25rem auto 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    display: flex;
    column-gap: 1rem;
    row-gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    max-width: 1200px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.control-group label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.875rem;
}

.control-group select {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.2s;
    min-width: 200px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='roavund'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.control-group select:focus {
    outline: none;
    border-color: #4299e1;
}

.workout-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    max-width: 1200px;
    margin: 0 auto;
}

/* Main container base styles */
.main-container {
    margin-bottom: 2rem !important;
}

/* Exercise database specific container - wider for better grid display */
#exercise-db-page .main-container, #progress-page .main-container, #import-export-page .main-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header container */
.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* .nav consolidated above */

/* Exercise database container */
.exercise-database-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.original-exercise .exercise-card {
    padding: 1rem;
} 

.progress-grid-flex {
    flex-wrap: nowrap;
    display: flex;
    gap: .5rem;
    justify-content: flex-start;
    align-items: stretch;
}

/* .original-exercise .exercise-card.current-selection {
  border-color: #10b981;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
} */

/* Responsive breakpoints for containers */
@media (max-width: 1200px) {
    .main-container,
    .header-content,
    .nav {
        max-width: 100%;
        padding: 0 1.25rem;
    }
    
    #exercise-db-page .main-container, #progress-page .main-container, #import-export-page .main-container {
        max-width: 100%;
        padding: 0 1.25rem;
    }
    
    .workout-content {
        overflow-x: hidden;
        width: 100%;
        box-sizing: border-box;
    }
    
    .exercise-card {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin: 0 0 1rem 0;
        flex-wrap: wrap;
    }
    
    .exercise-content {
        max-width: 100%;
        overflow-x: auto;
        box-sizing: border-box;
        padding: 1rem;
    }

    .user-welcome-banner  {
      margin-top: 1.5rem;
    }
}

@media (max-width: 768px) {
    .main-container,
    .header-content,
    .nav {
        padding: 0 1.25rem;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    #exercise-db-page .main-container, #progress-page .main-container, #import-export-page .main-container {
        padding: 0 1.25rem;
    }
    
    .exercise-database-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .user-welcome-banner  {
      margin-top: .5rem;
    }
}

@media (max-width: 480px) {
    .main-container,
    .header-content,
    .nav {
        padding: 0 1.25rem;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    #exercise-db-page .main-container, #progress-page .main-container, #import-export-page .main-container {
        padding: 0 1.25rem;
    }
    
    .exercise-database-grid {
        grid-template-columns: 1fr;
    }

    .set-inputs {
        flex-direction: column;
        /* margin-top: 0.5rem; */
    }
}

.exercise-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.exercise-card:not(:last-child) {
    margin-bottom: 1rem;
}

.exercise-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.exercise-card.collapsed .exercise-content {
    display: none;
    visibility: hidden;
    height: 0px;
    overflow: hidden;
}

/* Disable all interactive elements on completed exercises EXCEPT complete/incomplete button */
.exercise-card.completed button:not(.btn-complete),
.exercise-card.completed input[type="number"],
.exercise-card.completed input[type="text"],
.exercise-card.completed select {
    opacity: 0.5 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
}

.exercise-card.completed .exercise-actions {
    opacity: 0.6;
}

.exercise-card.completed .set-inputs {
    opacity: 0.6;
}

/* Floating Global Rest Timer */
.floating-timer {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: none;
    background: url('/static/img/gym-bg.png');
    background-size: 300px 300px;
    background-position: center;
    background-repeat: repeat;
    backdrop-filter: blur(15px);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    color: white;
    min-width: 200px;
    max-width: 80vw;
    animation: slideUpIn 0.3s ease-out;
}

.floating-timer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.85) 0%, rgba(118, 75, 162, 0.85) 100%);
    border-radius: 8px;
    pointer-events: none;
}

.floating-timer-content {
    padding: 10px 16px;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    position: relative;
    z-index: 1;
}

.floating-timer-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2px;
}

.floating-timer-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
}

.floating-timer-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.floating-timer-display {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 2px 0;
    min-height: 16px;
    min-width: 60px;
    text-align: center;
}

.floating-timer-display.active {
    color: #ffd700;
}

.floating-timer-display.ready {
    color: #90EE90;
}

.floating-timer-stop {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.floating-timer-stop:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

@keyframes slideUpIn {
    from {
        opacity: 0;
        transform: translateX(-50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}

/* Disable exercise timers when global timer is active */
.timer-disabled .rest-timer {
    opacity: 0.4;
    pointer-events: none;
}

.timer-disabled .timer-presets button {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Mobile optimizations for floating timer */
@media (max-width: 768px) {
    .floating-timer {
        bottom: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        min-width: auto;
        max-width: none;
    }
    
    .floating-timer-content {
        padding: 8px 12px;
    }
    
    .floating-timer-display {
        font-size: 1rem;
    }
    
    .floating-timer-title {
        font-size: 0.75rem;
    }
    
    .floating-timer-controls {
        gap: 6px;
    }
    
    .floating-timer-stop {
        padding: 2px 6px;
        font-size: 0.65rem;
    }
}

.exercise-header {
    padding: .8rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.exercise-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.exercise-name-main {
    font-size: 1rem;
    font-weight: 600;
}

.exercise-name-modification {
    font-size: 0.85rem;
    font-weight: 500;
    color: #FFFFFF;
    font-style: italic;
    margin-top: 0.2rem;
}

.exercise-modification {
    font-size: 0.9em;
    font-weight: 500;
    color: #FFD700;
    font-style: italic;
    margin-left: 0.3rem;
}

.completion-status {
    font-size: 1.25rem;
    margin-left: auto;
    margin-right: 0.5rem;
    min-width: 1.5rem;
    text-align: center;
}

.expand-icon {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.exercise-content {
    padding: 1rem;
}

.exercise-actions {
    display: flex;
    gap: .5rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.substitute-btn, .tutorial-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.substitute-btn {
    background: #f6ad55;
    color: white;
}

.substitute-btn:hover {
    background: #ed8936;
    transform: translateY(-1px);
}

.tutorial-btn {
    background: #4299e1;
    color: white;
}

.tutorial-btn:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

.weight-unit-toggle-btn {
    background: #e5e7eb;
    color: #374151;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.rest-timer-btn {
    background: linear-gradient(135deg, #a78bfa 0%, #c4b5fd 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.weight-unit-toggle-btn:hover {
    background: #d1d5db;
    transform: translateY(-1px);
}

.rest-timer-btn:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    transform: translateY(-1px);
}

.exercise-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: .5rem;
    margin-bottom: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

/* Suggested weight styling */
.stat-value[id^="suggested-weight-"] {
    font-weight: 600;
    transition: all 0.2s ease;
}

.stat-value[id^="suggested-weight-"]:hover {
    transform: scale(1.05);
}

/* Clear suggested weight button styling */
.btn-clear-suggested {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: .6rem;
    line-height: .8rem;
    font-weight: bold;
    cursor: pointer;
    margin-left: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-clear-suggested:hover {
    background: #c82333;
    transform: scale(1.1);
}

.input-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

/* Workout completion button */
.workout-completion-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.btn.btn-finish-workout {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    padding: 1rem 1.5rem;
    font-size: .9rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    align-self: flex-end;
    margin-left: auto;
    min-width: 200px;
}

.btn-finish-workout::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 25px;
    pointer-events: none;
}

.btn.btn-finish-workout:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%) !important;
}

.btn-finish-workout:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Skip workout button */
.btn-skip-workout {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: #374151;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
    position: relative;
    overflow: hidden;
    min-width: 180px;
}

.btn-skip-workout::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 25px;
    pointer-events: none;
}

.btn-skip-workout:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.4);
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
}

.btn-skip-workout:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
}

/* Disabled finish workout button */
.btn.btn-finish-workout.btn-disabled {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.btn.btn-finish-workout.btn-disabled:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* Responsive behavior for workout completion buttons */
@media (max-width: 768px) {
    .workout-completion-section {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn-finish-workout,
    .btn-skip-workout {
        width: 100%;
        margin-left: 0;
        align-self: center;
    }
}

/* Workout completion modal */
.workout-completion-modal {
    max-width: 600px;
    margin: 0 auto;
}

.completion-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.completion-header h2 {
    color: #10b981;
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.completion-header p {
    color: #6b7280;
    font-size: 1.1rem;
}

.completion-metrics {
    margin-bottom: 2rem;
}

.metric-section {
    margin-bottom: 2rem;
}

.metric-section h3 {
    color: #374151;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-left: 4px solid #10b981;
    padding-left: 0.5rem;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.metric-item {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.metric-label {
    font-size: 0.9rem;
    color: #6b7280;
    /* margin-bottom: 0.5rem; */
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.metric-change {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.metric-change.positive {
    color: #059669;
    background: #d1fae5;
}

.metric-change.negative {
    color: #dc2626;
    background: #fee2e2;
}

.progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.progress-item {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.progress-label {
    font-size: 0.8rem;
    color: #0369a1;
    margin-bottom: 0.25rem;
    line-height: 1rem;
}

.progress-value {
    font-size: .9rem;
    font-weight: 700;
    color: #0c4a6e;
}

.completion-actions {
    text-align: center;
    padding-top: 1rem;
    border-top: 2px solid #e2e8f0;
}

.btn-exit {
    background: #6b7280;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-exit:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

/* .input-group consolidated above */

.input-group input {
    flex: 1;
}

/* Clear target weight button */
.btn-clear {
    background: #d1d5db;
    color: white;
    border: none;
    border-radius: 4px;
    width: 28px;
    height: 31px;
    font-size: 0.6rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-clear:hover {
    background: #9ca3af;
    color: white;
}

/* Skip workout modal */
.skip-workout-modal {
    max-width: 500px;
    margin: 0 auto;
}

.skip-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.skip-header h2 {
    color: #6b7280;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.skip-header p {
    color: #6b7280;
    font-size: 1rem;
}

.skip-info {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.skip-info p {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
}

.skip-info ul {
    margin: 0;
    padding-left: 1.5rem;
    color: #6b7280;
}

.skip-info li {
    margin-bottom: 0.25rem;
}

.skip-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding-top: 1rem;
    border-top: 2px solid #e2e8f0;
}

.skip-actions .btn {
    min-width: 120px;
}

/* Workout history styling */
.workout-history-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.workout-history-section h3 {
    color: #374151;
    margin-bottom: .5rem;
    font-size: 1.3rem;
    border-left: 4px solid #10b981;
    padding-left: 0.5rem;
}

.workout-history-table-container {
    overflow-x: auto;
    margin-bottom: 1rem;
}

.workout-history-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.workout-history-table th {
    background: #f8fafc;
    color: #374151;
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
    line-height: 1rem;
    font-size: .9rem;
}

.workout-history-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    color: #374151;
    font-size: .7rem;
    line-height: .8rem;
}

.workout-history-table tbody tr:hover {
    background: #f8fafc;
}

/* Last workout summary styling */
.last-workout {
    margin-top: 1rem;
    /* padding-top: 1rem;
    border-top: 1px solid #e2e8f0; */
}

.last-workout h4 {
    color: #374151;
    font-size: 0.9rem;
    font-weight: 600;
    /* margin: 0 0 0.5rem 0; */
}

.last-workout p {
    color: #6b7280;
    font-size: 0.85rem;
    margin: 0;
}

.workout-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.workout-date {
    font-weight: 600;
    color: #1f2937;
    font-size: 1rem;
}

.workout-type {
    color: #6b7280;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.workout-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

@media (max-width: 599px) {
    .workout-metrics {
        grid-template-columns: 1fr;
    }
}

.workout-metrics .metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
}

.metric-label {
    /* color: #6b7280; */
    font-weight: 600;
}

.metric-value {
    font-size: 1.25rem;
    color: #1f2937;
    font-weight: 600;
}

.no-history {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 2rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 2px dashed #d1d5db;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.pagination button {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-1px);
}

.pagination button:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

.page-info {
    color: #6b7280;
    font-weight: 500;
}

/* Import note styling */
.import-note {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    font-style: italic;
    background: #f0f9ff;
    padding: 0.5rem;
    border-radius: 4px;
    border-left: 3px solid #0ea5e9;
}

/* Export note styling */
.export-note {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    font-style: italic;
    background: #f0fdf4;
    padding: 0.5rem;
    border-radius: 4px;
    border-left: 3px solid #10b981;
}

.stat-label {
    font-size: 0.7rem;
    color: #718096;
}

.stat-value {
    font-size: .8rem !important;
    font-weight: 600 !important;
    color: #2d3748 !important;
    line-height: 1rem !important;
}

/* Info icon styling */
.info-icon {
    display: inline-block;
    margin-left: 0.1rem;
    cursor: pointer;
    font-size: 0.5rem;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    position: relative;
}

.info-icon:hover {
    opacity: 1;
}

/* Info icon clickable styling */
.info-icon {
    cursor: pointer;
    transition: all 0.2s ease;
}

.info-icon:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

.exercise-notes {
    background: #edf2f7;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-style: italic;
    color: #4a5568;
    line-height: 1rem;
    font-size: .8rem;
}

/* Clean, Minimal Workout Interface - Avoiding Cluttered Design */
.calculator-section, .sets-section {
    /* margin-bottom: 1.5rem; */
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

/* Accordion styling for calculator and rest timer */
.accordion-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
    background: #f1f5f9;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
    background: #e2e8f0;
}

.accordion-header:hover {
    background: #cbd5e1;
}

.accordion-icon {
    font-size: 0.75rem;
    color: #64748b;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.accordion-content {
    padding: 1rem;
    display: none;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.sets-header {
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: .5rem;
}

.sets-header .btn-add-set {
    padding: 6px 12px;
    font-size: 0.6rem;
    height: auto;
    min-height: 30px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.sets-header .btn-add-set svg {
    width: 14px;
    height: 14px;
}

.weight-unit-toggle {
    display: flex;
    gap: 4px;
    justify-content: flex-start;
    flex-shrink: 0;
}

.unit-btn {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 31px;
}

.unit-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.unit-btn:hover:not(.active) {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.section-title {
    font-size: .8rem;
    font-weight: 500;
    color: #64748b;
    /* margin: 1rem 0 .25rem; */
    text-transform: none;
    letter-spacing: 0;
    line-height: .8rem;
}

.calculator-grid {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin: .5rem 0;
    min-width: 0;
    overflow: hidden;
}

.calculator-grid input {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Status icon for authenticated homepage */
.status-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    text-align: center;
}

.status-text {
    color: #64748b;
    margin-bottom: 1.5rem;
    text-align: center;
}

.logout-section {
    margin-top: 1rem;
    text-align: center;
}

.logout-btn {
    background: #6b7280;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s ease;
}

.logout-btn:hover {
    background: #4b5563;
}

/* .input-group consolidated above */

.input-group label {
    font-weight: 400;
    color: #64748b;
    font-size: 0.875rem;
    text-transform: none;
    letter-spacing: 0;
}

.input-group input {
    padding: 6px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    width: 100%;
    max-width: 200px;
    min-width: 120px;
    background: #ffffff;
    transition: all 0.2s ease;
    color: #111827;
    height: 32px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    text-align: right; /* Right-align numbers like number inputs */
}

.input-group input:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.input-group input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.input-group input::placeholder {
    color: #9ca3af;
    font-weight: 400;
    font-size: 16px;
}

.input-group input::-webkit-outer-spin-button,
.input-group input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

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

.btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: white;
    color: #64748b;
    height: 2.5rem;
    /* Prevent zooming on mobile devices */
    touch-action: manipulation;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.btn:hover {
    background: #f8fafc;
    border-color: #cbd5e0;
    transform: none;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.btn-secondary {
    background: #6b7280;
    color: white;
    border-color: #6b7280;
}

.btn-secondary:hover {
    background: #4b5563;
    border-color: #4b5563;
}

.btn-danger {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    transform: translateY(-1px);
}

.btn-warning {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

.btn-warning:hover {
    background: #d97706;
    border-color: #d97706;
    transform: translateY(-1px);
}

.btn-complete {
    background: #48bb78;
    color: white;
}

.btn-complete:hover {
    background: #38a169;
    transform: translateY(-1px);
}

.btn-incomplete {
    background: #f56565;
    color: white;
}

.btn-incomplete:hover {
    background: #e53e3e;
    transform: translateY(-1px);
}

.btn-calculate {
    background: #9f7aea;
    color: white;
    padding: 6px 12px;
    font-size: .6rem;
    /* font-weight: 600; */
    height: 32px;
    border-radius: 6px;
    border: 2px solid #9f7aea;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-calculate:hover {
    background: #805ad5;
    border-color: #805ad5;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-add-set {
    background: #10b981;
    color: white;
    border: 1px solid #10b981;
    /* margin-bottom: 1.5rem; */
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-add-set:hover {
    background: #059669;
    border-color: #059669;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-add-set:active {
    transform: translateY(0);
}

.sets-container {
    margin: .5rem 0;
}

.previous-week-message {
    background-color: rgba(100, 149, 237, 0.15);
    border-left: 3px solid #6495ed;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #6495ed;
}

.previous-week-text {
    display: block;
    font-weight: 500;
}

.set-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.15s ease;
    min-height: 48px;
}

.set-item:hover {
    background: #f1f3f4;
    border-color: #dee2e6;
}

/* Warmup set styling */
.set-item-warmup {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-left: 4px solid #f59e0b;
}

.set-item-warmup .set-number {
    color: #92400e;
    font-weight: 600;
}

/* Working set styling */
.set-item-working {
    background: #d1fae5;
    border: 1px solid #10b981;
    border-left: 4px solid #10b981;
}

.set-item-working .set-number {
    color: #065f46;
    font-weight: 600;
}

.set-number {
    font-weight: 600;
    color: #374151;
    min-width: 60px;
    font-size: .6rem;
    background: #f3f4f6;
    padding: 6px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #e5e7eb;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    line-height: .7rem;
}

.set-inputs input {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  max-width: 3.5rem;
}

.set-inputs {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    flex: 1;
    align-items: center;
}

.set-input {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 100px;
    background: #ffffff;
    color: #111827;
    height: 48px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.set-input:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.set-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.set-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
    font-size: 16px;
}

.set-input::-webkit-outer-spin-button,
.set-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

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


.btn-remove-set {
    background: #fef2f2;
    color: #dc2626;
    border: 2px solid #fecaca;
    border-radius: 8px;
    width: 40px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-remove-set:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-remove-set:active {
    background: #fecaca;
    transform: scale(0.98);
}

/* Warmup Results Styles */
.warmup-results {
    margin-top: 1rem;
    padding: .5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.warmup-results h4 {
    margin: 0 0 .4rem 0;
    color: #64748b;
    font-size: .8rem;
    font-weight: 500;
}

.warmup-target-row, .warmup-set-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.warmup-target-row:hover, .warmup-set-row:hover {
    border-color: #d1d5db;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.warmup-target-weight, .warmup-set-weight, .warmup-set-info {
    font-weight: 500;
    color: #374151;
    flex: 1;
}

.warmup-target-reps, .warmup-set-reps, .warmup-reps {
    color: #6b7280;
    font-size: 0.875rem;
    min-width: 100px;
    text-align: center;
    margin-right: 1rem;
}

.btn-add-warmup {
    background: #10b981;
    color: white;
    border: 1px solid #10b981;
    border-radius: 4px;
    width: auto;
    /* min-width: 80px; */
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: .6rem;
    flex-shrink: 0;
    padding: 0 8px;
    white-space: nowrap;
}

.btn-add-warmup:hover {
    background: #059669;
    border-color: #059669;
    transform: scale(1.05);
}

.btn-add-warmup:active {
    transform: scale(0.95);
}

.btn-add-warmup.btn-disabled {
    background: #9ca3af;
    border-color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-add-warmup.btn-disabled:hover {
    background: #9ca3af;
    border-color: #9ca3af;
    transform: none;
}

/* Number Pad Styles */
.number-pad {
    position: relative;
    background: white;
    overflow-y: auto;
    box-sizing: border-box;
}

.number-pad-display {
    text-align: center;
    margin-bottom: 1rem;
}

.current-input-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.current-input-value {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.number-pad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.number-btn {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.number-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.number-btn:active {
    background: #e2e8f0;
    transform: scale(0.95);
}

.number-pad-actions {
    display: flex;
    gap: 0.5rem;
}

.number-pad-actions .btn {
    flex: 1;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Hide set type options when number pad is shown */
.set-type-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.set-type-options.hidden {
    display: none;
}

/* Hide decimal button for reps input */
.decimal-btn.hidden {
    display: none;
}

/* Hide modal actions when number pad is shown */
.modal-actions.hidden {
    display: none;
}

/* Calculator number pad display styling - match add/edit set modal styling exactly */
.calculator-number-pad-display {
    text-align: center;
    margin-bottom: 1rem;
}

.calculator-current-input-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.calculator-current-input-value {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal actions styling - consistent across all modals */
.modal-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding-top: 1rem;
    margin-top: 1rem;
}

.modal-actions .btn {
    flex: none;
    min-width: 100px;
}

/* Add set modal styling */
.add-set-modal {
    margin: 0 auto;
}

.set-type-header {
    text-align: center;
    margin-bottom: 1rem;
}

.set-type-header h3 {
    color: #374151;
    font-size: 1.2rem;
    font-weight: 600;
}

.set-type-header p {
    margin: 0;
    color: #6b7280;
    font-size: 0.85rem;
}

.set-type-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 599px) {
    .set-type-options {
        grid-template-columns: 1fr;
    }
}

.btn-set-type {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    height: 100%;
    justify-content: center;
}

.btn-warmup:hover, .btn-working:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-warmup {
    border-color: #f59e0b;
}

.btn-warmup:hover {
    border-color: #d97706;
    background: #fef3c7;
}

.btn-warmup.active {
    border-color: #d97706;
    background: #fef3c7;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.btn-working {
    border-color: #10b981;
}

.btn-working:hover {
    border-color: #059669;
    background: #d1fae5;
}

.btn-working.active {
    border-color: #059669;
    background: #d1fae5;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.set-type-icon {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.set-type-label {
    font-weight: 600;
    font-size: .8rem;
    margin-bottom: 0.5rem;
    color: #374151;
}

.set-type-desc {
    font-size: 0.6rem;
    color: #6b7280;
    line-height: 1rem;
}

.set-details {
    margin-bottom: 1rem;
}

.add-set-modal .set-inputs {
    justify-content: center;
}

.set-inputs .input-group {
    display: flex;
    flex-direction: column;
    scale: 0.8;
}

/* Mobile: stack weight/reps inputs vertically */
@media (max-width: 600px) {
    .set-inputs {
        flex-direction: row;
    }
}

.set-inputs label {
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

.set-inputs input {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.set-inputs input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}


/* Add set modal cancel button should be gray */
.add-set-modal .modal-actions .btn-secondary {
    background: #6b7280;
    color: white;
    border: 1px solid #6b7280;
}

.add-set-modal .modal-actions .btn-secondary:hover {
    background: #4b5563;
    border-color: #4b5563;
}

/* Input with increment/decrement buttons */
.input-with-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.input-with-buttons input {
    width: 50% !important;
    height: 60px !important;
    padding: 0.6rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    background: #f9fafb;
    text-align: center;
    box-sizing: border-box;
    min-width: unset;
    max-width: none;
}

.input-with-buttons input:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.btn-increment {
    width: 50%;
    height: 40px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    color: #374151;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-increment:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.btn-increment:active {
    background: #e5e7eb;
}

/* Mobile responsiveness for progress cards */
@media (max-width: 768px) {
    .progress-card {
        min-height: 100px;
        padding: 1rem;
    }
    
    .progress-card h4 {
        font-size: 0.6rem;
        margin-bottom: 0.4rem;
    }
    
    .progress-value {
        /* font-size: 1.2rem; */
    }
}

/* Mobile responsiveness for add set modal */
@media (max-width: 768px) {
    .add-set-modal {
    }
    
    .set-type-header {
        margin-bottom: 1rem;
    }
    
    .set-type-header h3 {
        font-size: 1.1rem;
    }
    
    .set-type-header p {
        font-size: 0.8rem;
    }
    
    .set-type-options {
        gap: 0.8rem;
    }
    
    .btn-set-type {
        padding: 1rem 0.8rem;
    }
    
    .set-type-icon {
        margin-bottom: 0.5rem;
    }
    
    .set-type-label {
        margin-bottom: 0.3rem;
    }
    
    .set-type-desc {
        font-size: 0.8rem;
        line-height: 1.2;
    }
    
    .set-inputs {
        gap: 0.8rem;
    }
    
    .input-with-buttons {
        gap: 0.2rem;
    }
    
    .input-with-buttons input {
        padding: 0.6rem;
        font-size: 0.9rem;
    }
    
    .btn-increment {
        width: 50%;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .modal-actions {
        gap: 0.8rem;
    }
    
    .modal-actions .btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* Extra small devices (below 480px) */
@media (max-width: 480px) {
    .add-set-modal {
    }
    
    .set-type-header h3 {
        font-size: 1rem;
    }
    
    .set-type-header p {
        font-size: 0.75rem;
    }
    
    .set-type-options {
        gap: 0.5rem;
    }
    
    .btn-set-type {
        padding: 0.8rem 0.6rem;
    }
    
    .set-type-icon {
        font-size: .8rem;
        margin-bottom: 0.3rem;
    }
    
    .set-type-label {
        margin-bottom: 0.2rem;
    }
    
    .set-type-desc {
        font-size: 0.75rem;
        line-height: 1.1;
    }
    
    .set-inputs {
        gap: 0.5rem;
        flex-direction: row;
    }
    
    .set-inputs .input-group {
        flex: 1;
    }
    
    .input-with-buttons {
        gap: 0.15rem;
    }
    
    .input-with-buttons input {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    
    .btn-increment {
        width: 50%;
        height: 45px;
        font-size: 1rem;
    }
    
    .modal-actions {
        gap: 0.5rem;
    }
    
    .modal-actions .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
}

.rest-timer {
    background: transparent;
    padding: 0;
    border: none;
    text-align: center;
    margin-top: 1rem;
}

.rest-timer.accordion-item {
    border: 1px solid #c4b5fd;
    border-radius: 8px;
    background: #f3e8ff;
}

.rest-timer .accordion-header {
    background: linear-gradient(135deg, #a78bfa 0%, #c4b5fd 100%);
    color: white;
}

.rest-timer .accordion-header:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
}

.rest-timer .accordion-header * {
    color: white !important;
}

.rest-timer .accordion-icon {
    color: white;
}

.rest-timer .accordion-content {
    text-align: center;
    background: #faf5ff;
}

.rest-status {
    font-weight: 500;
    color: #64748b;
    margin-bottom: 0;
    font-size: 0.875rem;
}

.rest-recommended {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 400;
}

.timer-presets {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.timer-btn {
    padding: 0.375rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: white;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.875rem;
}

.timer-btn:hover, .timer-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.btn-stop {
    background: #dc2626;
    color: white;
    border: 1px solid #dc2626;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-stop:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    transform: translateY(-1px);
}

.timer-display {
    font-size: 1.25rem;
    font-weight: 500;
    color: #1e293b;
}

.timer-display.active {
    color: #3b82f6;
}

.timer-display.ready {
    color: #10b981;
}

.exercise-actions-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.exercise-actions-left {
    display: flex;
    gap: 0.5rem;
}

.no-workout {
    text-align: center;
    padding: 3rem;
    color: #718096;
}

.no-workout h3 {
    margin-bottom: 1rem;
    color: #4a5568;
}


.status-message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
    border: 2px solid transparent;
    animation: slideIn 0.3s ease-out;
}

.status-message.success {
    background: #c6f6d5;
    color: #22543d;
    border-color: #68d391;
    box-shadow: 0 2px 8px rgba(104, 211, 145, 0.2);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.status-message.error {
    background: #fed7d7;
    color: #c53030;
}

.status-message.info {
    background: #bee3f8;
    color: #2a4365;
}

.progress-dashboard {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow-x: scroll;
    width: 100%;
}

/* Info icon styling for progress stats */
.info-icon {
    cursor: pointer;
    margin-left: 0.1rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.info-icon:hover {
    opacity: 1;
}

/* Progress info modal styling */
.progress-info-modal {
    max-width: 500px;
}

.progress-info-modal h3 {
    color: #374151;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.progress-info-modal .info-content {
    line-height: 1.6;
}

.progress-info-modal .info-content p {
    margin-bottom: 0.8rem;
    color: #4b5563;
}

.progress-info-modal .info-content ul {
    margin: 0.5rem 0 0.8rem 1.5rem;
    color: #4b5563;
}

.progress-info-modal .info-content li {
    margin-bottom: 0.3rem;
}

.progress-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    flex: 1;
    /* min-width: 200px; */
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 120px;
}

.progress-card h4 {
    color: #718096;
    margin-bottom: 0.5rem;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: .875rem;
}

.progress-value {
    font-weight: 700;
    color: #2d3748;
    line-height: 1rem;
    text-wrap-mode: nowrap;
}

.exercise-db-content {
  color: #FFFFFF;
}

.exercise-db-controls {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    flex: 1;
}

.exercise-db-controls input {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.2s;
}

.exercise-db-controls select {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.exercise-db-controls input:focus,
.exercise-db-controls select:focus {
    outline: none;
    border-color: #4299e1;
}

.exercise-counter {
    background: #f3f4f6;
    color: #6b7280;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-left: auto;
    white-space: nowrap;
}


/* Ensure minimum height for pages with little content */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: #6b7280;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #3b82f6;
}

.footer-text {
    color: #9ca3af;
    font-size: 0.875rem;
}

.footer-text p {
    margin: 0;
}

/* Mobile footer */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .footer-links {
        gap: 1.5rem;
    }
}

.data-management {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.import-section, .export-section, .ai-upload-section {
    padding: 1rem;
    background: #f7fafc;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.import-section h3, .export-section h3, .ai-upload-section h3 {
    margin-bottom: 1rem;
    color: #2d3748;
}

.ai-upload-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0ea5e9;
}

.ai-upload-section h3 {
    color: #0c4a6e;
    font-size: 1.25rem;
}

.ai-upload-note {
    color: #0c4a6e;
    font-size: 14px;
    margin-bottom: 1rem;
    line-height: 1.5;
}

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

.form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.form-input {
    padding: 0.75rem 1rem;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.file-help {
    color: #6b7280;
    font-size: 12px;
    margin-top: 0.25rem;
}

/* AI Upload Button Styles */
#upload-btn {
    width: auto;
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    align-self: flex-start;
}

#upload-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

#upload-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Experimental Warning */
.experimental-warning {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 4px;
    margin: 0;
    min-height: auto;
    width: auto;
    max-width: fit-content;
}

.experimental-warning .warning-icon {
    font-size: 0.75rem !important;
    flex-shrink: 0;
    line-height: 1;
}

.warning-text {
    color: #92400e;
    font-size: 12px;
    line-height: 1.3;
}

.warning-text strong {
    color: #78350f;
}

/* Opt-in Section */
.opt-in-section {
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin: 0;
}

.opt-in-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    margin-bottom: 0.75rem;
}

.opt-in-checkbox input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    accent-color: #0ea5e9;
    flex-shrink: 0;
    margin-top: 2px;
}

.opt-in-text {
    color: #374151;
    font-size: 13px;
    line-height: 1.5;
}

.privacy-links {
    text-align: right;
    margin-top: 0.5rem;
}

.privacy-link {
    color: #0ea5e9;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.privacy-link:hover {
    border-bottom-color: #0ea5e9;
}

/* Opt-out Limitations Warning */
.opt-out-limitations {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fca5a5;
    border-radius: 6px;
}

.limitations-warning h4 {
    margin: 0 0 0.75rem 0;
    color: #dc2626;
    font-size: 0.9rem;
}

.limitations-warning ul {
    margin: 0 0 0.75rem 0;
    padding-left: 1.25rem;
    color: #7f1d1d;
}

.limitations-warning li {
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    line-height: 1.4;
}

.limitations-warning p {
    margin: 0;
    font-size: 0.85rem;
    color: #991b1b;
    font-weight: 500;
}

/* Usage Limit Warning */
.usage-limit-warning {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 2px solid #ef4444;
    border-radius: 8px;
    margin: 1rem 0;
}

.limit-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.limit-text {
    color: #991b1b;
    font-size: 14px;
    line-height: 1.5;
}

.limit-text strong {
    color: #7f1d1d;
}

.delete-link {
    color: #dc2626;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.delete-link:hover {
    border-bottom-color: #dc2626;
}

/* Error Feedback Section */
.error-feedback-section {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #f3f4f6;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
}

.error-feedback-text {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 0.75rem;
}

.flag-error-link {
    color: #dc2626;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
    font-size: 14px;
}

.flag-error-link:hover {
    border-bottom-color: #dc2626;
}

.upload-status {
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 500;
    margin: 9;
    display: none;
    font-size: 0.8rem;
    line-height: 1rem;
    text-align: center;
}

.upload-status.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.upload-status.info.parsing {
    background: #fef3c7;
    color: #92400e;
    border: 2px solid #f59e0b;
    font-weight: 600;
    white-space: pre-line;
    line-height: 1.5;
}

.upload-status.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #86efac;
}

.upload-status.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.upload-results {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    position: relative;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.upload-results-content h4 {
    color: #1e293b;
    margin-bottom: 1rem;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-item-flex {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: .6rem !important;
    color: #64748b !important;
    font-weight: 500 !important;
}

.stat-value {
    font-size: 16px;
    color: #1e293b;
    font-weight: 600;
}

.upload-warnings {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.upload-warnings h5 {
    color: #92400e;
    margin-bottom: 0.5rem;
    font-size: 14px;
}

.upload-warnings ul {
    list-style: none;
    padding: 0;
}

.upload-warnings li {
    color: #92400e;
    font-size: 13px;
    margin-bottom: 0.25rem;
}

.upload-warnings li:before {
    content: "⚠️ ";
}

.upload-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.exercises-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
}

.exercise-item {
    padding: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s;
}

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

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

/* .exercise-header consolidated above */

.exercise-number {
    background: #0ea5e9;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.exercise-name {
    font-weight: 600;
    color: #1e293b;
    flex: 1;
}

.exercise-muscle {
    background: #e0f2fe;
    color: #0c4a6e;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.exercise-details {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.detail {
    background: #f1f5f9;
    color: #475569;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 12px;
}

/* Enhanced Error Handling Styles */

.upload-details {
    margin-top: 0.5rem;
}

.details-toggle {
    background: none;
    border: none;
    color: #991b1b;
    text-decoration: underline;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
}

.details-toggle:hover {
    color: #dc2626;
}

.details-content {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #fef2f2;
    border-radius: 4px;
    font-size: 12px;
    color: #7f1d1d;
    border: 1px solid #fecaca;
}

.upload-status .btn {
    font-size: 12px;
    padding: 0.25rem 0.5rem;
    margin: 0.125rem;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-status .btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.upload-status .btn.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.upload-status .btn.btn-secondary:hover {
    background: #e5e7eb;
}

/* Loading and Progress Indicators */
.upload-progress {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0ea5e9, #3b82f6);
    border-radius: 2px;
    transition: width 0.3s ease;
    animation: progress-pulse 2s ease-in-out infinite;
}

@keyframes progress-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Enhanced Status Messages */
.upload-status.error .btn {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.upload-status.error .btn:hover {
    background: #fecaca;
    border-color: #f87171;
}

.upload-status.info .btn {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e40af;
}

.upload-status.info .btn:hover {
    background: #bfdbfe;
    border-color: #60a5fa;
}

/* File Size Display */
.file-size-info {
    font-size: 11px;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Disabled form elements during parsing */
.form-input:disabled,
.file-input:disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.7;
}

.form-input:disabled::placeholder {
    color: #d1d5db;
}

/* Disabled checkbox styling */
input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Disabled navigation buttons */
.nav-btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

.file-size-warning {
    color: #d97706;
    font-weight: 500;
}

.file-size-error {
    color: #dc2626;
    font-weight: 500;
}

.export-section .export-json, .export-section .export-csv {
  margin-bottom: 1rem;
}

.file-input {
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    background: #ffffff;
    transition: all 0.2s ease;
    color: #374151;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 300px;
}

.file-input:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.file-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.data-status {
    /* margin-top: 1rem; */
}

/* Danger Zone Styles */
.danger-section {
    background: #fef2f2;
    border: 2px solid #fecaca;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.danger-section h3 {
    color: #dc2626;
    margin-bottom: 1rem;
}

.danger-warning {
    color: #7f1d1d;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Warning Modal Styles */
.warning-content {
    text-align: center;
    padding: 1rem;
}

.warning-content h3 {
    color: #dc2626;
    margin-bottom: 1rem;
}

.warning-content ul {
    text-align: left;
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.warning-content li {
    margin-bottom: 0.5rem;
    color: #374151;
}


/* Exercise Database Styles */
.exercise-db-controls input,
.exercise-db-controls select {
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    /* min-width: 200px; */
}

.exercise-db-controls input {
  min-width: 0 !important;
}

.exercise-db-controls input:focus,
.exercise-db-controls select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Responsive grid for different screen sizes */
@media (max-width: 1200px) {
    .exercise-database-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .exercise-database-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        /* padding: 0 1rem; */
    }
    
    .exercise-db-card {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .exercise-database-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        /* padding: 0 0.5rem; */
    }
    
    .exercise-db-card {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        padding: 0.75rem;
    }
}

.exercise-db-card {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-width: 0; /* Allow card to shrink below content size */
    overflow: hidden; /* Prevent content from breaking layout */
    display: flex;
    flex-direction: column;
    min-height: 300px; /* Ensure consistent card height */
}

/* Responsive card padding */
@media (max-width: 768px) {
    .exercise-db-card {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .exercise-db-card {
        padding: 0.75rem;
    }
}

.exercise-db-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.loading-indicator {
    text-align: center;
    padding: 2rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin: 1rem 0;
}

.loading-indicator p {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0 0 1rem 0;
    font-weight: 500;
}

.loading-indicator .btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.loading-indicator .btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.loading-indicator .btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.exercise-db-card h3 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Responsive card titles */
@media (max-width: 768px) {
    .exercise-db-card h3 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 480px) {
    .exercise-db-card h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
}

.exercise-db-details {
    margin-bottom: 1rem;
    flex: 1;
}

.exercise-db-details p {
    margin-bottom: 0.5rem;
    color: #4a5568;
    font-size: 0.9rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Responsive exercise details */
@media (max-width: 768px) {
    .exercise-db-details p {
        font-size: 0.85rem;
        margin-bottom: 0.4rem;
    }
}

@media (max-width: 480px) {
    .exercise-db-details p {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }
}

.exercise-db-details strong {
    color: #2d3748;
    font-weight: 600;
}

.exercise-description {
    color: #718096;
    font-style: italic;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.exercise-instructions {
    background: #f7fafc;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    margin-top: auto;
    flex-shrink: 0;
}

.exercise-instructions strong {
    color: #2d3748;
    display: block;
    /* margin-bottom: 0.5rem; */
}

/* Demo section styling */
.demo-container {
  text-align: center;
  padding: 1.5rem;
}

.demo-gif {
  max-width: 400px;
  width: 60%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #e1e5e9;
  margin: 0 auto;
  display: block;
}

.demo-description {
  margin-top: 1rem;
  color: #666;
  font-size: 1rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* Responsive design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        padding: 0.75rem 0;
    }
    
    .header {
        padding: 0;
    }
    
    .nav {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0.5rem 1rem;
        margin: 0 1.25rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-snap-type: x mandatory;
        max-width: -webkit-fill-available;
    }
    
    .nav::-webkit-scrollbar {
        display: none;
    }
    
    .nav-btn {
        flex-shrink: 0;
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        white-space: nowrap;
        scroll-snap-align: start;
    }
    
    .logout-btn {
        flex-shrink: 0 !important;
        padding: 0.5rem 1rem !important;
        font-size: 0.8rem !important;
        white-space: nowrap !important;
        height: 2rem !important;
        scroll-snap-align: start !important;
    }
    
    .workout-controls {
        flex-direction: row;
        align-items: center;
        row-gap: 0.5rem;
        column-gap: 2.5rem;
        padding: 1rem;
        margin: 2.25rem 0 2rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-snap-type: x mandatory;
    }
    
    .workout-controls::-webkit-scrollbar {
        display: none;
    }
    
    .workout-content {
        margin: 0;
        padding: 1rem;
        overflow-x: hidden;
        /* width: calc(100% - 1rem); */
        box-sizing: border-box;
    }
    
    /* Ensure workout content constrains exercise cards on mobile */
    #workout-content {
        overflow-x: hidden;
        /* width: 100%;
        max-width: 100%; */
        box-sizing: border-box;
    }
    
    .control-group {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
        flex-shrink: 0;
        /* min-width: 180px;
        max-width: 200px; */
        scroll-snap-align: start;
    }
    
    /* Specific styling for program dropdown */
    .control-group:first-child {
        min-width: 150px;
        max-width: 180px;
    }
    
    .control-group label {
        font-size: 0.8rem;
        font-weight: 600;
        color: #2d3748;
        white-space: nowrap;
        min-width: fit-content;
    }
    
    .control-group select {
        min-width: 120px;
        width: auto;
        padding: 0.5rem 2rem 0.5rem 0.75rem;
        font-size: .8rem;
        border: 2px solid #e2e8f0;
        border-radius: 8px;
        background: white;
        flex-shrink: 0;
        max-width: 160px;
    }
    
    /* Specific styling for program dropdown select */
    .control-group:first-child select {
        min-width: 100px;
        max-width: 140px;
    }
    
    .control-group select:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }
    
    .exercise-stats {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.5rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .stat-item {
        width: 100%;
        box-sizing: border-box;
        max-width: none;
    }
    
    /* Mobile sets layout */
    .sets-container {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
        margin: .5rem 0 0;
        padding: 0;
    }
    
    .set-item {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        padding: 0.75rem;
        min-height: auto;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        box-sizing: border-box;
        margin-bottom: 0.5rem;
    }
    
    .set-item::-webkit-scrollbar {
        display: none;
    }
    
    .set-inputs {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        flex: 1;
        min-width: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .set-inputs::-webkit-scrollbar {
        display: none;
    }

    .set-inputs input {
      /* max-width: 3.5rem; */
      /* min-width: 3rem; */
      flex-shrink: 0;
    }
    
    .set-input {
        width: 70px;
        min-width: 70px;
        font-size: 16px; /* Prevent zoom on iOS */
        flex-shrink: 0;
        box-sizing: border-box;
    }
    
    .set-number {
        min-width: 60px;
        width: 60px;
        text-align: center;
        padding: 0.5rem;
        font-size: 0.6rem;
        line-height: 0.7rem;
        flex-shrink: 0;
    }
    
    .btn-remove-set {
        width: 40px;
        height: 44px;
        padding: 0.5rem;
        font-size: 0.8rem;
        flex-shrink: 0;
    }
    
    /* Mobile calculator section */
    .calculator-section {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
        margin: 0;
        padding: 0;
        margin-bottom: 1rem;
    }
    
    .calculator-grid {
        flex-direction: row;
        gap: .25rem;
        align-items: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .calculator-grid::-webkit-scrollbar {
        display: none;
    }
    
    .btn-calculate {
        flex-shrink: 0;
        padding: 6px;
        font-size: 0.6rem;
        /* min-width: 80px; */
        height: 32px;
    }
    
    .input-group input {
        width: 100%;
        min-width: 80px;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .input-group {
        min-width: auto;
        max-width: none;
    }
    
    .btn-calculate {
        justify-content: center;
    }
    
    /* Mobile exercise cards */
    .exercise-card {
        margin: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
        min-width: 0; /* Allow card to shrink below content size */
    }
    
    .exercise-card:not(:last-child) {
        margin-bottom: 1rem;
    }
    
    .exercise-header {
        padding: 1rem;
        box-sizing: border-box;
    }
    
    .exercise-content {
        max-width: 100%;
        width: 100%;
        overflow-x: hidden;
        overflow-y: visible;
        box-sizing: border-box;
        word-wrap: break-word;
        word-break: break-word;
        min-width: 0; /* Allow content to shrink below content size */
    }
    
    /* Exercise stats - grid layout without horizontal scroll */
    .exercise-stats {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.5rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .stat-item {
        width: 100%;
        box-sizing: border-box;
        padding: 0.5rem;
        background: #f7fafc;
        border-radius: 6px;
        border: 1px solid #e2e8f0;
        font-size: 0.8rem;
    }
    
    /* Mobile exercise actions */
    .exercise-actions {
        width: 100%;
        flex-direction: row;
        gap: 0.5rem;
        box-sizing: border-box;
    }
    
    .exercise-actions button {
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Override inline styles for mobile to prevent layout breaking */
    .exercise-card:not(.collapsed) .exercise-content {
        max-width: 100% !important;
        width: 100% !important;
        overflow-x: auto !important;
        box-sizing: border-box !important;
    }
    
    .exercise-card:not(.collapsed) {
        max-width: 100% !important;
        width: 100% !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }
    
    /* Ensure workout cards don't break mobile layout */
    .workout-card {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    
    .workout-card .exercise-card {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Force all workout-related containers to respect mobile boundaries */
    .workout-container,
    .workout-week,
    .workout-type {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }
    
    /* Ensure the main workout area doesn't overflow */
    #workout-page .main-container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
        /* padding: 0 0.75rem !important; */
    }
    
    
    
    .exercise-actions-bottom {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .exercise-actions-left {
        width: 100%;
        gap: 0.5rem;
    }
    
    .substitute-btn, .tutorial-btn, .weight-unit-toggle-btn, .rest-timer-btn {
        flex: 1;
        padding: 0.75rem;
        font-size: 0.8rem;
        text-align: center;
        min-width: 0;
        height: 2.25rem;
    }
    
    .btn-complete {
        width: 100%;
        height: 2.25rem;
        font-size: 0.8rem;
    }
}

/* Reduce button font sizes for tight vertical padding on small screens */
@media (max-width: 600px) {
    .substitute-btn, .tutorial-btn, .weight-unit-toggle-btn, .rest-timer-btn, .btn-complete {
        font-size: 0.75rem;
        padding: 0.6rem 0.75rem;
    }
}

/* Hide button text on very small screens, keep icons and screen reader accessibility */
@media (max-width: 576px) {
    .substitute-btn, .tutorial-btn, .rest-timer-btn {
        position: relative;
        padding: 0.75rem;
        min-width: 2.5rem;
        width: auto;
        font-size: 0;
        line-height: 1;
        overflow: hidden;
        text-indent: -9999px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .substitute-btn::before {
        content: '🔄';
        font-size: 1.2rem;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        text-indent: 0;
        line-height: 1;
        display: block;
    }
    
    .tutorial-btn::before {
        content: '📺';
        font-size: 1.2rem;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        text-indent: 0;
        line-height: 1;
        display: block;
    }
    
    .rest-timer-btn::before {
        content: '⏱️';
        font-size: 1.2rem;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        text-indent: 0;
        line-height: 1;
        display: block;
    }
}
    
    /* Touch scrolling utility class */
.touch-scroll-horizontal {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scroll-snap-type: x mandatory;
}

.touch-scroll-horizontal::-webkit-scrollbar {
    height: 4px;
}

.touch-scroll-horizontal::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 2px;
}

.touch-scroll-horizontal::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 2px;
}

.touch-scroll-horizontal::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.touch-scroll-item {
    flex-shrink: 0;
    scroll-snap-align: start;
}

/* Mobile container improvements */
@media (max-width: 768px) {
    .warmup-target-row,
    .warmup-set-row {
        flex-direction: row;
        /* gap: 0.25rem; */
        padding: 0.5rem;
        align-items: center;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        flex-wrap: nowrap;
    }
    
    .warmup-target-row::-webkit-scrollbar,
    .warmup-set-row::-webkit-scrollbar {
        display: none;
    }
    
    .warmup-target-weight,
    .warmup-set-weight,
    .warmup-set-info,
    .warmup-target-reps,
    .warmup-set-reps,
    .warmup-reps {
        min-width: 50px;
        font-size: .6rem; /* Prevent zoom on iOS */
        flex-shrink: 0;
        line-height: .7rem;
        /* white-space: nowrap; */
    }
    
    .warmup-set-info {
        flex: 0 1 auto;
        max-width: 50%;
        font-size: 0.55rem;
    }
    
    .btn-add-warmup {
        width: auto;
        min-width: 40px;
        height: 25px;
        padding: 0.5rem;
        font-size: 0.6rem;
        flex-shrink: 0;
    }
    .timer-presets {
        justify-content: center;
    }
    
    .progress-grid {
        flex-direction: row;
        align-items: center;
    }
}

/* Small screens - 1 card per row */
@media (max-width: 600px) {
    .progress-grid {
        /* flex-direction: column; */
        align-items: center;
    }
    
    .exercise-db-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .exercise-db-controls input,
    .exercise-db-controls select {
        width: 100%;
        min-width: auto;
    }
    
    /* Grid responsiveness handled above */
    
    /* Make exercise details horizontally scrollable on mobile */
    .exercise-db-details {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        gap: 1rem;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scroll-snap-type: x mandatory;
    }
    
    .exercise-db-details p {
        flex-shrink: 0;
        max-height: 39px;
        margin-bottom: 0;
        padding: 0.5rem;
        background: #f7fafc;
        border-radius: 6px;
        border: 1px solid #e2e8f0;
        scroll-snap-align: start;
    }
    
    .exercise-db-details::-webkit-scrollbar {
        height: 4px;
    }
    
    .exercise-db-details::-webkit-scrollbar-track {
        background: #f1f5f9;
        border-radius: 2px;
    }
    
    .exercise-db-details::-webkit-scrollbar-thumb {
        background: #cbd5e0;
        border-radius: 2px;
    }
    
    .exercise-db-details::-webkit-scrollbar-thumb:hover {
        background: #a0aec0;
    }
}

/* Substitution Modal Styling */
#substitution-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

#substitution-modal .modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

#substitution-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#substitution-modal .modal-header h2 {
    margin: 0;
    color: white;
    font-size: 1.5rem;
}

#substitution-modal .modal-close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    align-items: center;
    justify-content: center;
}

#substitution-modal .modal-close:hover {
    color: #2d3748;
}

#substitution-modal .modal-body {
    padding: 20px;
}

#substitution-list {
    margin-top: 20px;
}

.substitution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.substitution-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

.substitution-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

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

.substitution-header h4 {
    margin: 0;
    color: #2d3748;
    font-size: 1.1rem;
}

.match-score {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    min-width: 80px;
}

.match-percentage {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.1rem;
}

.match-tier {
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0.9;
}

.match-excellent { background: #d4edda; color: #155724; }
.match-very-good { background: #d1ecf1; color: #0c5460; }
.match-good { background: #fff3cd; color: #856404; }
.match-fair { background: #f8d7da; color: #721c24; }
.match-poor { background: #f5c6cb; color: #721c24; }

.substitution-details {
    margin-bottom: 1rem;
}

.detail-row {
    display: flex;
    margin-bottom: 0.5rem;
}

.detail-row .label {
    font-weight: 600;
    color: #4a5568;
    min-width: 80px;
}

.detail-row .value {
    color: #2d3748;
}

.substitution-actions {
    display: flex;
    gap: 0.5rem;
}

.substitution-actions .btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.substitution-actions .btn-primary {
    background: #667eea;
    color: white;
}

.substitution-actions .btn-primary:hover {
    background: #5a67d8;
}

.substitution-actions .btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.substitution-actions .btn-secondary:hover {
    background: #cbd5e0;
}

/* Modal System Styling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Modal Content Sizes */
.modal-small .modal-content {
    max-width: 400px;
    width: 90%;
}

.modal-medium .modal-content {
    max-width: 600px;
    width: 90%;
}

.modal-large .modal-content {
    max-width: 800px;
    width: 95%;
}

.modal-fullscreen .modal-content {
    max-width: 95vw;
    max-height: 95vh;
    width: 95vw;
    height: 95vh;
}

/* Modal Content Wrapper */
.modal-content-wrapper {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 1rem;
}

/* Video Modal - Higher z-index to appear on top of substitution modal */
.video-modal {
    z-index: 11000;
}

.video-modal-content {
    max-width: 900px;
}

#video-container {
    position: relative;
    width: 100%;
    height: 400px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

#tutorial-video {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin: 0;
    position: relative;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 30px;
    line-height: 1.6;
    color: #333;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-body h3 {
    color: #667eea;
    margin-top: 25px;
    margin-bottom: 10px;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.loading-spinner {
    text-align: center;
    padding: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-state {
    text-align: center;
    padding: 2rem;
}

.loading-state p {
    margin-top: 1rem;
    color: #666;
    font-size: 1.1rem;
}

.error-state {
    text-align: center;
    padding: 2rem;
}

.error-state .error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-state p {
    margin: 1rem 0;
    color: #dc3545;
    font-size: 1.1rem;
}

.original-exercise {
    margin-bottom: 2rem;
}

.original-exercise-card {
    background: #f8f9fa;
    border: 2px solid #007bff;
    border-radius: 8px;
    padding: 1rem;
}

.original-exercise-card h3 {
    margin: 0 0 1rem 0;
    color: #007bff;
    font-size: 1.25rem;
}

.exercise-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.detail-item {
    color: #495057;
    font-size: 0.9rem;
}

.substitution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.substitution-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    background: white;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.substitution-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.substitution-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.substitution-header h4 {
    margin: 0;
    color: #495057;
    font-size: 1.1rem;
    line-height: 1.3;
}

.match-score {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 1rem;
}

.match-excellent {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.match-very-good {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #2196f3;
}

.match-good {
    background: #fff3e0;
    color: #f57c00;
    border: 1px solid #ff9800;
}

.match-fair {
    background: #fce4ec;
    color: #c2185b;
    border: 1px solid #e91e63;
}

.match-poor {
    background: #ffebee;
    color: #d32f2f;
    border: 1px solid #f44336;
}

.substitution-details {
    margin-bottom: 1rem;
    flex-grow: 1;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.detail-row .label {
    font-weight: 600;
    color: #6c757d;
}

.detail-row .value {
    color: #495057;
    text-align: right;
    flex: 1;
    margin-left: 1rem;
    line-height: 1.2;
}

.substitution-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 1rem;
}

.btn-primary {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 120px;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
}

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

/* Responsive design for modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1rem;
        max-height: 90vh;
    }
    
    .modal-body {
        max-height: 50vh;
        overflow-y: auto;
        padding: 20px;
    }
    
    .video-modal-content {
        margin: 0.5rem;
    }
    
    #video-container {
        height: 250px;
    }
    
    .substitution-grid {
        grid-template-columns: 1fr;
    }
    
    .exercise-details {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .substitution-actions {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        flex: none;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 98%;
        margin: 0.5rem;
        max-height: 95vh;
    }
    
    .modal-body {
        max-height: 60vh;
        overflow-y: auto;
        padding: 15px;
    }
}

/* ========================================
   ADDITIONAL STYLES FROM INLINE CSS
   ======================================== */

/* Gym Equipment Background Pattern */
.gym-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.05;
    z-index: 1;
    pointer-events: none;
    background-image: url('/static/img/gym-bg.png');
    background-repeat: repeat;
    background-size: 400px 400px;
}

/* Landing Page Styles */
.main-headline {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    text-align: center;
}

.sub-headline {
    font-size: 1.3rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
    font-weight: 400;
    color: white;
    text-align: center;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 4rem;
    align-items: start;
}

.left-content {
    padding-right: 2rem;
}

.features-section {
    margin-bottom: 1.5rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}

.feature-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.feature-icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
}

.feature-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
}

.feature-desc {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    line-height: 1.5;
}

.trust-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin: 2rem 0;
    text-align: center;
}

.trust-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
}

.trust-text {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.founder-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin: 2rem 0;
    text-align: center;
}

.founder-text {
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
    font-size: 1rem;
}

.founder-text a {
    color: #ffffff;
    text-decoration: underline;
}

.founder-text a:hover {
    color: #e2e8f0;
}

.demo-placeholder {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    margin: 2rem 0;
}

.upload-form {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-title {
    text-align: center;
    color: #2d3748;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
}

.form-subtitle {
    text-align: center;
    color: #4a5568;
    font-size: 1rem;
}

.form-group label {
    display: block;
    color: #4a5568;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.upload-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.upload-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #feb2b2;
    font-size: 0.9rem;
}

.success-message {
    background: #c6f6d5;
    color: #22543d;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #9ae6b4;
    font-size: 0.9rem;
}

.loading {
    color: #667eea;
    font-size: 0.9rem;
    margin-top: 10px;
    text-align: center;
    font-weight: 500;
}

.support-text {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #718096;
}

.support-text a {
    color: #667eea;
    text-decoration: none;
}

.support-text a:hover {
    text-decoration: underline;
}

.footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2rem 0 0;
    margin-top: auto;
    text-align: center;
    flex-shrink: 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding: 0 2rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    margin: 0;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: white;
    text-decoration: underline;
}

.footer-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

/* Simple Modal Styles */
.simple-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

.simple-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    /* width: 80%; */
    max-width: 900px;
    max-height: 75vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
    color: #333;
    min-width: 375px;
}

/* Modal size variants */
/* .simple-modal-small {
    max-width: 400px;
    width: 70%;
}

.simple-modal-medium {
    max-width: 600px;
    width: 80%;
}

.simple-modal-large {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    margin: 0 auto;
    max-width: 768px;
    max-height: 90vh;
}

.simple-modal-extra-large {
    max-width: 1200px;
    width: 95%;
    max-height: 95vh;
} */

.simple-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1;
}

.simple-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.simple-modal-close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.simple-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.simple-modal-body {
    padding: 1rem;
    line-height: 1.6;
}

.simple-modal-body h3 {
    color: #667eea;
    margin-top: 25px;
}

.simple-modal-body h3:first-child {
    margin-top: 0;
}

.simple-modal-body .mode-header{
  font-weight: 600;
}

.simple-modal-body .mode-description {
    margin-bottom: 1rem;
}

/* Simple modal side spacing on small screens */
@media (max-width: 429px) {
    .simple-modal {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .simple-modal-content {
        min-width: 0;
    }
}

/* Substitution Modal Styles */
.substitution-modal-content {
  max-width: 800px;
}

.original-exercise {
  margin-bottom: 2rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.original-exercise h3 {
  margin-top: 0;
  color: #667eea;
}

.exercise-card {
  background: white;
  /* padding: 1rem; */
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.exercise-card h4 {
  margin: 0 0 0.5rem 0;
  color: #333;
}

.substitutions-list h3 {
  color: #667eea;
  margin-bottom: 1rem;
}

.substitution-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .substitution-grid {
    grid-template-columns: 1fr;
  }
}

.substitution-item {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  margin-bottom: 1rem;
}

.substitution-item:hover {
  border-color: #667eea;
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.2);
}

.substitution-item.current-selection {
  border-color: #10b981;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.current-selection-badge {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  margin: 0.5rem 0;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

/* Exercise Info Styles */
.exercise-info h5 {
  margin: 0 0 0.75rem 0;
  color: #1f2937;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.exercise-info p {
  margin: 0 0 0.5rem 0;
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.4;
}

.exercise-info p:last-child {
  margin-bottom: 0;
}

.exercise-info p strong {
  color: #374151;
  font-weight: 600;
}

/* Substitution and Original Badges */
.substitution-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  margin-top: 0.75rem;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
  display: inline-block;
  align-self: flex-start;
}

.original-badge {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  margin-top: 0.75rem;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
  display: inline-block;
  align-self: flex-start;
}

.substitution-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.substitution-item h4 {
  margin: 0;
  color: #333;
  font-size: 1.1rem;
  line-height: 1.2;
  flex: 1;
}

.match-grade {
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: bold;
  white-space: nowrap;
  margin-left: 0.5rem;
}

/* Color coding for match grades */
.match-grade[data-grade="high"] {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.match-grade[data-grade="medium"] {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.match-grade[data-grade="low"] {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.match-grade:not([data-grade]) {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.substitution-details {
  flex: 1;
  margin-bottom: 1rem;
}

.substitution-item p {
  margin: 0.25rem 0;
  color: #666;
  font-size: 0.9rem;
}

.substitution-item .btn {
  margin-top: auto;
  width: auto;
  min-width: 120px;
  max-width: 200px;
  max-height: 30px;
  flex-shrink: 0;
  align-self: center;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* Video Modal Styles */
.video-modal-content {
  max-width: 900px;
}

.video-container {
  position: relative;
  width: 100%;
  height: 400px;
  margin-bottom: 1rem;
}

.video-container iframe {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.video-info {
  text-align: center;
}

.video-info h3 {
  color: #667eea;
  margin-bottom: 0.5rem;
}

.video-info p {
  color: #666;
  margin: 0;
}

.video-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 400px;
  background: #f8f9fa;
  border-radius: 8px;
  text-align: center;
}

.video-error p {
  margin: 0;
  color: #666;
}

.video-error a {
  color: #667eea;
  text-decoration: none;
  font-weight: bold;
}

.video-error a:hover {
  text-decoration: underline;
}

/* Admin Login Styles */
.admin-login-container {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.admin-login-container h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2rem;
}

.admin-login-container p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.admin-login-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.admin-login-btn:hover {
    transform: translateY(-2px);
}

.admin-login-container .form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.admin-login-container .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #4a5568;
    font-weight: 600;
    font-size: 0.95rem;
}

.admin-login-container .form-group input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

.admin-login-container .form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}


/* Responsive Design */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .left-content {
        padding-right: 0;
    }
    
    .upload-form {
        position: static;
    }
}

@media (max-width: 768px) {
    .main-headline {
        font-size: 2rem;
    }
    
    .sub-headline {
        font-size: 1.2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .upload-form {
        padding: 1.5rem;
    }
}

/* Admin Dashboard Styles */
.admin-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: white;
    line-height: 1.6;
    position: relative;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 20px;
}

.admin-body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/static/img/gym-bg.png');
    background-repeat: repeat;
    background-size: 400px 400px; 
    opacity: 0.05;
    z-index: 1;
    pointer-events: none;
}

.admin-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.admin-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    color: #333;
}

.admin-header h1 {
  font-size: 1.5rem;
}

.admin-header p {
  padding: 0;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 2rem;
}

.admin-validation-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.admin-stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    color: #333;
}

.admin-validation-stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: center;
    color: #333;
}

.admin-stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #4299e1;
}

.admin-stat-label {
    color: #666;
    margin-top: 5px;
}

.admin-duplicates-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    color: #333;
}

.admin-duplicates-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.admin-bulk-actions {
    display: flex;
    gap: 10px;
}

.admin-duplicate-item {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 15px;
    margin: 10px 0;
    border-radius: 5px;
}

.admin-exercise-name {
    font-weight: bold;
    color: #856404;
}

.admin-exercise-details {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 5px;
}

.admin-btn {
    background: #4299e1;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin-right: 5px;
    transition: all 0.2s ease;
}

.admin-btn:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

.admin-btn-danger {
    background: #dc3545;
}

.admin-btn-danger:hover {
    background: #c82333;
}

.admin-btn-danger:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.admin-btn-success {
    background: #28a745;
}

.admin-btn-success:hover {
    background: #218838;
}

.admin-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

#tier-mgmt-form {
  border: 1px solid #FFFFFF;
  padding: 1.5rem 1.5rem 3rem;
  border-radius: 12px;
}

#tier-mgmt-form > div {
  margin-bottom: 2rem;
}

#tier-mgmt-form > div > h4 {
  font-size: 1.25rem;
}

/* Interactive Upload Styles */
.interactive-modal {
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.column-mapping-interface {
    max-width: 100%;
}

.mapping-explanation {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.mapping-explanation h4 {
    margin: 0 0 0.5rem 0;
    color: #0369a1;
}

.mapping-explanation p {
    margin: 0;
    color: #0c4a6e;
    font-size: 0.9rem;
}

.mapping-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.mapping-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mapping-row label {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.mapping-row label.required::after {
    content: " *";
    color: #dc2626;
}

.mapping-row select {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.9rem;
}

.sample-data-preview {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.sample-data-preview h4 {
    margin: 0 0 1rem 0;
    color: #374151;
}

.sample-table {
    overflow-x: auto;
}

.sample-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.sample-table th,
.sample-table td {
    border: 1px solid #e5e7eb;
    padding: 0.5rem;
    text-align: left;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sample-table th {
    background: #f3f4f6;
    font-weight: 600;
}

.mapping-actions,
.review-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* Exercise Review Styles */
.exercise-review-interface {
    max-width: 100%;
}

.review-header {
    background: #f0fdf4;
    border: 1px solid #22c55e;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.review-header h4 {
    margin: 0 0 0.5rem 0;
    color: #15803d;
}

.review-header p {
    margin: 0 0 1rem 0;
    color: #166534;
    font-size: 0.9rem;
}

.review-stats {
    display: flex;
    gap: 1rem;
}

.review-stats .stat {
    background: #dcfce7;
    color: #166534;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.bulk-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.exercise-list {
    max-height: 60vh;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
}

.exercise-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #fafafa;
}

.exercise-item:last-child {
    margin-bottom: 0;
}

/* .exercise-header consolidated above */

.exercise-checkbox {
    width: 18px;
    height: 18px;
}

.exercise-name-section {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.exercise-name-edit {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1rem;
}

.exercise-id {
    background: #e5e7eb;
    color: #6b7280;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.exercise-actions {
    display: flex;
    gap: 0.5rem;
}

.exercise-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.detail-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-row.full-width {
    grid-column: 1 / -1;
}

.detail-row label {
    font-weight: 600;
    color: #374151;
    font-size: 0.8rem;
}

.detail-edit {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.9rem;
}

.detail-edit.notes-edit {
    resize: vertical;
    min-height: 60px;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Status messages */
.status-message {
    padding: 0.75rem;
    border-radius: 6px;
    font-weight: 500;
}

.status-message.loading {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
}

.status-message.error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #ef4444;
}

.status-message.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #22c55e;
}

/* Onboarding Banner Styles */
.onboarding-banner {
  color: white;
  margin: 2rem auto 0;
  max-width: 1200px;
  position: relative;
  z-index: 10;
  border-radius: 16px;
  overflow: hidden;
  transform: translateY(-100%);
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.onboarding-banner.show {
  transform: translateY(0);
  opacity: 1;
}

.onboarding-banner.hide {
  transform: translateY(-100%);
  opacity: 0;
}

.start-here {
  margin: 0 2rem 1.5rem;
}

.start-here li a {
  font-weight: 600;
  color: white;
}

.start-here li a:hover {
  color: #FFD700;
}

/* .onboarding-banner {
  color: white;
  margin: 2rem 2rem 0;
  max-width: 1540px;
  position: relative;
  z-index: 10;
  border-radius: 16px;
  overflow-x: hidden;
  display: flex;
  align-self: center;
} */

.onboarding-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  position: relative;
}

.onboarding-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  pointer-events: none;
}

.onboarding-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 2rem 1rem 2rem;
  position: relative;
  z-index: 1;
}

.onboarding-header h3 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, #f0f9ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  line-height: 1.75rem;
}

.onboarding-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.onboarding-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.onboarding-body {
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

@media (max-width: 599px) {
  .onboarding-body {
    grid-template-columns: 1fr;
  }
}

.onboarding-section {
  background: rgba(255, 255, 255, 0.15);
  padding: 1.75rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* .onboarding-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0.5) 100%);
} */

.onboarding-section:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.2);
}

.onboarding-section h4 {
  margin: 0 0 1.25rem 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.onboarding-section p {
  margin: 0 0 1rem 0;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.95rem;
}

.onboarding-section ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.onboarding-section li {
  margin-bottom: 0.75rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  position: relative;
  padding-left: 1.25rem;
}

.onboarding-section li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: rgba(255, 255, 255, 0.7);
  font-weight: bold;
}

.onboarding-section strong {
  color: #fff;
  font-weight: 700;
}

.onboarding-footer {
  padding: 1.5rem 2rem 2rem 2rem;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.onboarding-btn {
  padding: 0.875rem 2rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 140px;
  position: relative;
  overflow: hidden;
}

.onboarding-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.onboarding-btn:hover::before {
  left: 100%;
}

.onboarding-btn.secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.onboarding-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.onboarding-btn.primary {
  background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
  color: #667eea;
  border: 2px solid rgba(255, 255, 255, 0.8);
  font-weight: 700;
}

.onboarding-btn.primary:hover {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Substitution Modal Styles */
.substitution-modal-content {
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.substitution-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.substitution-header h3 {
    margin: 0;
    color: #2d3748;
}

.substitution-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 300px;
}

.substitution-search input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
}

.substitution-search input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.1);
}

.clear-search-btn {
    background: #e2e8f0;
    border: none;
    border-radius: 4px;
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    font-size: 0.8rem;
    color: #4a5568;
}

.clear-search-btn:hover {
    background: #cbd5e0;
}

.substitution-pagination {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.pagination-info {
    text-align: center;
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.pagination-controls button {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    background: #f7fafc;
    color: #374151;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.pagination-controls button:hover:not(:disabled) {
    background: #f7fafc;
    border-color: #4299e1;
}

.pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    color: #4a5568;
    font-weight: 500;
    font-size: 0.9rem;
}

.loading {
    text-align: center;
    color: #718096;
    font-style: italic;
    padding: 1rem;
}

/* Responsive design for substitution modal */
@media (max-width: 768px) {
    .substitution-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .substitution-search {
        min-width: auto;
        width: 100%;
    }
    
    .pagination-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .pagination-controls button {
        width: 100%;
    }
}

/* Responsive design for onboarding banner */
@media (max-width: 1200px) {
  .start-here {
    margin: 1rem 0;
  }
  .onboarding-body {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 0;
  }
  .onboarding-content {
    margin: 0 1.25rem;
  }
  .onboarding-header {
    padding: 1rem 0;
  }
  .onboarding-footer {
    padding: 1.5rem 0;
  }
  .onboarding-banner {
    margin: 2rem 1.25rem 0;
  }
}

@media (max-width: 768px) {
  .start-here {
    margin: 1rem 1rem 0;
  }

  .onboarding-banner {
    margin: 1rem 1.25rem 0;
  }
  
  .onboarding-header {
    padding: 1rem 1rem 0;
  }
  
  .onboarding-header h3 {
    font-size: 1.25rem;
  }
  
  .onboarding-body {
    padding: 1rem;
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .onboarding-section {
    padding: 1rem;
  }
  
  .onboarding-footer {
    padding: 1rem 1rem 2rem;
    flex-direction: column;
  }
  
  .onboarding-btn {
    width: 100%;
  }
}

/* Advanced Upload Controls Styles */
.advanced-controls {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    backdrop-filter: blur(10px);
}

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

.controls-header h4 {
    color: white;
    font-size: 1.1rem;
    margin: 0;
}

.toggle-controls-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.toggle-controls-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.controls-content {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.control-group {
    margin-bottom: 1rem;
}

.control-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: white;
    font-size: 0.95rem;
    cursor: pointer;
}

.control-checkbox {
    margin: 0;
    transform: scale(1.1);
}

.control-text {
    font-weight: 500;
    flex: 1;
}

.control-help {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.25rem;
    font-weight: normal;
}

.control-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.control-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.page-range-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.page-input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    text-align: center;
    font-size: 0.9rem;
}

.page-separator {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}


/* Upload Instructions Styles */
.upload-info-banner {
    display: flex;
    justify-content: space-around;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    gap: 1rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.info-icon {
    font-size: .5rem;
    /* min-width: 1.5rem; */
}

.info-item strong {
    color: white;
    font-size: 0.9rem;
}

.info-item p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    margin: 0;
}

.upload-requirements {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.6));
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.upload-requirements h4 {
    color: white;
    margin: 0 0 1rem 0;
    font-size: 1rem;
}

.requirements-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.requirements-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.requirements-row:last-child {
    margin-bottom: 0;
}

.requirement-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.requirement-item.good {
    border-left: 3px solid #10b981;
}

.requirement-item.bad {
    border-left: 3px solid #ef4444;
}

.requirement-item .icon {
    font-size: 1rem;
    min-width: 1.2rem;
    margin-top: 0.1rem;
}

.requirement-item strong {
    color: white;
    font-size: 0.85rem;
    display: block;
    margin-bottom: 0.25rem;
}

.requirement-item p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    margin: 0;
    font-style: italic;
}

.tips-section {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(37, 99, 235, 0.6));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.tips-section h4 {
    color: white;
    margin: 0 0 1rem 0;
    font-size: 1rem;
}

.tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tips-list li {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.tips-list li:nth-child(1)::before {
    content: "📄";
    position: absolute;
    left: 0;
}

.tips-list li:nth-child(2)::before {
    content: "📸";
    position: absolute;
    left: 0;
}

.tips-list li:nth-child(3)::before {
    content: "📝";
    position: absolute;
    left: 0;
}

.tips-list li:nth-child(4)::before {
    content: "🏷️";
    position: absolute;
    left: 0;
}

.tips-list li:nth-child(5)::before {
    content: "📊";
    position: absolute;
    left: 0;
}

.tips-list li:nth-child(6)::before {
    content: "📅";
    position: absolute;
    left: 0;
}

.tips-list strong {
    color: white;
}

.format-example {
    background: linear-gradient(135deg, rgba(70, 80, 95, 0.7), rgba(45, 55, 70, 0.5));
    border: 1px solid rgba(90, 100, 115, 0.3);
    border-radius: 8px;
    margin: 1rem 0;
    overflow: hidden;
}

.format-example summary {
    color: white;
    padding: 1rem;
    cursor: pointer;
    font-weight: 500;
    background: rgba(90, 100, 115, 0.6);
    transition: background 0.2s ease;
}

.format-example summary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.example-content {
    padding: 1rem;
}

.example-content h5 {
    color: white;
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
}

.example-table {
    background: rgba(45, 55, 70, 0.7);
    border: 1px solid rgba(70, 80, 95, 0.5);
    border-radius: 4px;
    padding: 1rem;
    color: #e5e7eb;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    overflow-x: auto;
    white-space: pre;
}

.example-note {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    margin: 1rem 0 0 0;
    font-style: italic;
}

.pre-upload-checklist {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(37, 99, 235, 0.6));
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.pre-upload-checklist h4 {
    color: white;
    margin: 0 0 1rem 0;
    font-size: 1rem;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.checklist-checkbox {
    margin: 0;
    transform: scale(1.1);
    margin-top: 0.1rem;
}

.checklist-item span {
    flex: 1;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .upload-info-banner {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .requirements-grid {
        grid-template-columns: 1fr;
    }
    
    .example-table {
        font-size: 0.7rem;
    }
}

.estimates-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 1rem;
    margin-top: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.estimate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.estimate-item:last-child {
    margin-bottom: 0;
}

.estimate-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.estimate-value {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .advanced-controls {
        padding: 0.75rem;
    }
    
    .controls-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .page-range-inputs {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .page-input {
        width: 100%;
    }
    
    .page-separator {
        text-align: center;
    }
}

/* Progress and Resume UI Styles */
.progress-resume-container {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    backdrop-filter: blur(10px);
}

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

.progress-header h4 {
    color: white;
    font-size: 1.2rem;
    margin: 0;
}

.job-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-text {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-pending {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.status-running {
    background: rgba(0, 123, 255, 0.2);
    color: #007bff;
    border: 1px solid rgba(0, 123, 255, 0.3);
}

.status-completed {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.status-failed {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.status-paused {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.3);
}

.status-retrying {
    background: rgba(255, 87, 34, 0.2);
    color: #ff5722;
    border: 1px solid rgba(255, 87, 34, 0.3);
}

.progress-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.progress-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    /* background: rgba(0, 0, 0, 0.1); */
    border-radius: 4px;
    flex-direction: column;
}

.progress-label {
    color: rgb(146 145 145);
    font-size: 0.6rem;
    text-transform: uppercase;
    line-height: 0.6rem;
    font-weight: 600;
}


.progress-bar-container {
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #28a745);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-percentage {
    text-align: center;
}

.progress-percentage span {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.page-progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 6px;
}

.page-indicator {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-pending {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.3);
}

.page-processing {
    background: rgba(0, 123, 255, 0.2);
    color: #007bff;
    border: 1px solid rgba(0, 123, 255, 0.3);
    animation: pulse 1.5s infinite;
}

.page-completed {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.page-failed {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.page-retrying {
    background: rgba(255, 87, 34, 0.2);
    color: #ff5722;
    border: 1px solid rgba(255, 87, 34, 0.3);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.retry-section, .resume-section {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.retry-info, .resume-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.retry-icon, .resume-icon {
    font-size: 1.2rem;
}

.retry-text, .resume-text {
    color: white;
    font-size: 0.9rem;
}

.retry-actions, .resume-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.job-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .progress-resume-container {
        padding: 1rem;
    }
    
    .progress-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .progress-details {
        grid-template-columns: 1fr;
    }
    
    .page-progress-grid {
        grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
    }
    
    .page-indicator {
        width: 35px;
        height: 35px;
        font-size: 0.7rem;
    }
    
    .retry-actions, .resume-actions, .job-controls {
        flex-direction: column;
    }
    
    .btn-sm {
        width: 100%;
    }
}

/* Review and Save Modal Styles */
.review-modal-content {
    max-width: 95vw;
    max-height: 95vh;
    width: 1200px;
    height: 800px;
    display: flex;
    flex-direction: column;
}

.review-summary {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}


.stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.stat-value {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.stat-value.error {
    color: #dc3545;
}

.stat-value.warning {
    color: #ffc107;
}

.review-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-controls, .sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-controls label, .sort-controls label {
    color: white;
    font-size: 0.9rem;
    white-space: nowrap;
}

.bulk-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.review-grid-container {
    flex: 1;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.1);
}

.grid-header {
    display: grid;
    grid-template-columns: 80px 60px 200px 80px 100px 60px 80px 150px 100px;
    gap: 1px;
    background: rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-cell {
    padding: 0.75rem 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.review-grid {
    max-height: 400px;
    overflow-y: auto;
}

.grid-row {
    display: grid;
    grid-template-columns: 80px 60px 200px 80px 100px 60px 80px 150px 100px;
    gap: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease;
}

.grid-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.grid-row.modified {
    background: rgba(255, 193, 7, 0.1);
}

.grid-row.error {
    background: rgba(220, 53, 69, 0.1);
}

.grid-cell {
    padding: 0.5rem;
    display: flex;
    align-items: center;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.grid-input {
    width: 100%;
    padding: 0.25rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.8rem;
}

.grid-input:focus {
    outline: none;
    border-color: #007bff;
    background: rgba(255, 255, 255, 0.15);
}

.status-cell {
    justify-content: center;
}

.status-indicators {
    display: flex;
    gap: 0.25rem;
}

.status-modified, .status-error, .status-valid {
    font-size: 0.8rem;
    cursor: help;
}

.validation-panel {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 6px;
    padding: 1rem;
    margin-top: 1rem;
}

.validation-panel h4 {
    color: #dc3545;
    margin-bottom: 1rem;
}

.validation-summary {
    margin-bottom: 1rem;
}

.validation-summary p {
    color: white;
    margin: 0;
}

.validation-list {
    max-height: 200px;
    overflow-y: auto;
}

.validation-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.validation-item strong {
    color: white;
}

.validation-item ul {
    margin: 0.5rem 0 0 1rem;
    padding: 0;
}

.validation-item li {
    color: #dc3545;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
    margin-top: auto;
}

.footer-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.preview-summary {
    margin-bottom: 1rem;
}

.preview-summary h4 {
    color: white;
    margin-bottom: 0.5rem;
}

.preview-summary ul {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    padding-left: 1.5rem;
}

.preview-data {
    max-height: 300px;
    overflow-y: auto;
}

.preview-data h4 {
    color: white;
    margin-bottom: 0.5rem;
}

.preview-data pre {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Enhanced Review Controls */
.review-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-controls select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: white;
    padding: 0.5rem;
    font-size: 0.9rem;
    min-width: 120px;
}

.filter-controls select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.filter-controls select option {
    background: #1a1a1a;
    color: white;
}

.review-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.review-stats .stat {
    background: rgba(0, 123, 255, 0.2);
    color: #007bff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

@media (max-width: 768px) {
    .review-modal-content {
        width: 95vw;
        height: 95vh;
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
    }
    
    .review-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bulk-actions {
        margin-left: 0;
        justify-content: center;
    }
    
    .grid-header, .grid-row {
        grid-template-columns: 60px 50px 120px 60px 80px 50px 60px 100px 80px;
        font-size: 0.7rem;
    }
    
    .header-cell, .grid-cell {
        padding: 0.25rem;
    }
    
    .grid-input {
        font-size: 0.7rem;
    }
    
    .footer-actions {
        flex-direction: column;
    }
}

/* DB Re-match Drawer Styles */
.rematch-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
}

.rematch-drawer.open {
    display: block;
}

.drawer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.drawer-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 600px;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.rematch-drawer.open .drawer-content {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.9);
}

.drawer-header h3 {
    color: #333;
    margin: 0;
    font-size: 1.2rem;
}

.drawer-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.drawer-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.rematch-summary {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

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


.stat-label {
    color: #666;
    font-size: 0.9rem;
}

.stat-value {
    color: #333;
    font-weight: 600;
    font-size: 0.9rem;
}

.rematch-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-controls, .search-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-controls label {
    color: #333;
    font-size: 0.9rem;
    white-space: nowrap;
}

.search-controls input {
    width: 200px;
}

.bulk-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.rematch-list {
    max-height: 500px;
    overflow-y: auto;
}

.rematch-item {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
}

.rematch-item:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.rematch-item.selected {
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.1);
}

.item-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.item-checkbox input {
    transform: scale(1.2);
}

.item-exercise {
    flex: 1;
}

.exercise-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.exercise-details {
    font-size: 0.8rem;
    color: #666;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
}

.match-info {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.02);
}

.match-info.no-match {
    text-align: center;
    color: #666;
    font-style: italic;
}

.match-exercise {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.match-exercise strong {
    color: #333;
}

.confidence-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.confidence-high {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.confidence-medium {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.confidence-low {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.confidence-manual {
    background: rgba(0, 123, 255, 0.2);
    color: #007bff;
}

.match-details {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #666;
}

.drawer-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.backfill-preview {
    color: #666;
    font-size: 0.9rem;
}

.backfill-preview.has-selection {
    color: #007bff;
    font-weight: 500;
}

.footer-actions {
    display: flex;
    gap: 0.5rem;
}

.search-results {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 1rem;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-result-item {
    padding: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background: rgba(0, 123, 255, 0.1);
}

.result-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.result-details {
    font-size: 0.8rem;
    color: #666;
}

.backfill-details {
    max-height: 400px;
    overflow-y: auto;
}

.backfill-item {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.5);
}

.backfill-item .item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0;
    border: none;
}

.match-confidence {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(0, 123, 255, 0.2);
    color: #007bff;
}

.item-changes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.change-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.change-label {
    font-weight: 600;
    color: #333;
    min-width: 60px;
}

.change-from, .change-to {
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
}

.change-from {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.change-to {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.change-arrow {
    color: #666;
    font-weight: 600;
}

@media (max-width: 768px) {
    .drawer-content {
        width: 100%;
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
    }
    
    .rematch-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-controls input {
        width: 100%;
    }
    
    .bulk-actions {
        margin-left: 0;
        justify-content: center;
    }
    
    .item-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .item-actions {
        justify-content: center;
    }
    
    .match-details {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .drawer-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .footer-actions {
        justify-content: center;
    }
}

/* Limits Enforcement Styles */
.limits-panel {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
}

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

.limits-header h4 {
    color: white;
    font-size: 1.1rem;
    margin: 0;
}

.plan-badge {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
}

.plan-name {
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
}

.limits-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.limits-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
}

.limit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.limit-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
}

.limit-value {
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
}

.limits-status {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 0.75rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-icon {
    font-size: 1rem;
}

.status-text {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

.limits-violations {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 4px;
    padding: 1rem;
}

.limits-violations h5 {
    color: #dc3545;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

#violations-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.violation-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(220, 53, 69, 0.2);
}

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

.violation-item.error {
    color: #dc3545;
}

.violation-item.warning {
    color: #ffc107;
}

.violation-icon {
    font-size: 0.8rem;
}

.violation-message {
    font-size: 0.8rem;
}

.limits-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.upgrade-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.plan-card {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    text-align: center;
    transition: transform 0.2s ease;
}

.plan-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.plan-card.featured {
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.05);
}

.plan-card h4 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.plan-features ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.plan-features li {
    padding: 0.25rem 0;
    color: #666;
    font-size: 0.9rem;
}

.plan-features li:before {
    content: "✅ ";
    margin-right: 0.5rem;
}

.plan-price {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

.adjust-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.adjust-option {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
}

.adjust-option h5 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.adjust-option p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .limits-summary {
        grid-template-columns: 1fr;
    }
    
    .limits-actions {
        flex-direction: column;
    }
    
    .upgrade-plans {
        grid-template-columns: 1fr;
    }
    
    .adjust-options {
        gap: 0.75rem;
    }
    
    .adjust-option {
        padding: 0.75rem;
    }
}

/* Job History Page Styles */
#job-history-page {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

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

.page-header h2 {
    color: white;
    font-size: 2rem;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.job-history-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.filter-controls, .search-controls, .sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-controls label, .sort-controls label {
    color: white;
    font-size: 0.9rem;
    white-space: nowrap;
}

.search-controls input {
    width: 200px;
}

.bulk-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.job-history-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    backdrop-filter: blur(10px);
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.8;
}

.stat-content {
    flex: 1;
}

.stat-value {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.job-list-container {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.job-list-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.job-list-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.job-list-title h3 {
    color: white;
    margin: 0;
    font-size: 1.2rem;
}

.job-count {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.job-list {
    max-height: 600px;
    overflow-y: auto;
}

.job-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
    transition: background-color 0.2s ease;
}

.job-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.job-item.selected {
    background: rgba(0, 123, 255, 0.1);
}

.job-item.completed {
    border-left: 4px solid #28a745;
}

.job-item.failed {
    border-left: 4px solid #dc3545;
}

.job-item.running {
    border-left: 4px solid #007bff;
}

.job-item.paused {
    border-left: 4px solid #ffc107;
}

.job-item.cancelled {
    border-left: 4px solid #6c757d;
}

.job-item-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.job-checkbox input {
    transform: scale(1.2);
}

.job-info {
    flex: 1;
}

.job-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.job-name {
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.job-id {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    font-family: monospace;
}

.job-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.job-mode {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
}

.job-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-icon {
    font-size: 1.2rem;
}

.status-text {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.job-item-body {
    margin-bottom: 1rem;
}

.job-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.job-stats .stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.job-stats .stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
}

.job-stats .stat-value {
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
}

.job-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 4px;
}

.error-icon {
    font-size: 1rem;
}

.error-message {
    color: #dc3545;
    font-size: 0.9rem;
}

.job-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.detail-section {
    margin-bottom: 2rem;
}

.detail-section h4 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.detail-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.detail-value {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.error-details {
    padding: 1rem;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 4px;
}

.error-details .error-message {
    color: #dc3545;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    #job-history-page {
        padding: 1rem;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .job-history-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-controls input {
        width: 100%;
    }
    
    .bulk-actions {
        margin-left: 0;
        justify-content: center;
    }
    
    .job-history-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .job-item-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .job-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .job-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .job-stats {
        grid-template-columns: 1fr;
    }
    
    .job-item-actions {
        justify-content: center;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Admin Dashboard Styles */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-direction: column;
    gap: .5rem;
}

.admin-header h2 {
    color: white;
    font-size: 2rem;
    margin: 0;
}

.admin-actions {
    display: flex;
    gap: 0.5rem;
}

.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-tab {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.admin-tab:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.admin-tab.active {
    color: white;
    border-bottom-color: #007bff;
    background: rgba(255, 255, 255, 0.1);
}

.admin-content {
    min-height: 500px;
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

.tier-management-section {
    max-width: 800px;
    margin: 2rem 0;
    /* padding: 2rem; */
}

.tier-management-description {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
}

.tier-management-form {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 2rem;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section h4 {
    color: #fff;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.input-with-button {
    display: flex;
    gap: 0.5rem;
}

.input-with-button .form-input {
    flex: 1;
}

.field-status {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    min-height: 1.5rem;
}

.field-status.success {
    color: #10b981;
}

.field-status.error {
    color: #ef4444;
}

.field-status .status-error {
    color: #ef4444;
}

.field-status .status-success {
    color: #10b981;
}

.field-status .status-loading {
    color: #f59e0b;
}

.user-info-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 8px;
}

.user-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-info-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-info-value {
    font-size: 1rem;
    color: #fff;
    font-weight: 500;
}

.user-info-value.tier-badge {
    font-weight: 600;
}

.tier-free {
    color: #9ca3af;
}

.tier-coffee {
    color: #f59e0b;
}

.tier-premium-basic {
    color: #3b82f6;
}

.tier-premium-pro {
    color: #8b5cf6;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.form-actions .btn {
    flex: 1;
    max-width: 200px;
}

.overview-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.overview-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.chart-container {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.chart-container h3 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.chart-placeholder {
    height: 200px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

.recent-activity {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.recent-activity h3 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 6px;
}

.activity-icon {
    font-size: 1.2rem;
    width: 2rem;
    text-align: center;
}

.activity-content {
    flex: 1;
}

.activity-message {
    color: white;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.activity-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.job-history-controls, .users-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.admin-job-list, .users-list {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    min-height: 400px;
    padding: 1rem;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease;
}

.user-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

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

.user-info {
    flex: 1;
}

.user-email {
    color: white;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.user-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.user-plan {
    background: rgba(0, 123, 255, 0.2);
    color: #007bff;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-weight: 600;
}

.user-status {
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-weight: 600;
}

.user-status.active {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.user-status.inactive {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
}

.user-actions {
    display: flex;
    gap: 0.5rem;
}

.settings-sections {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2rem;
}

.settings-section {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.settings-section h3 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-item label {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

.setting-item input[type="checkbox"] {
    margin-right: 0.5rem;
}

.settings-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.monitoring-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.monitor-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.monitor-card h3 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.health-indicators, .api-status, .metrics-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.health-item, .api-item, .metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    /* background: rgb(0 0 0 / 3%); */
    border-radius: 4px;
    flex-direction: column;
}

.health-label, .api-label, .metric-label {
    color: rgb(146 145 145);
    font-size: 0.6rem;
    text-transform: uppercase;
}

.health-value, .metric-value {
    color: #000000;
    font-weight: 600;
    font-size: 0.9rem;
}

.health-bar {
    width: 100px;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    overflow: hidden;
    margin-left: 1rem;
}

.health-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #ffc107, #dc3545);
    transition: width 0.3s ease;
}

.api-status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-ok {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.status-warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.status-error {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .admin-actions {
        justify-content: center;
    }
    
    .admin-tabs {
        flex-wrap: wrap;
    }
    
    .admin-tab {
        flex: 1;
        min-width: 120px;
    }
    
    .overview-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .overview-charts {
        grid-template-columns: 1fr;
    }
    
    .job-history-controls, .users-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .user-item {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .user-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .user-actions {
        justify-content: center;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-actions {
        flex-direction: column;
    }
    
    .monitoring-grid {
        grid-template-columns: 1fr;
    }
    
    .health-item, .api-item, .metric-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .health-bar {
        width: 100%;
        margin-left: 0;
    }
}

.weight-recommendation-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  text-align: center;
  font-size: 14px;
}

.weight-recommendation-banner strong {
  font-size: 18px;
  font-weight: 600;
}

.rec-context {
  display: block;
  font-size: 12px;
  opacity: 0.9;
  margin-top: 4px;
}

.recommendation-hint {
  background: #f0f9ff;
  border-left: 3px solid #667eea;
  padding: 8px 12px;
  margin-bottom: 12px;
  border-radius: 4px;
  font-size: 13px;
  color: #1e40af;
}

/* Usage stats styles */
.usage-stats {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
}

.usage-stats h4 {
  margin: 0 0 1rem 0;
  color: #1e293b;
  font-size: 1.1rem;
}

.usage-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 599px) {
  .usage-stats-grid {
    grid-template-columns: 1fr;
  }
}

.usage-stat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.stat-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-content {
  flex: 1;
}

.stat-label {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.stat-progress {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
  transition: width 0.3s ease;
  border-radius: 2px;
}

.progress-bar.warning {
  background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.progress-bar.danger {
  background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.usage-tier-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #f1f5f9;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.usage-tier-info #current-tier {
  font-weight: 600;
  color: #475569;
}

.upgrade-link {
  color: #3b82f6;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.upgrade-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.tier-qa-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.tier-qa-description {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.current-tier-display {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.current-tier-display h4 {
    color: #333;
    margin-bottom: 1rem;
}

.tier-badge-display {
    display: inline-block;
}

.qa-tier-badge {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.2rem;
}

.qa-tier-badge.tier-free {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #4338ca;
}

.qa-tier-badge.tier-basic {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.qa-tier-badge.tier-pro {
    background: linear-gradient(135deg, #ddd6fe 0%, #c4b5fd 100%);
    color: #5b21b6;
}

.tier-switcher {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tier-switcher h4 {
    color: #333;
    margin-bottom: 1.5rem;
}

.tier-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tier-option-btn {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.tier-option-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tier-option-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.tier-option-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.tier-option-title {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

.tier-option-benefits {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tier-option-benefits li {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.tier-option-benefits li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

.tier-qa-notes {
    background: #fffbeb;
    border: 2px solid #fbbf24;
    border-radius: 12px;
    padding: 1.5rem;
}

.tier-qa-notes h4 {
    color: #92400e;
    margin-bottom: 1rem;
}

.tier-qa-notes ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tier-qa-notes li {
    color: #78350f;
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
}

.tier-qa-notes li::before {
    content: '•';
    position: absolute;
    left: 0;
    font-weight: bold;
    color: #f59e0b;
}

.donor-status-badge {
    /* margin-left: 0.75rem; */
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.donor-status-free {
    background: linear-gradient(135deg, #e0f2fe 0%, #b3e5fc 100%);
    color: #01579b;
    border: 1px solid #4fc3f7;
}

.donor-status-basic {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    color: #4a148c;
    border: 1px solid #ba68c8;
}

.donor-status-pro {
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%);
    color: #880e4f;
    border: 1px solid #f48fb1;
}

.donor-status-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.donor-status-coffee {
    background: linear-gradient(135deg, #fff4e5 0%, #ffe8cc 100%);
    color: #b45309;
    border: 1px solid #fdba74;
}

.qa-tier-badge.tier-coffee {
    background: linear-gradient(135deg, #fff4e5 0%, #ffe8cc 100%);
    color: #b45309;
}

/* Reset button styling for substitutions modal */
.btn-reset {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-reset:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.btn-reset:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
