.schedule-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        sans-serif;
    padding: 0 1rem;
    box-sizing: border-box;
}

.schedule-header {
    padding: 1.5rem;
    background: white;
    color: #333;
    border-bottom: 1px solid #dee2e6;
}

.schedule-header h5 {
    color: #333;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.schedule-header .text-muted {
    color: #6c757d !important;
}

.quick-actions .btn {
    border-color: #dee2e6;
    color: #495057;
    font-size: clamp(0.4rem, 1.2vw, 0.6rem);
    padding: 0 4px;
    margin-left: 0.5rem;
    transition: all 0.2s ease;
}

.quick-actions .btn:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
    transform: translateY(-1px);
}

.schedule-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    width: 100%;
    max-width: 100%;
    scrollbar-width: thin;
    scrollbar-color: #6c757d #f8f9fa;
    box-sizing: border-box;
}

.schedule-wrapper::-webkit-scrollbar {
    height: 8px;
}

.schedule-wrapper::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.schedule-wrapper::-webkit-scrollbar-thumb {
    background: #6c757d;
    border-radius: 4px;
}

.schedule-wrapper::-webkit-scrollbar-thumb:hover {
    background: #495057;
}

.schedule-grid {
    display: grid;
    grid-template-columns: 120px repeat(24, 60px);
    min-height: 400px;
    min-width: 1592px;
    gap: 1px;
    background-color: #e5e7eb;
    margin: 0;
    overflow: hidden;
    position: relative;
}

.time-header {
    display: contents;
}

.time-label {
    background: #f8fafc;
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    border-right: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-label:first-child {
    background: #f1f5f9;
    border-right: 2px solid #cbd5e1;
}

.day-row {
    display: contents;
}

.day-label {
    background: #f8fafc;
    padding: 1rem 0.75rem;
    font-weight: 600;
    color: #374151;
    border-right: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    text-transform: capitalize;
}

.time-cell {
    background: white;
    min-height: 60px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    border-right: 1px solid #f1f5f9;
}

.time-cell:hover {
    background-color: #f0f9ff;
    box-shadow: inset 0 0 0 2px #3b82f6;
}

.time-cell.drop-zone {
    background-color: #dcfce7;
    box-shadow: inset 0 0 0 2px #22c55e;
}

.time-cell.invalid-drop {
    background-color: #fef2f2;
    box-shadow: inset 0 0 0 2px #ef4444;
}

/* Time Slot Styles */
.time-slot {
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 2px;
    container-type: inline-size;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 6px;
    color: white;
    font-weight: 600;
    font-size: clamp(0.5rem, calc(0.8rem + 0.5vw), 0.875rem);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: move;
    user-select: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    z-index: 10;
    min-width: calc(100% - 4px);
    box-sizing: border-box;
    padding: 0px 8px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.time-slot:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.time-slot.dragging {
    z-index: 1000;
    transform: rotate(2deg) scale(1.05);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px;
    background: rgba(255, 255, 255, 0.3);
    cursor: ew-resize;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.resize-handle.left {
    left: 0;
    border-radius: 6px 0 0 6px;
}

.resize-handle.right {
    right: 0;
    border-radius: 0 6px 6px 0;
}

.time-slot:hover .resize-handle {
    opacity: 1;
}

@container (min-width: 60px) {
    .time-slot {
        font-size: 0.65rem;
    }
}

@container (min-width: 120px) {
    .time-slot {
        font-size: 0.75rem;
    }
}

@container (min-width: 180px) {
    .time-slot {
        font-size: 0.875rem;
    }
}

.resize-handle:hover {
    background: rgba(255, 255, 255, 0.5);
}

.delete-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 20;
    line-height: 1;
}

.time-slot:hover .delete-btn {
    opacity: 1;
    transform: scale(1.1);
}

.delete-btn:hover {
    background: #dc2626;
    transform: scale(1.2);
}

.schedule-container .border-top {
    border-color: #e5e7eb !important;
}

.schedule-container .bg-light {
    background-color: #f8fafc !important;
}

.schedule-container .btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    transition: all 0.2s ease;
}

.schedule-container .btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

@media (max-width: 768px) {
    .schedule-grid {
        grid-template-columns: 100px repeat(24, minmax(30px, 1fr));
        margin: 0.5rem;
    }

    .schedule-header {
        padding: 1rem;
    }

    .schedule-header .d-flex {
        flex-direction: column;
        gap: 1rem;
    }

    .quick-actions {
        text-align: center;
    }

    .time-label,
    .day-label {
        font-size: 0.75rem;
        padding: 0.5rem 0.25rem;
    }

    .time-cell {
        min-height: 50px;
    }

    .time-slot {
        font-size: 0.75rem;
        top: 4px;
        bottom: 4px;
    }
}

@media (max-width: 480px) {
    .schedule-grid {
        grid-template-columns: 80px repeat(24, minmax(25px, 1fr));
    }

    .time-label {
        font-size: 0.625rem;
        padding: 0.25rem;
    }

    .day-label {
        font-size: 0.75rem;
        padding: 0.5rem 0.25rem;
    }

    .time-cell {
        min-height: 40px;
    }

    .time-slot {
        font-size: 0.625rem;
        min-width: 40px;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.time-slot {
    animation: slideIn 0.3s ease;
}

.schedule-container {
    animation: fadeIn 0.5s ease;
}

.schedule-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.schedule-container::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.schedule-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.schedule-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.time-cell:focus,
.time-slot:focus,
.delete-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

@media (prefers-contrast: high) {
    .time-slot {
        border: 2px solid #000;
    }

    .time-cell:hover {
        border: 2px solid #000;
    }
}

@media (prefers-reduced-motion: reduce) {
    .time-slot,
    .schedule-container,
    .delete-btn,
    .resize-handle,
    .quick-actions .btn {
        animation: none;
        transition: none;
    }

    .time-slot:hover {
        transform: none;
    }

    .time-slot.dragging {
        transform: scale(1.05);
    }
}

@media print {
    .schedule-container {
        box-shadow: none;
        border: 1px solid #000;
    }

    .quick-actions,
    .delete-btn,
    .resize-handle {
        display: none;
    }

    .schedule-header {
        background: #f5f5f5 !important;
        color: #000 !important;
    }

    .time-slot {
        background: #e5e5e5 !important;
        color: #000 !important;
    }
}
