:root {
    --chronor-primary: #0d6efd;
    --chronor-success: #198754;
    --chronor-warning: #ffc107;
    --chronor-danger: #dc3545;
    --chronor-info: #0dcaf0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f8f9fa;
}

.main-header {
    background: linear-gradient(135deg, var(--chronor-primary), #0056b3);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.toolbar {
    background: white;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.personnel-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: calc(100vh - 200px);
    overflow-y: auto;
}

/* Enhanced Room Cards */
.salle-card {
    transition: all 0.3s ease;
    border: 1px solid var(--chronor-border, #dee2e6);
}

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

.salle-card .card-header {
    border-bottom: 1px solid var(--chronor-border, #dee2e6);
}

/* Assignment Slots */
.assignment-slot {
    transition: all 0.2s ease;
    min-height: 60px;
}

.assignment-slot.border-dashed {
    border-style: dashed !important;
    border-width: 2px !important;
}

.assignment-slot:hover {
    background-color: rgba(0,0,0,0.02);
}

.assignment-slot .empty-slot {
    color: #6c757d;
}

.assignment-slot .assigned-person {
    background-color: rgba(255,255,255,0.7);
    border-radius: 4px;
    padding: 4px 8px;
}

/* Drop zone states */
.drop-zone.drag-over {
    background-color: rgba(13, 110, 253, 0.1);
    border-color: #0d6efd !important;
    border-style: solid !important;
}

.drop-zone.drag-over-valid {
    background-color: rgba(25, 135, 84, 0.1);
    border-color: #198754 !important;
}

.drop-zone.drag-over-invalid {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: #dc3545 !important;
}

/* Click-to-Assign Visual Feedback */
.personnel-selected {
    border: 2px solid #0d6efd !important;
    background-color: rgba(13, 110, 253, 0.1) !important;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

.room-slot-assignable {
    border: 2px solid #198754 !important;
    background-color: rgba(25, 135, 84, 0.1) !important;
    transition: all 0.2s ease;
}

.room-slot-assignable:hover {
    background-color: rgba(25, 135, 84, 0.2) !important;
    transform: scale(1.02);
}

.room-slot-not-assignable {
    border: 2px solid #dc3545 !important;
    background-color: rgba(220, 53, 69, 0.1) !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

/* Enhanced Assignment Slot Visual States */
.assignment-slot {
    transition: all 0.2s ease;
}

.assignment-slot:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.assignment-slot.bg-primary-subtle {
    background-color: rgba(13, 110, 253, 0.1) !important;
}

.assignment-slot.bg-success-subtle {
    background-color: rgba(25, 135, 84, 0.1) !important;
}

.assignment-slot.bg-light {
    background-color: rgba(248, 249, 250, 1) !important;
}

.salles-grid {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: calc(100vh - 200px);
    padding: 1rem;
}

.insights-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: calc(100vh - 200px);
    overflow-y: auto;
}

.salle-card {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.salle-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.salle-card.status-ouverte {
    border-color: var(--chronor-success);
}

.salle-card.status-fermee {
    border-color: var(--chronor-danger);
    opacity: 0.7;
}

.salle-card.constraint-violation {
    border-color: var(--chronor-warning);
    background-color: #fff3cd;
    position: relative;
}

.salle-card.constraint-violation::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ffc107, #fd7e14);
    border-radius: 10px;
    z-index: -1;
    animation: constraint-pulse 2s infinite;
}

@keyframes constraint-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* Personnel Assignment Highlight - Blue Neon Effect */
.salle-card.personnel-highlight {
    border: 6px solid #0066ff;
    box-shadow: 0 0 30px rgba(0, 102, 255, 0.7), 0 0 60px rgba(0, 102, 255, 0.5), inset 0 0 20px rgba(0, 102, 255, 0.2);
    position: relative;
    animation: blue-neon-pulse 1s infinite;
}

@keyframes blue-neon-pulse {
    0%, 100% {
        box-shadow: 0 0 30px rgba(0, 102, 255, 0.7), 0 0 60px rgba(0, 102, 255, 0.5), inset 0 0 20px rgba(0, 102, 255, 0.2);
        border-color: #0066ff;
    }
    50% {
        box-shadow: 0 0 50px rgba(0, 102, 255, 1), 0 0 100px rgba(0, 102, 255, 0.8), inset 0 0 30px rgba(0, 102, 255, 0.4);
        border-color: #0088ff;
    }
}

/* Sector Match Highlight - Green Neon Effect */
.salle-card.secteur-highlight {
    border: 6px solid #00cc66;
    box-shadow: 0 0 30px rgba(0, 204, 102, 0.7), 0 0 60px rgba(0, 204, 102, 0.5), inset 0 0 20px rgba(0, 204, 102, 0.2);
    position: relative;
    animation: green-neon-pulse 1s infinite;
}

@keyframes green-neon-pulse {
    0%, 100% {
        box-shadow: 0 0 30px rgba(0, 204, 102, 0.7), 0 0 60px rgba(0, 204, 102, 0.5), inset 0 0 20px rgba(0, 204, 102, 0.2);
        border-color: #00cc66;
    }
    50% {
        box-shadow: 0 0 50px rgba(0, 204, 102, 1), 0 0 100px rgba(0, 204, 102, 0.8), inset 0 0 30px rgba(0, 204, 102, 0.4);
        border-color: #00ff88;
    }
}

/* Priority: Blue highlight takes precedence over green when both are applied */
.salle-card.personnel-highlight.secteur-highlight {
    border: 6px solid #0066ff;
    box-shadow: 0 0 30px rgba(0, 102, 255, 0.7), 0 0 60px rgba(0, 102, 255, 0.5), inset 0 0 20px rgba(0, 102, 255, 0.2);
    animation: blue-neon-pulse 1s infinite;
}

/* Constraint Status Indicators */
.constraint-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    z-index: 10;
}

.constraint-indicator.valid {
    background-color: #198754;
    color: white;
}

.constraint-indicator.warning {
    background-color: #ffc107;
    color: #000;
}

.constraint-indicator.critical {
    background-color: #dc3545;
    color: white;
}

@keyframes warning-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes critical-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Assignment Status Visual Feedback */
.assignment-slot.valid {
    border-color: #198754;
    background-color: rgba(25, 135, 84, 0.1);
}

.assignment-slot.invalid {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.assignment-slot.warning {
    border-color: #ffc107;
    background-color: rgba(255, 193, 7, 0.1);
}

.personnel-item {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    cursor: grab;
    background: white;
    transition: all 0.3s ease;
}

.personnel-item:hover {
    background-color: #f8f9fa;
    border-color: var(--chronor-primary);
}

.personnel-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

/* SortableJS Drag States */
.personnel-ghost {
    opacity: 0.3;
}

.personnel-chosen {
    background-color: rgba(13, 110, 253, 0.1);
    border-color: #0d6efd;
}

.personnel-drag {
    transform: rotate(5deg);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Drop Zone States */
.drop-zone-active {
    border: 2px dashed #0d6efd !important;
    background-color: rgba(13, 110, 253, 0.05);
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0%, 100% { border-color: #0d6efd; }
    50% { border-color: #0b5ed7; }
}

/* Dragging Body State */
body.dragging-personnel .assignment-slot {
    transition: all 0.3s ease;
}

body.dragging-personnel .assignment-slot:hover {
    background-color: rgba(25, 135, 84, 0.1);
    border-color: #198754 !important;
}

.personnel-item.available {
    border-left: 4px solid var(--chronor-success);
}

.personnel-item.unavailable {
    border-left: 4px solid var(--chronor-danger);
    opacity: 0.6;
}

.personnel-item.assigned {
    border-left: 4px solid var(--chronor-info);
}

.drop-zone {
    min-height: 60px;
    border: 2px dashed #dee2e6;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    transition: all 0.3s ease;
}

.drop-zone.drag-over {
    border-color: var(--chronor-primary);
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--chronor-primary);
}

.badge-garde {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.loading {
    display: none;
}

.loading.show {
    display: block;
}

/* Date Picker Modal Styles */
#datePickerModal .flatpickr-calendar {
    box-shadow: none;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

#datePickerModal .flatpickr-day.selected {
    background-color: var(--chronor-primary);
    border-color: var(--chronor-primary);
}

#datePickerModal .flatpickr-day.selected:hover {
    background-color: #0a58ca;
    border-color: #0a58ca;
}

#datePickerModal .flatpickr-months {
    background-color: var(--chronor-primary);
}

#datePickerModal .flatpickr-current-month {
    color: white;
}

#datePickerModal .flatpickr-prev-month,
#datePickerModal .flatpickr-next-month {
    color: white;
}

#datePickerModal .flatpickr-prev-month:hover,
#datePickerModal .flatpickr-next-month:hover {
    background-color: rgba(255,255,255,0.1);
}

#selectedDatesList {
    max-height: 100px;
    overflow-y: auto;
}
