/* Workout Builder Styles */

/* Page Layout */
.workout-builder-main {
    padding: 2rem 0;
    min-height: calc(100vh - 80px);
    background: var(--light-bg);
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-subtitle {
    color: #64748b;
    font-size: 1.1rem;
}

/* Workout Type Selector */
.workout-type-selector {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.type-btn {
    padding: 1rem 2rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
}

.type-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.type-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.type-btn i {
    font-size: 1.2rem;
}

/* Builder Section */
.builder-section {
    display: none;
}

.builder-section.active {
    display: block;
}

/* Strength Builder Layout */
.builder-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/* Exercise Panel */
.exercise-panel {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 2rem;
}

.panel-header {
    margin-bottom: 1.5rem;
}

.panel-header h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.search-bar {
    position: relative;
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all var(--transition-speed);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(93, 95, 239, 0.1);
}

/* Exercise Filters */
.exercise-filters {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Filter Dropdown */
.filter-dropdown {
    position: relative;
}

.filter-dropdown-toggle {
    width: 100%;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-speed);
}

.filter-dropdown-toggle:hover {
    border-color: var(--primary-color);
    background: #f8fafc;
}

.filter-dropdown-toggle.active {
    border-color: var(--primary-color);
    background: #f8fafc;
    box-shadow: 0 0 0 3px rgba(93, 95, 239, 0.1);
}

.filter-dropdown-toggle i {
    font-size: 0.85rem;
    transition: transform var(--transition-speed);
}

.filter-dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    z-index: 100;
    display: none;
}

.filter-dropdown-content.active {
    display: block;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.checkbox-group::-webkit-scrollbar {
    width: 6px;
}

.checkbox-group::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.checkbox-group::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-speed);
    font-size: 0.9rem;
}

.checkbox-label:hover {
    background: #f1f5f9;
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: var(--primary-color);
}

.exercise-filters select {
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    width: 100%;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.exercise-filters select:hover {
    border-color: var(--primary-color);
    background: #f8fafc;
}

.exercise-filters select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(93, 95, 239, 0.1);
}

.btn-clear-filters {
    padding: 0.75rem 1rem;
    background: #f3f4f6;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #64748b;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

.btn-clear-filters:hover {
    background: #e2e8f0;
    color: #475569;
}

.btn-clear-filters i {
    font-size: 0.9rem;
}

/* Exercise List */
.exercise-list {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.exercise-list::-webkit-scrollbar {
    width: 6px;
}

.exercise-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.exercise-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* Exercise Card */
.exercise-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-speed);
    position: relative;
}

.exercise-card:hover {
    border-color: var(--primary-color);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.exercise-card.dragging {
    opacity: 0.5;
}

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

.exercise-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.muscle-tag {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.exercise-card-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: #64748b;
}

.equipment i {
    margin-right: 0.25rem;
}

.level {
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.level-beginner {
    background: #d1fae5;
    color: #065f46;
}

.level-intermediate {
    background: #fed7aa;
    color: #92400e;
}

.level-advanced {
    background: #fecaca;
    color: #991b1b;
}

.exercise-type {
    font-style: italic;
}

.btn-add-exercise {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--transition-speed);
}

.exercise-card:hover .btn-add-exercise {
    opacity: 1;
}

/* Workout Panel */
.workout-panel {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.btn-clear {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition-speed);
}

.btn-clear:hover {
    background: #fecaca;
}

.workout-name-input {
    margin-bottom: 1.5rem;
}

.workout-name-input input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
}

/* Workout Info Box */
.workout-info-box {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #e8f4f8;
    border: 1px solid #bee3f8;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.workout-info-box i {
    color: #0969da;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.workout-info-box .info-content {
    flex: 1;
}

.workout-info-box strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #334155;
}

.workout-info-box ol {
    margin: 0;
    padding-left: 1.25rem;
    color: #64748b;
}

.workout-info-box ol li {
    margin-bottom: 0.25rem;
}

/* Workout Exercises */
.workout-exercises {
    flex: 1;
    min-height: 400px;
    border: 2px dashed #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    transition: all var(--transition-speed);
}

.workout-exercises.drag-over {
    border-color: var(--primary-color);
    background: rgba(93, 95, 239, 0.05);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #94a3b8;
    font-size: 1.1rem;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Workout Exercise Item */
.workout-exercise-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

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

.workout-exercise-item h4 {
    margin: 0;
    font-size: 1.1rem;
}

.btn-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    transition: all var(--transition-speed);
}

.btn-remove:hover {
    transform: scale(1.1);
}

