/**
 * Golden Hour Scheduling System - Swap System Styles
 * 
 * CSS styles for the advanced 6-scenario swap system including:
 * - Visual indicators for different swap types
 * - Drag-and-drop feedback
 * - Swap status styling
 * - Modal enhancements
 */

/* Swap Status Classes for Assignment Blocks - Preserve Original Golden Hour Colors */
.assignment-block.status-swap {
    /* Keep original background from schedule-mine.css: var(--bs-secondary) */
    /* Only add subtle visual enhancement without changing core colors */
    border-left: 3px solid var(--bs-info);
}

.assignment-block.status-conflict {
    /* Keep original background from schedule-mine.css: var(--bs-dark) */
    /* Only add subtle visual enhancement without changing core colors */
    border-left: 3px solid var(--bs-danger);
}

.assignment-block.status-good {
    /* Keep original background from schedule-mine.css: var(--bs-warning) */
    /* Only add subtle visual enhancement without changing core colors */
    border-left: 3px solid var(--bs-success);
}

/* Drag-and-Drop Visual Feedback */
.swap-drag-active {
    cursor: grabbing !important;
}

.swap-drag-active .assignment-block:not(.swap-drop-target) {
    opacity: 0.5;
    filter: grayscale(50%);
}

.assignment-block.swap-drop-target {
    border: 2px dashed #0d6efd !important;
    background-color: rgba(13, 110, 253, 0.1) !important;
    transform: scale(1.02);
    transition: all 0.2s ease;
    cursor: copy;
}

.assignment-block.swap-drop-target.swap-drop-hover {
    border-color: #198754 !important;
    background-color: rgba(25, 135, 84, 0.2) !important;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.assignment-block[draggable="true"] {
    cursor: grab;
}

.assignment-block[draggable="true"]:active {
    cursor: grabbing;
}

/* Swap Type Icons - Only apply colors in specific contexts, not globally */
.form-check-label .bi-arrow-left-right.text-primary {
    color: #0d6efd !important; /* Blue for Open swaps in form labels */
}

.form-check-label .bi-bullseye.text-warning {
    color: #fd7e14 !important; /* Orange for Targeted swaps in form labels */
}

.form-check-label .bi-arrow-repeat.text-success {
    color: #198754 !important; /* Green for Mutual swaps in form labels */
}

/* Enhanced Modal Styling */
.modal-xl .modal-dialog {
    max-width: 1200px;
}

#manageSwapsModal .card {
    transition: all 0.2s ease;
}

#manageSwapsModal .card:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Swap Type Selection Styling */
.form-check-input[name="swapType"]:checked + .form-check-label {
    color: #0d6efd;
    font-weight: 600;
}

.form-check-input[name="swapType"]:checked + .form-check-label .bi {
    transform: scale(1.1);
}

/* Validation Message Styling */
#swapValidationErrors {
    border-left: 4px solid #dc3545;
}

#swapValidationWarnings {
    border-left: 4px solid #ffc107;
}

/* Assignment Block Hover Effects */
.assignment-block {
    transition: all 0.2s ease;
    cursor: pointer;
}

.assignment-block:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Swap Request Status Indicators */
.swap-status-indicator {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: white;
    z-index: 10;
}

.swap-status-indicator.open {
    background-color: #0d6efd;
}

.swap-status-indicator.targeted {
    background-color: #fd7e14;
}

.swap-status-indicator.mutual {
    background-color: #198754;
}

/* Success Alert Animation */
.alert.position-fixed {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading State Styling */
.btn:disabled {
    opacity: 0.7;
}

.btn .bi-hourglass-split {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Calendar Day Cell Enhancements for Drag-and-Drop */
.calendar-day-cell {
    position: relative;
    min-height: 100px;
}

.calendar-day-cell.swap-drop-zone {
    background-color: rgba(13, 110, 253, 0.05);
    border: 1px dashed #0d6efd;
}

.calendar-day-cell.swap-drop-zone.swap-drop-hover {
    background-color: rgba(25, 135, 84, 0.1);
    border-color: #198754;
}

/* Assignment Block Content Styling */
.assignment-block small {
    opacity: 0.8;
    font-size: 0.75em;
}

.assignment-block .bi {
    margin-left: 4px;
    font-size: 0.9em;
}

/* Modal Header Enhancements */
.modal-header.bg-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%) !important;
}

/* Form Control Focus States */
#swapNotes:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .modal-xl .modal-dialog {
        max-width: 95%;
        margin: 1rem;
    }
    
    .assignment-block {
        font-size: 0.85em;
        padding: 4px 6px;
    }
    
    .swap-drop-target {
        transform: scale(1.01) !important;
    }
    
    .swap-drop-target.swap-drop-hover {
        transform: scale(1.03) !important;
    }
}

/* Print Styles */
@media print {
    .swap-status-indicator,
    .assignment-block .bi {
        display: none !important;
    }
    
    .assignment-block.status-swap {
        border-left: 2px solid #000 !important;
        background-color: #f8f9fa !important;
    }
    
    .assignment-block.status-conflict {
        border-left: 2px solid #000 !important;
        background-color: #fff3cd !important;
    }
}

/* Accessibility Enhancements */
.assignment-block:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.form-check-input:focus + .form-check-label {
    outline: 1px dotted #0d6efd;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .assignment-block.status-swap {
        border-left-width: 6px !important;
    }
    
    .assignment-block.status-conflict {
        border-left-width: 6px !important;
    }
    
    .assignment-block.status-good {
        border-left-width: 6px !important;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .assignment-block,
    .swap-drop-target,
    .alert.position-fixed {
        transition: none !important;
        animation: none !important;
    }
    
    .assignment-block:hover {
        transform: none !important;
    }
}
