/* ==================== SCHEDULE EDITOR ==================== */

.schedule-editor-container {
    padding: 10px;
}

.editor-toolbar-container .btn-group {
    margin-right: 15px;
}

.processing-indicator {
    display: inline-block;
    margin-left: 10px;
    color: #666;
}

/* ==================== DIAGNOSTIC PANEL ==================== */

.diagnostic-container {
    margin-bottom: 15px;
}

.diagnostic-panel {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 10px 15px;
    position: relative;
}

.diagnostic-panel.error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.diagnostic-panel [data-action="closeDiagnostic"] {
    position: absolute;
    top: 8px;
    right: 10px;
    opacity: 0.7;
    padding: 0;
}

.diagnostic-panel [data-action="closeDiagnostic"]:hover {
    opacity: 1;
}

.diagnostic-title {
    font-weight: 600;
    margin-bottom: 8px;
}

.diagnostic-list {
    margin: 0;
    padding-left: 20px;
}

.diagnostic-item {
    margin-bottom: 4px;
}

.conflict-type {
    font-weight: 500;
}

.conflict-entity {
    color: #856404;
}

.diagnostic-panel.error .conflict-entity {
    color: #721c24;
}

.conflict-details {
    color: #666;
    font-size: 12px;
}

/* ==================== MAIN CONTENT LAYOUT ==================== */

.schedule-main-content {
    display: flex;
    gap: 20px;
}

.schedule-grid-wrapper {
    flex: 1;
    overflow-x: auto;
}

.unassigned-pool-container {
    width: 280px;
    flex-shrink: 0;
}

.unassigned-pool-container.hidden {
    display: none;
}

/* ==================== SCHEDULE TABLE ==================== */

.schedule-table {
    border-collapse: collapse;
    width: 100%;
}

.schedule-table td.schedule-cell {
    padding: 0 !important;
    vertical-align: top;
    height: 100%;
}

.schedule-table td.schedule-cell .slot-cell-container {
    padding: 8px;
    min-height: calc(100% - 8px);
    height: 100%;
    display: flex;
    /*flex-direction: column;*/
    gap: 4px;
}

.schedule-table td.schedule-cell .empty-cell-container {
    height: 100%;
    /*min-height: 60px;*/
    padding-left: 4px;
    padding-right:4px;
    padding-top: 2px;
    padding-bottom: 2px;
}

.schedule-table td.schedule-cell .empty-cell {
    height: 100%;
    min-height: 60px;
    margin: 4px;
}

.schedule-table tbody tr {
    height: 1px;
}

.schedule-table td.schedule-cell {
    /*height: 100%;*/
    position: relative;
    vertical-align: middle;
}

.schedule-table td.time-row-header {
    white-space: nowrap;
    vertical-align: middle;
    padding: 8px !important;
}

.schedule-table th.time-column-header {
    text-align: center;
}

/* ==================== CELL STATES ==================== */

.schedule-cell.editable {
    cursor: pointer;
}

/* ==================== EMPTY CELL STATES ==================== */

.empty-cell {
    transition: background-color 0.15s;
}

.empty-cell.cell-available {
    background-color: #e8f5e9;
    cursor: pointer;
}

.empty-cell.cell-swap-hidden {
    background-color: #fff8e1;
    cursor: pointer;
}

/* ==================== SLOT STATES ==================== */

.schedule-slot {
    position: relative;
    height: 100%;
}

.schedule-slot.slot-selected {
    background-color: #e0e0e0 !important;
    box-shadow: inset 0 0 0 2px #666 !important;
    padding: 4px;
    z-index: 10;
}

.schedule-slot.slot-locked {
    opacity: 0.7;
    background-color: #f5f5f5 !important;
    border: 2px dashed #999 !important;
    padding: 4px;
}

/* ==================== EDIT CONTROLS ==================== */

.slot-edit-controls {
    position: absolute;
    top: 2px;
    right: 2px;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.2s;
}

.schedule-slot:hover .slot-edit-controls,
.slot-edit-controls:hover,
.schedule-slot.slot-selected .slot-edit-controls {
    opacity: 1;
}

.slot-edit-btn {
    padding: 2px 5px;
    font-size: 10px;
    margin-left: 3px;
}

.slot-edit-btn:first-child {
    margin-left: 0;
}

/* ==================== EDIT MODE ACTIVE ==================== */

.edit-mode-active .schedule-slot {
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.edit-mode-active .schedule-slot:hover {
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.edit-mode-active .schedule-cell:hover {
    background-color: #f5f5f5;
}

.edit-mode-active .empty-cell:hover {
    background-color: #f0f0f0;
}

/* ==================== UNASSIGNED POOL ==================== */

.unassigned-pool {
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    margin-top: 12px;
}

.unassigned-pool .panel-heading {
    background-color: #f8f8f8;
}

.unassigned-pool .panel-title {
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.unassigned-pool .panel-title .badge {
    background-color: #999;
}

.unassigned-slots-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.unassigned-slot-item {
    padding: 8px 10px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.unassigned-slot-item:hover {
    background-color: #f5f5f5;
    border-color: #999;
}

.unassigned-slot-item.slot-selected {
    background-color: #e0e0e0;
    border-color: #666;
}

.unassigned-slot-item .slot-subject {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
}

.unassigned-slot-item .slot-info {
    font-size: 11px;
    color: #666;
}

.unassigned-slot-item .slot-teachers,
.unassigned-slot-item .slot-groups {
    display: block;
}

.unassigned-slot-item .slot-duration {
    margin-top: 4px;
}

.unassigned-slot-item .slot-duration .badge {
    font-size: 10px;
    background-color: #607D8B;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 992px) {
    .schedule-main-content {
        flex-direction: column;
    }

    .unassigned-pool-container {
        width: 100%;
    }

    .unassigned-pool {
        max-height: 300px;
    }
}

/* ==================== ROOM SELECT MODAL ==================== */

.room-select-container {
    max-height: 400px;
    overflow-y: auto;
}

.room-select-container .loading-indicator {
    text-align: center;
    padding: 20px;
    color: #666;
}

.room-select-container .no-rooms-message {
    text-align: center;
    padding: 20px;
    color: #999;
}

.building-group {
    margin-bottom: 15px;
}

.building-group .building-name {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #eee;
}

.building-group .room-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.building-group .room-item {
    padding: 8px 12px;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}

.building-group .room-item:hover {
    background-color: #e8e8e8;
    border-color: #999;
}

.building-group .room-item.current {
    background-color: #e3f2fd;
    border-color: #2196F3;
    font-weight: 600;
}