.exercise-details {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.detail {
    background: white;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #475569;
}

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

.btn-edit {
    background: none;
    border: 1px solid #e2e8f0;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition-speed);
}

.btn-edit:hover {
    background: #f1f5f9;
}

/* Workout Summary */
.workout-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.summary-item {
    text-align: center;
}

.summary-label {
    display: block;
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Workout Actions */
.workout-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary {
    background: #e2e8f0;
    color: #475569;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    flex: 1;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(93, 95, 239, 0.3);
}

/* Cardio Builder */
.cardio-container {
    max-width: 800px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.cardio-types {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 3rem;
}

.cardio-type-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.cardio-type-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
}

.cardio-type-card.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.cardio-type-card i {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* Cardio Form */
.cardio-form {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #334155;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all var(--transition-speed);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(93, 95, 239, 0.1);
}

.duration-input,
.distance-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.duration-input input,
.distance-input input {
    flex: 1;
}

.timer-btn {
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

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

/* Cardio Stats */
.cardio-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-item i {
    font-size: 2rem;
    color: var(--primary-color);
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: #64748b;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
}

/* Rest Timer Modal */
.rest-timer-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.rest-timer-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.rest-timer-content h3 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.rest-timer-display {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 2rem;
}

.rest-progress-ring {
    transform: rotate(-90deg);
}

.rest-ring-bg {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 8;
}

.rest-ring-animate {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 8;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.rest-time-remaining {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.rest-timer-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.rest-timer-controls .btn {
    padding: 0.5rem 1rem;
}

/* Rest Selector */
.rest-selector {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.rest-selector label {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
    display: block;
    font-size: 0.95rem;
}

.rest-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-top: 0.75rem;
}

@media (max-width: 600px) {
    .rest-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

.rest-btn {
    padding: 0.5rem 1rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-speed);
    font-weight: 500;
    min-width: 60px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

/* Better touch targets on mobile */
@media (max-width: 768px) {
    .rest-btn {
        min-height: 44px; /* iOS recommended touch target */
        font-size: 0.9rem;
    }
}

.rest-btn:hover {
    background: #e2e8f0;
}

.rest-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.custom-rest-input {
    margin-top: 1rem;
    width: 100%;
    max-width: 200px;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    background-color: #f8fafc;
}

.custom-rest-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: white;
}

/* Modal - Full Viewport Coverage */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 0; /* Changed from 20px to 0 */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0;
    box-sizing: border-box;
}

/* Force full coverage - remove right/bottom positioning */
.modal {
    right: auto !important;
    bottom: auto !important;
}

.modal.show {
    display: flex !important;
}

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

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    .modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
    }
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 2.5rem;
    max-width: 700px;
    width: 90%;
    max-height: calc(100vh - 40px); /* Account for margin */
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 10002 !important;
    margin: 20px; /* Add margin to replace modal padding */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Desktop modal improvements */
@media (min-width: 769px) {
    .modal-content {
        width: 700px;
        padding: 3rem;
    }
}

/* Mobile-specific modal adjustments */
@media (max-width: 768px) {
    .modal {
        padding: 0;
        align-items: stretch;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-content {
        width: 100%;
        max-width: 100%;
        height: 100%;
        min-height: 100vh;
        max-height: none;
        border-radius: 0;
        padding: 1.5rem;
        padding-top: 4rem; /* Space for fixed close button */
        padding-bottom: 3rem; /* Extra bottom padding for scrolling */
        margin: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
        top: 0;
        transform: none;
        display: flex;
        flex-direction: column;
    }
    
    .modal-close {
        position: fixed;
        top: 1rem;
        right: 1rem;
        z-index: 10003;
        background: white;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        font-size: 1.2rem;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
    }
    
    .modal-content {
        padding: 1rem;
        padding-top: 3rem; /* Space for fixed close button */
        width: 100vw;
        height: 100vh;
        min-height: 100vh;
    }
    
    .modal-content h3 {
        font-size: 1.25rem;
        margin-top: 0;
    }
    
    .set-configuration input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Ensure button is easily tappable on mobile */
    .modal-content .btn-primary {
        min-height: 48px;
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
        width: 100%;
        margin-top: 1.5rem;
    }
    
    /* Better spacing for modal elements on mobile */
    .exercise-details {
        margin: 1rem 0;
    }
    
    .set-configuration {
        margin: 1.5rem 0;
    }
    
    .sets-input,
    .reps-input,
    .weight-input {
        margin-bottom: 1.25rem;
    }
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 1.75rem;
    cursor: pointer;
    color: #64748b;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    line-height: 1;
}

.modal-close:hover {
    color: var(--dark);
    background-color: #f1f5f9;
}

.modal-content h3 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: #1e293b;
    padding-right: 2rem; /* Space for close button */
}

.exercise-details {
    margin: 2rem 0;
    background-color: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: #64748b;
    font-size: 0.9rem;
}

.detail-row span:last-child {
    color: #1e293b;
    font-weight: 500;
}

.set-configuration {
    margin: 2.5rem 0;
}

.set-configuration h4 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    color: #1e293b;
}

.sets-input,
.reps-input,
.weight-input {
    margin-bottom: 1.5rem;
}

.sets-input label,
.reps-input label,
.weight-input label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
}

.sets-input input,
.reps-input input,
.weight-input input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    background-color: #f8fafc;
}

.sets-input input:focus,
.reps-input input:focus,
.weight-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: white;
}

