/**
 * JWARDMUSCLE - Training Program Builder Styles
 * Workout Program Creation Interface
 * Version: 1.0.0
 * Date: January 11, 2026
 */

/* ============================================
   PROGRAM BUILDER CONTAINER
   ============================================ */

.program-builder-section {
    padding: 100px 0;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.05) 0%, rgba(45, 91, 255, 0.05) 100%);
}

.program-builder-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.builder-header {
    text-align: center;
    margin-bottom: 60px;
}

.builder-header h2 {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
}

.builder-header p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   BUILDER LAYOUT
   ============================================ */

.builder-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    align-items: start;
}

/* ============================================
   EXERCISE LIBRARY SIDEBAR
   ============================================ */

.exercise-library-panel {
    background: rgba(30, 64, 175, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 20px;
    padding: 25px;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

.library-header {
    margin-bottom: 20px;
}

.library-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
}

.exercise-search {
    width: 100%;
    padding: 12px 15px;
    background: rgba(30, 64, 175, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    margin-bottom: 15px;
}

.exercise-search::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.exercise-search:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.2);
}

/* Category filters */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.category-btn {
    padding: 8px 15px;
    background: rgba(30, 64, 175, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: capitalize;
}

.category-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
}

.category-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2d5bff 100%);
    border-color: #3b82f6;
    color: #fff;
}

/* Exercise library list */
#exercise-library {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.exercise-card {
    background: rgba(30, 64, 175, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 15px;
    cursor: grab;
    transition: all 0.3s ease;
}

.exercise-card:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: #3b82f6;
    transform: translateX(5px);
}

.exercise-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.exercise-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.exercise-difficulty {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
}

.exercise-equipment {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: capitalize;
}

.exercise-name {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.exercise-description {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
    line-height: 1.4;
}

.exercise-card-footer {
    display: flex;
    gap: 8px;
}

.btn-view-details,
.btn-quick-add {
    flex: 1;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-view-details {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

.btn-view-details:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
}

.btn-quick-add {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.btn-quick-add:hover {
    background: rgba(34, 197, 94, 0.3);
    border-color: #22c55e;
}

.no-exercises {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    padding: 20px;
}

/* ============================================
   PROGRAM BUILDER MAIN AREA
   ============================================ */

.program-builder-main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Program info form */
.program-info-panel {
    background: rgba(30, 64, 175, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 20px;
    padding: 30px;
}

.program-info-panel h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
}

.program-info-form {
    display: grid;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 150px;
    gap: 20px;
}

.program-info-form input,
.program-info-form textarea {
    width: 100%;
    padding: 15px;
    background: rgba(30, 64, 175, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
}

.program-info-form textarea {
    min-height: 100px;
    resize: vertical;
}

.program-info-form input::placeholder,
.program-info-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.program-info-form input:focus,
.program-info-form textarea:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.2);
}

/* Program workouts */
.program-workouts-panel {
    background: rgba(30, 64, 175, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 20px;
    padding: 30px;
}

.workouts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.workouts-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

#add-workout-day {
    padding: 12px 25px;
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 12px;
    color: #22c55e;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#add-workout-day:hover {
    background: rgba(34, 197, 94, 0.3);
    border-color: #22c55e;
    transform: translateY(-2px);
}

#program-workouts {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.workout-card {
    background: rgba(30, 64, 175, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 15px;
    padding: 20px;
}

.workout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.workout-name-input {
    flex: 1;
    padding: 10px 15px;
    background: rgba(30, 64, 175, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-delete-workout {
    padding: 8px 20px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    color: #ef4444;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-delete-workout:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
}

.workout-exercises {
    min-height: 100px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.workout-exercises.drag-over {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    border-style: solid;
}

.no-exercises-added {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    padding: 20px;
}

.workout-exercise {
    background: rgba(30, 64, 175, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.workout-exercise:last-child {
    margin-bottom: 0;
}

.exercise-info {
    flex: 1;
}

.exercise-info strong {
    color: #fff;
    font-size: 1rem;
    display: block;
    margin-bottom: 10px;
}

.exercise-params {
    display: flex;
    gap: 10px;
}

.exercise-params input {
    width: 80px;
    padding: 8px 10px;
    background: rgba(30, 64, 175, 0.3);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    text-align: center;
}

.exercise-params input:focus {
    outline: none;
    border-color: #3b82f6;
}

.btn-remove-exercise {
    padding: 8px 15px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #ef4444;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-remove-exercise:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
}

.no-workouts {
    text-align: center;
    padding: 40px 20px;
}

.no-workouts p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
}

/* Save button */
.program-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
}

#save-program {
    padding: 15px 40px;
    background: linear-gradient(135deg, #3b82f6 0%, #2d5bff 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#save-program:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(45, 91, 255, 0.4);
}

/* ============================================
   EXERCISE DETAILS MODAL
   ============================================ */

.exercise-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: modalFadeIn 0.3s ease;
}

.exercise-details-modal .modal-content {
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.95) 0%, rgba(45, 91, 255, 0.95) 100%);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(59, 130, 246, 0.5);
    border-radius: 30px;
    padding: 40px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 50%;
    color: #ef4444;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
    transform: rotate(90deg);
}

.modal-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
}

.exercise-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.badge {
    padding: 6px 15px;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    color: #3b82f6;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: capitalize;
}

.exercise-description-full {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

.modal-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin: 25px 0 15px;
}

.exercise-instructions {
    list-style: none;
    counter-reset: step;
    padding: 0;
    margin-bottom: 25px;
}

.exercise-instructions li {
    counter-increment: step;
    padding: 15px 20px 15px 50px;
    background: rgba(30, 64, 175, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
    position: relative;
    line-height: 1.6;
}

.exercise-instructions li::before {
    content: counter(step);
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #3b82f6 0%, #2d5bff 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
}

.exercise-video {
    margin: 25px 0;
    border-radius: 15px;
    overflow: hidden;
}

.exercise-video video {
    width: 100%;
    display: block;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1200px) {
    .builder-layout {
        grid-template-columns: 300px 1fr;
    }
}

@media (max-width: 968px) {
    .builder-layout {
        grid-template-columns: 1fr;
    }

    .exercise-library-panel {
        position: static;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .program-builder-section {
        padding: 60px 0;
    }

    .builder-header h2 {
        font-size: 2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .workout-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .exercise-params {
        flex-wrap: wrap;
    }

    .exercise-params input {
        width: calc(50% - 5px);
    }
}

@media (max-width: 480px) {
    .category-filters {
        gap: 5px;
    }

    .category-btn {
        font-size: 0.75rem;
        padding: 6px 12px;
    }

    .exercise-card {
        padding: 12px;
    }

    .exercise-card-footer {
        flex-direction: column;
    }
}
