/* Session Pages - ActiveSession and WorkoutHistory */

/* Active Session Page - Compact Design */
.active-session-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Compact Header */
.session-header-compact {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
}

.btn-back-compact {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.btn-back-compact:hover {
    color: var(--accent-primary);
}

.session-title-compact {
    flex: 1;
}

.session-title-compact h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
}

.session-timer {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-finish-compact {
    background: #198754;
    border: none;
    color: white;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.2s;
}

.btn-finish-compact:hover {
    background: #157347;
    transform: scale(1.05);
}

/* Progress Bar Compact */
.progress-bar-compact {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
    position: relative;
    height: 36px;
    overflow: hidden;
}

.progress-fill-compact {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), #198754);
    transition: width 0.4s ease;
    border-radius: 20px;
}

.progress-text-compact {
    position: relative;
    z-index: 1;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Exercises Compact */
.exercises-compact {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.exercise-compact {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem;
    transition: all 0.2s;
}

.exercise-compact.all-completed {
    border-color: #198754;
    background: rgba(25, 135, 84, 0.08);
}

.exercise-title-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.exercise-header-with-image {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.exercise-actions-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-delete-exercise-compact {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: all 0.2s;
    opacity: 0.6;
}

.btn-delete-exercise-compact:hover {
    color: #dc3545;
    opacity: 1;
    transform: scale(1.1);
}

.exercise-image-compact {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: contain;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    padding: 2px;
}

.exercise-name-compact {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.exercise-name-compact:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

.btn-check-all {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s;
}

.btn-check-all:hover {
    color: #198754;
    transform: scale(1.1);
}

.exercise-compact.all-completed .btn-check-all {
    color: #198754;
}

/* Sets Compact */
.sets-compact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.set-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    transition: all 0.2s;
}

.set-compact:hover {
    background: var(--hover-bg);
}

.set-compact.set-completed {
    background: rgba(25, 135, 84, 0.15);
    border-left: 3px solid #198754;
}

.set-info-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.set-num-compact {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    width: 20px;
    text-align: center;
}

.input-compact {
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    font-size: 0.95rem;
    text-align: center;
    background: var(--input-bg);
    color: var(--text-primary);
    font-weight: 600;
}

.input-compact:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Hide number input spinner arrows */
.input-compact::-webkit-outer-spin-button,
.input-compact::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

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

.input-weight {
    width: 60px;
}

.input-reps {
    width: 50px;
}

.separator-compact {
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.label-compact {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.set-actions-compact {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-check-compact {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s;
}

.btn-check-compact:hover {
    color: #198754;
    transform: scale(1.1);
}

.btn-check-compact.checked {
    color: #198754;
}

.btn-delete-compact {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s;
}

.btn-delete-compact:hover {
    color: #dc3545;
    transform: scale(1.1);
}

.btn-add-set-compact {
    margin-top: 0.25rem;
    padding: 0.5rem;
    background: var(--hover-bg);
    color: var(--text-secondary);
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.btn-add-set-compact:hover {
    background: var(--border-color);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-add-exercise-compact {
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--accent-primary);
    color: white;
    border: 1px solid var(--accent-primary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-add-exercise-compact:hover {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    transform: scale(1.02);
}

/* Exercise Notes Compact */
.exercise-notes-compact {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.notes-textarea {
    width: 100%;
    min-height: 60px;
    padding: 0.5rem;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.4;
    resize: vertical;
    transition: border-color 0.2s;
}

.notes-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.notes-textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Notes Button */
.btn-notes {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-notes:hover {
    background: var(--hover-bg);
    color: var(--accent-primary);
    transform: scale(1.1);
}

/* Notes Modal */
.notes-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-in;
}

.notes-modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

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

.notes-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.notes-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-close-notes {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-close-notes:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.notes-modal-body {
    padding: 1.5rem;
}

.notes-modal-textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.75rem;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s;
}

.notes-modal-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.notes-modal-textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.notes-modal-footer {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.notes-character-count {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-weight: 500;
}

.btn-notes-save {
    padding: 0.5rem 1.25rem;
    background: var(--accent-primary);
    color: white;
    border: 1px solid var(--accent-primary);
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-notes-save:hover {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    transform: translateY(-1px);
}

.btn-notes-cancel {
    padding: 0.5rem 1.25rem;
    background: var(--card-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-notes-cancel:hover {
    background: var(--hover-bg);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-delete-confirm {
    padding: 0.5rem 1.25rem;
    background: #dc3545;
    color: white;
    border: 1px solid #dc3545;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete-confirm:hover {
    background: #c82333;
    border-color: #c82333;
    transform: scale(1.02);
}

/* Add Exercise Modal */
.add-exercise-modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

.add-exercise-modal-content .notes-modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

/* Actions Compact */
.actions-compact {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-complete-compact {
    width: 100%;
    padding: 0.75rem;
    background: #198754;
    color: white;
    border: 1px solid #198754;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-complete-compact:hover {
    background: #157347;
    border-color: #157347;
    transform: scale(1.02);
}

.btn-abandon-compact {
    width: 100%;
    padding: 0.75rem;
    background: var(--card-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-abandon-compact:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* Celebration Animation */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in;
}

/* Level-specific backgrounds */
.celebration-level-0 {
    background: rgba(60, 60, 60, 0.95);
}

.celebration-level-1 {
    background: rgba(80, 60, 50, 0.9);
}

.celebration-level-2 {
    background: rgba(100, 80, 50, 0.9);
}

.celebration-level-3 {
    background: rgba(50, 80, 120, 0.9);
}

.celebration-level-4 {
    background: rgba(255, 100, 50, 0.85);
}

.celebration-level-5 {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.9), rgba(255, 20, 147, 0.9));
}

.celebration-level-6 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.95), rgba(255, 140, 0, 0.95), rgba(255, 69, 0, 0.95));
    animation: fadeIn 0.3s ease-in, rainbowPulse 2s ease-in-out infinite;
}

@keyframes rainbowPulse {
    0%, 100% {
        filter: brightness(1) hue-rotate(0deg);
    }
    50% {
        filter: brightness(1.2) hue-rotate(20deg);
    }
}

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

.celebration-content {
    text-align: center;
    z-index: 10000;
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.celebration-icon {
    font-size: 8rem;
    margin-bottom: 1rem;
}

/* Level-specific icon animations */
.celebration-level-0 .celebration-icon {
    animation: slowFade 2s ease-in-out;
    opacity: 0.5;
}

.celebration-level-1 .celebration-icon {
    animation: disappointed 1.5s ease-in-out infinite;
}

.celebration-level-2 .celebration-icon {
    animation: shakeHead 1s ease-in-out infinite;
}

.celebration-level-3 .celebration-icon {
    animation: nod 1.5s ease-in-out infinite;
}

.celebration-level-4 .celebration-icon {
    animation: burn 0.8s ease-in-out infinite;
}

.celebration-level-5 .celebration-icon {
    animation: spin360 2s ease-in-out infinite;
}

.celebration-level-6 .celebration-icon {
    animation: epicScale 1s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.8));
}

@keyframes slowFade {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.5; }
}

@keyframes disappointed {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

@keyframes shakeHead {
    0%, 100% { transform: rotate(-15deg); }
    50% { transform: rotate(15deg); }
}

@keyframes nod {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.05); }
}

@keyframes burn {
    0%, 100% { transform: scale(1) rotate(-5deg); }
    25% { transform: scale(1.1) rotate(5deg); }
    75% { transform: scale(1.05) rotate(-3deg); }
}

@keyframes spin360 {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes epicScale {
    0%, 100% {
        transform: scale(1) rotate(-10deg);
    }
    25% {
        transform: scale(1.3) rotate(10deg);
    }
    75% {
        transform: scale(1.2) rotate(-5deg);
    }
}

.celebration-title {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    margin: 0 0 1rem 0;
}

/* Level-specific title styles */
.celebration-level-0 .celebration-title {
    color: #888;
    text-shadow: none;
    animation: none;
}

.celebration-level-1 .celebration-title,
.celebration-level-2 .celebration-title {
    color: #ffb347;
    text-shadow: 0 0 10px rgba(255, 179, 71, 0.5);
    animation: subtle 2s ease-in-out infinite;
}

.celebration-level-3 .celebration-title {
    color: #4ec9ff;
    text-shadow: 0 0 15px rgba(78, 201, 255, 0.6);
    animation: pulse 1.5s ease-in-out infinite;
}

.celebration-level-4 .celebration-title {
    color: #ff6b35;
    text-shadow: 0 0 20px rgba(255, 107, 53, 0.8);
    animation: fireGlow 1s ease-in-out infinite;
}

.celebration-level-5 .celebration-title {
    background: linear-gradient(90deg, #ff6ec7, #ffdb58, #00d9ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 2s linear infinite;
    background-size: 200% 100%;
}

.celebration-level-6 .celebration-title {
    background: linear-gradient(90deg, #ffd700, #ff8c00, #ff1493, #ffd700);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: epicShimmer 1.5s linear infinite, epicBounce 0.5s ease-in-out infinite;
    background-size: 300% 100%;
    font-size: 3.5rem;
    text-shadow: 0 0 40px rgba(255, 215, 0, 1);
}

@keyframes subtle {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; }
}

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

@keyframes fireGlow {
    0%, 100% {
        transform: scale(1);
        text-shadow: 0 0 20px rgba(255, 107, 53, 0.8);
    }
    50% {
        transform: scale(1.08);
        text-shadow: 0 0 30px rgba(255, 107, 53, 1), 0 0 50px rgba(255, 69, 0, 0.5);
    }
}

@keyframes shimmer {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

@keyframes epicShimmer {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

@keyframes epicBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.celebration-message {
    font-size: 1.5rem;
    color: #fff;
    font-weight: 600;
    margin: 0;
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 9998;
}

.confetti {
    position: absolute;
    top: -10%;
    width: 10px;
    height: 10px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #ffeaa7, #dfe6e9);
    animation: confettiFall 3s linear forwards;
    opacity: 0.8;
}

.confetti:nth-child(2n) {
    background: linear-gradient(45deg, #a29bfe, #fd79a8, #fdcb6e, #e17055);
}

.confetti:nth-child(3n) {
    background: linear-gradient(45deg, #00b894, #00cec9, #0984e3, #6c5ce7);
    width: 8px;
    height: 8px;
}

.confetti:nth-child(4n) {
    border-radius: 50%;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .active-session-container {
        padding: 0.5rem;
    }

    .session-header-compact {
        padding: 0.75rem;
    }

    .session-title-compact h1 {
        font-size: 1.1rem;
    }

    .input-weight,
    .input-reps {
        width: 55px;
        font-size: 0.9rem;
    }

    .celebration-title {
        font-size: 2rem;
    }

    .celebration-message {
        font-size: 1.2rem;
    }

    .celebration-icon {
        font-size: 5rem;
    }
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.header-left {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.btn-back-nav {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: background 0.2s;
    flex-shrink: 0;
}

.btn-back-nav:hover {
    background: #5a6268;
}

.header-info h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.session-meta {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

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

.btn-abandon {
    padding: 0.6rem 1.25rem;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
}

.btn-abandon:hover {
    background: #5a6268;
}

.btn-complete {
    padding: 0.6rem 1.25rem;
    background: #198754;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
}

.btn-complete:hover {
    background: #157347;
}

.exercises-overview {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.exercise-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
}

.exercise-card.expanded {
    border-color: var(--accent-primary);
}

.exercise-card.completed {
    border-color: #198754;
    background: rgba(25, 135, 84, 0.15);
}

.exercise-card.completed .exercise-header {
    background: rgba(25, 135, 84, 0.15);
}

.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    cursor: pointer;
    background: var(--bg-tertiary);
    transition: background 0.2s;
}

.exercise-header:hover {
    background: var(--bg-secondary);
}

.exercise-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    cursor: pointer;
}

.exercise-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.exercise-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
}

.exercise-check {
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.exercise-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.exercise-meta {
    margin: 0.25rem 0 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.progress-indicator {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.progress-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: conic-gradient(var(--accent-primary) var(--progress), #e9ecef var(--progress));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.progress-circle::before {
    content: '';
    position: absolute;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--card-bg);
}

.progress-circle span {
    position: relative;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.sets-container {
    padding: 1.25rem;
    background: var(--card-bg);
}

.sets-table-header {
    display: grid;
    grid-template-columns: 40px 80px 80px 50px 60px;
    gap: 0.75rem;
    padding: 0.75rem;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.set-row {
    display: grid;
    grid-template-columns: 40px 80px 80px 50px 60px;
    gap: 0.75rem;
    padding: 0.75rem;
    align-items: center;
    border-radius: 6px;
    transition: background 0.2s;
}

.set-row:hover {
    background: var(--bg-secondary);
}

.set-row.completed {
    background: rgba(25, 135, 84, 0.15);
}

.set-row.completed:hover {
    background: rgba(25, 135, 84, 0.25);
}

.set-number {
    font-weight: 600;
    font-size: 1.1rem;
    text-align: center;
}

.set-input {
    padding: 0.4rem;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    font-size: 0.9rem;
    width: 100%;
    text-align: center;
    background: var(--input-bg);
    color: var(--text-primary);
}

.set-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.set-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.set-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
}

.set-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.btn-delete-set {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    font-size: 1rem;
    transition: color 0.2s;
}

.btn-delete-set:hover {
    color: #bb2d3b;
}

.btn-add-set {
    margin-top: 1rem;
    padding: 0.6rem 1rem;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s;
    display: flex;
    align-items: center;
}

.btn-add-set:hover {
    background: #5a6268;
}

.overall-progress {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    background: var(--bg-secondary);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), rgba(124, 105, 255, 0.65));
    transition: width 0.3s;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
}

/* Workout History Page */
.history-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

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

.history-header h1 {
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
}

.btn-back {
    padding: 0.6rem 1.25rem;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
}

.btn-back:hover {
    background: #5a6268;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg);
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.empty-icon {
    font-size: 4rem;
    color: var(--border-color);
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.btn-primary {
    padding: 0.75rem 2rem;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--accent-secondary);
}

.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.session-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.session-card:hover {
    border-color: var(--accent-primary);
}

.session-card .session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-bottom: none;
    margin-bottom: 0;
}

.session-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.session-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.session-card .session-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.btn-continue {
    padding: 0.5rem 1rem;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.btn-continue:hover {
    background: var(--accent-secondary);
}

.session-details {
    padding: 1.5rem;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
}

.exercises-summary {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.exercise-detail {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 1rem;
}

.exercise-detail-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.exercise-detail-image {
    width: 45px;
    height: 45px;
    border-radius: 6px;
    object-fit: contain;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    padding: 2px;
    flex-shrink: 0;
}

.exercise-detail h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.exercise-history-name {
    cursor: pointer;
    display: inline-block;
    width: fit-content;
    color: var(--accent-primary);
    text-decoration: none;
    transition: all 0.2s;
}

.exercise-history-name:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

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

.set-item {
    background: var(--card-bg);
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.set-label {
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

.set-value {
    color: var(--text-primary);
}

.badge {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
}

.bg-success {
    background: #198754;
    color: white;
}

.bg-secondary {
    background: #6c757d;
    color: white;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .session-header {
        flex-direction: column;
        gap: 1rem;
    }

    .header-actions {
        width: 100%;
    }

    .btn-abandon, .btn-complete {
        flex: 1;
    }

    .sets-table-header {
        grid-template-columns: 35px 70px 70px 40px 50px;
        gap: 0.5rem;
        font-size: 0.75rem;
    }

    .set-row {
        grid-template-columns: 35px 70px 70px 40px 50px;
        gap: 0.5rem;
    }

    .set-number {
        font-size: 1rem;
    }

    .set-input {
        font-size: 0.85rem;
        padding: 0.3rem;
    }

    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .sets-grid {
        grid-template-columns: 1fr;
    }
}

/* Set completion status in history */
.set-item.completed {
    background: rgba(25, 135, 84, 0.1);
    border-left: 3px solid #198754;
}

.set-item.incomplete {
    background: rgba(108, 117, 125, 0.1);
    border-left: 3px solid #6c757d;
}

.set-item.completed .set-label {
    color: #198754;
    font-weight: 500;
}

.set-item.incomplete .set-label {
    color: var(--text-secondary);
}

/* Exercise Notes in History */
.exercise-notes-history {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.notes-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.notes-content {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Alternative Exercise Switching */
.exercise-name-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.alternative-switcher {
    position: relative;
    display: inline-flex;
    margin-left: 0.5rem;
}

.alternative-dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: transparent;
}

.btn-alternative-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--accent-primary);
    padding: 0.375rem 0.625rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-alternative-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-alternative-toggle:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.alternative-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    min-width: 280px;
    max-width: 320px;
    overflow: hidden;
    animation: dropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 400px;
    overflow-y: auto;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.alternative-dropdown-header {
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.alternative-option {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid rgba(var(--border-rgb, 0, 0, 0), 0.06);
    position: relative;
}

.alternative-option:last-child {
    border-bottom: none;
}

.alternative-option:hover {
    background: var(--bg-hover);
}

.alternative-option.current {
    background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.08) 0%, rgba(var(--accent-rgb), 0.04) 100%);
    border-left: 3px solid var(--accent-primary);
    padding-left: calc(1rem - 3px);
}

.alternative-option.current:hover {
    background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.12) 0%, rgba(var(--accent-rgb), 0.06) 100%);
}

.alternative-image {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(var(--border-rgb, 0, 0, 0), 0.1);
}

.alternative-option .alternative-name {
    flex: 1;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

.alternative-option.current .alternative-name {
    color: var(--accent-primary);
    font-weight: 600;
}

.current-indicator {
    color: var(--accent-primary);
    font-size: 1.125rem;
    flex-shrink: 0;
}

/* Responsive adjustments for alternative switching */
@media (max-width: 768px) {
    .alternative-dropdown {
        min-width: 260px;
        max-width: 280px;
        left: 50%;
        transform: translateX(-50%);
    }

    .alternative-dropdown-header {
        padding: 0.75rem 0.875rem;
        font-size: 0.8125rem;
    }

    .alternative-option {
        padding: 0.75rem 0.875rem;
        gap: 0.75rem;
    }

    .alternative-option.current {
        padding-left: calc(0.875rem - 3px);
    }

    .alternative-image {
        width: 36px;
        height: 36px;
    }

    .alternative-option .alternative-name {
        font-size: 0.875rem;
    }

    .btn-alternative-toggle {
        padding: 0.3125rem 0.5rem;
        font-size: 0.875rem;
    }
}

