/**
 * Program Sequence Styling
 * Drag-and-drop exercise reordering and lock/unlock controls
 */

/* Exercise sequence table */
.exercise-sequence-table {
    width: 100%;
    border-collapse: collapse;
}

.exercise-sequence-table thead {
    background: #f0f4f8;
    border-bottom: 2px solid #cbd5e0;
}

.exercise-sequence-table th {
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Exercise row */
.exercise-sequence-row {
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.exercise-sequence-row:hover {
    background-color: #f8fafc;
}

.exercise-sequence-row.dragging {
    opacity: 0.6;
    background-color: #dbeafe !important;
    border: 2px dashed #0284c7;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
}

.exercise-sequence-row.is-locked {
    background-color: #fef2f2;
}

/* Table cells */
.exercise-sequence-row td {
    padding: 12px 8px;
    font-size: 13px;
    color: #0f172a;
    vertical-align: middle;
}

/* Drag handle */
.drag-handle {
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #94a3b8;
    font-size: 16px;
    transition: color 0.2s ease;
    user-select: none;
}

.drag-handle:hover {
    color: #0f172a;
}

.exercise-sequence-row.dragging .drag-handle {
    opacity: 0;
}

/* Order display */
.sequence-order {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
}

/* Exercise ID */
.exercise-id {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #64748b;
}

/* Lock icon */
.lock-icon {
    display: inline-block;
    font-size: 16px;
    cursor: default;
    user-select: none;
}

/* Lock toggle */
.sequence-lock-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 24px;
}

.sequence-lock-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.lock-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #22c55e;
    transition: background-color 0.3s ease;
    border-radius: 24px;
    display: flex;
    align-items: center;
}

.lock-slider:before {
    position: absolute;
    content: '';
    height: 20px;
    width: 20px;
    left: 2px;
    background-color: white;
    transition: left 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.sequence-lock-toggle input:checked + .lock-slider {
    background-color: #ef4444;
}

.sequence-lock-toggle input:checked + .lock-slider:before {
    left: 18px;
}

.sequence-lock-toggle input:focus + .lock-slider {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Pass threshold input */
.pass-threshold-input {
    width: 50px;
    padding: 4px 6px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 12px;
    color: #0f172a;
    text-align: center;
}

.pass-threshold-input:focus {
    outline: none;
    border-color: #3730a3;
    box-shadow: 0 0 0 3px rgba(55, 48, 163, 0.1);
}

/* Status indicators */
.lock-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.lock-status.locked {
    background: #fee2e2;
    color: #991b1b;
}

.lock-status.unlocked {
    background: #dcfce7;
    color: #166534;
}

/* Sequence info */
.sequence-info {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    font-size: 12px;
    color: #0c4a6e;
}

.sequence-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sequence-info-item strong {
    font-weight: 600;
}

/* Instructions */
.sequence-instructions {
    background: #f3e8ff;
    border: 1px solid #ddd6fe;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #5b21b6;
    line-height: 1.5;
}

.sequence-instructions strong {
    display: block;
    margin-bottom: 6px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .exercise-sequence-table {
        font-size: 12px;
    }

    .exercise-sequence-row td {
        padding: 8px 4px;
    }

    .pass-threshold-input {
        width: 40px;
    }
}