/* Desktop layout improvements */
@media (min-width: 769px) {
    .set-configuration {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
    
    .set-configuration h4 {
        grid-column: 1 / -1;
    }
    
    .sets-input {
        grid-column: 1;
    }
    
    .reps-input {
        grid-column: 2;
    }
    
    .weight-input {
        grid-column: 1 / -1;
    }
    
    .rest-selector {
        grid-column: 1 / -1;
        margin-top: 0.5rem;
    }
    
    /* Desktop button styling */
    .modal-content .btn-primary {
        width: 100%;
        padding: 1rem 2rem;
        font-size: 1.1rem;
        font-weight: 600;
        margin-top: 2rem;
        height: auto;
        min-height: 52px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }
}

/* Success Modal */
.success-content {
    text-align: center;
}

.success-icon {
    font-size: 4rem;
    color: #10b981;
    margin-bottom: 1rem;
}

.success-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.success-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Workout Mode */
.workout-mode {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 2rem;
    margin-top: 2rem;
}

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

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

.btn-danger:hover {
    background: #dc2626;
}

.current-exercise {
    text-align: center;
    padding: 2rem;
    background: #f8fafc;
    border-radius: 8px;
}

.current-exercise h3 {
    font-size: 2rem;
    margin-bottom: 2rem;
}

.set-tracker h4 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.set-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
}

.set-actions input {
    width: 150px;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-speed);
    z-index: 1001;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.error {
    background: #ef4444;
}

.toast.success {
    background: #10b981;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .builder-layout {
        grid-template-columns: 1fr;
    }
    
    .exercise-panel {
        order: 2;
    }
    
    .workout-panel {
        order: 1;
    }
}

@media (max-width: 768px) {
    .workout-type-selector {
        flex-direction: column;
    }
    
    .type-btn {
        width: 100%;
    }
    
    .cardio-types {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .exercise-filters {
        gap: 0.75rem;
    }
    
    .filter-dropdown-toggle {
        padding: 0.625rem 0.875rem;
        font-size: 0.9rem;
    }
    
    .filter-dropdown-content {
        padding: 0.75rem;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
        max-height: 160px;
    }
    
    .checkbox-label {
        font-size: 0.85rem;
        padding: 0.375rem 0.5rem;
    }
    
    .checkbox-label input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }
    
    .workout-info-box {
        font-size: 0.85rem;
        padding: 0.75rem;
    }
    
    .workout-info-box i {
        font-size: 1rem;
    }
    
    .workout-summary {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .rest-options {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 480px) {
    .cardio-types {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cardio-type-card {
        padding: 1rem 0.5rem;
    }
    
    .cardio-type-card i {
        font-size: 1.5rem;
    }
    
    .cardio-type-card span {
        font-size: 0.85rem;
    }
}

/* Drag and Drop Enhancement */
.workout-exercises.drag-over {
    background-color: #e8f4f8;
    border-color: #007bff;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
}

.exercise-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.exercise-card {
    transition: transform 0.2s ease;
}

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

/* Mobile-specific exercise cards */
@media (max-width: 768px) {
    .exercise-card {
        cursor: pointer;
        position: relative;
        padding-right: 50px;
    }
    
    .exercise-card:active {
        transform: scale(0.98);
    }
    
    .btn-add-exercise {
        position: absolute;
        top: 50%;
        right: 10px;
        transform: translateY(-50%);
        width: 35px;
        height: 35px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 2;
    }
    
    .workout-exercises .empty-state {
        padding: 40px 20px;
        text-align: center;
        color: #666;
    }
    
    .workout-exercises .empty-state i {
        font-size: 48px;
        margin-bottom: 10px;
        color: #ccc;
        display: block;
    }
    
    /* Disable drag on mobile */
    .exercise-card {
        -webkit-user-drag: none;
        user-drag: none;
    }
    
    /* Better mobile tap targets */
    .exercise-card,
    .btn-add-exercise {
        -webkit-tap-highlight-color: rgba(0, 123, 255, 0.1);
    }
}

/* Loading message */
.loading-message {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}