/**
 * Schedule Calendar Styles
 */

/* Week View */
.schedule-calendar .week-view {
    overflow-x: auto;
}

.schedule-calendar .calendar-grid {
    display: flex;
    min-width: 800px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.schedule-calendar .time-column {
    width: 60px;
    flex-shrink: 0;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
}

.schedule-calendar .time-header {
    height: 50px;
    border-bottom: 1px solid #dee2e6;
}

.schedule-calendar .time-slot {
    height: 40px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 2px;
    font-size: 11px;
    color: #6c757d;
    border-bottom: 1px solid #f0f0f0;
}

.schedule-calendar .day-column {
    flex: 1;
    min-width: 100px;
    border-right: 1px solid #dee2e6;
}

.schedule-calendar .day-column:last-child {
    border-right: none;
}

.schedule-calendar .day-column.today {
    background-color: #fff3cd;
}

.schedule-calendar .day-header {
    height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.schedule-calendar .day-name {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
}

.schedule-calendar .day-date {
    font-size: 18px;
    font-weight: 500;
}

.schedule-calendar .day-body {
    position: relative;
    cursor: pointer;
}

.schedule-calendar .hour-slot {
    height: 40px;
    border-bottom: 1px solid #f0f0f0;
}

.schedule-calendar .hour-slot:hover {
    background-color: #e9ecef;
}

.schedule-calendar .calendar-event {
    position: absolute;
    left: 2px;
    right: 2px;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 11px;
    overflow: hidden;
    cursor: pointer;
    z-index: 1;
    border-left: 3px solid;
}

.schedule-calendar .calendar-event:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 2;
}

.schedule-calendar .event-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-calendar .event-time {
    font-size: 10px;
    opacity: 0.8;
}

.schedule-calendar .event-vehicle {
    font-size: 10px;
    opacity: 0.7;
}

/* Event Status Colors */
.schedule-calendar .event-pending {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.schedule-calendar .event-approved {
    background-color: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.schedule-calendar .event-in_progress {
    background-color: #cce5ff;
    border-color: #007bff;
    color: #004085;
}

.schedule-calendar .event-completed {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.schedule-calendar .event-cancelled {
    background-color: #e2e3e5;
    border-color: #6c757d;
    color: #383d41;
    text-decoration: line-through;
}

/* Priority Indicators */
.schedule-calendar .priority-urgent {
    border-left-width: 4px;
    border-left-color: #dc3545 !important;
}

.schedule-calendar .priority-high {
    border-left-width: 4px;
    border-left-color: #fd7e14 !important;
}

/* Month View */
.schedule-calendar .month-view {
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.schedule-calendar .month-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.schedule-calendar .month-day-name {
    padding: 10px;
    text-align: center;
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    color: #6c757d;
}

.schedule-calendar .month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.schedule-calendar .month-day {
    min-height: 100px;
    border-right: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    padding: 4px;
    cursor: pointer;
}

.schedule-calendar .month-day:nth-child(7n) {
    border-right: none;
}

.schedule-calendar .month-day:hover {
    background-color: #f8f9fa;
}

.schedule-calendar .month-day.other-month {
    background-color: #f8f9fa;
    color: #adb5bd;
}

.schedule-calendar .month-day.today {
    background-color: #fff3cd;
}

.schedule-calendar .month-day-number {
    font-weight: 500;
    margin-bottom: 4px;
}

.schedule-calendar .month-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.schedule-calendar .month-event {
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.schedule-calendar .month-event:hover {
    opacity: 0.8;
}

.schedule-calendar .month-event.event-pending {
    background-color: #ffc107;
    color: #212529;
}

.schedule-calendar .month-event.event-approved {
    background-color: #17a2b8;
    color: white;
}

.schedule-calendar .month-event.event-in_progress {
    background-color: #007bff;
    color: white;
}

.schedule-calendar .month-event.event-completed {
    background-color: #28a745;
    color: white;
}

.schedule-calendar .month-event.event-cancelled {
    background-color: #6c757d;
    color: white;
    text-decoration: line-through;
}

.schedule-calendar .more-events {
    font-size: 10px;
    color: #6c757d;
    padding: 2px 4px;
}

/* Availability Overlay */
.schedule-calendar .unavailable-overlay {
    position: absolute;
    left: 0;
    right: 0;
    background: repeating-linear-gradient(
        45deg,
        #f8d7da,
        #f8d7da 10px,
        #f5c6cb 10px,
        #f5c6cb 20px
    );
    opacity: 0.5;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .schedule-calendar .calendar-grid {
        min-width: 600px;
    }

    .schedule-calendar .time-column {
        width: 50px;
    }

    .schedule-calendar .day-column {
        min-width: 80px;
    }

    .schedule-calendar .month-day {
        min-height: 80px;
    }
}

/* RTL Support */
[dir="rtl"] .schedule-calendar .calendar-event {
    border-left: none;
    border-right: 3px solid;
}

[dir="rtl"] .schedule-calendar .time-column {
    border-right: none;
    border-left: 1px solid #dee2e6;
}

[dir="rtl"] .schedule-calendar .day-column {
    border-right: none;
    border-left: 1px solid #dee2e6;
}

[dir="rtl"] .schedule-calendar .day-column:last-child {
    border-left: none;
}

[dir="rtl"] .schedule-calendar .month-day {
    border-right: none;
    border-left: 1px solid #dee2e6;
}

[dir="rtl"] .schedule-calendar .month-day:nth-child(7n) {
    border-left: none;
}
