/* Modern Staff Availability Calendar Styles */

.staff-calendar-widget {
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* Header */
.calendar-header {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    padding: 20px;
    color: white;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.month-info .label {
    font-size: 14px;
    opacity: 0.7;
    font-weight: 500;
    margin-bottom: 4px;
}

.month-info .month-name {
    font-size: 24px;
    font-weight: 700;
}

.nav-buttons {
    display: flex;
    gap: 8px;
}

.nav-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.staff-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.staff-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
}

.staff-details {
    flex: 1;
}

.staff-name {
    font-size: 16px;
    font-weight: 600;
}

.staff-position {
    font-size: 13px;
    opacity: 0.7;
}

/* Aggregated info */
.aggregated-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 10px;
    margin-top: 12px;
}

.aggregated-info svg {
    flex-shrink: 0;
    color: #3B82F6;
}

.aggregated-info span {
    font-size: 14px;
}

.aggregated-info strong {
    font-weight: 700;
    color: #3B82F6;
}

/* Info Box */
.calendar-info-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    margin-top: 16px;
}

.info-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3B82F6;
}

.info-text {
    flex: 1;
    font-size: 13px;
    line-height: 1.5;
    opacity: 0.95;
}

/* Legend - Enhanced */
.calendar-legend {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid #E2E8F0;
    background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #475569;
    font-weight: 600;
    padding: 6px 10px;
    background: white;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
}

.legend-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.legend-icon.available {
    background: #DCFCE7;
    color: #22C55E;
}

.legend-icon.closed {
    background: #DC2626;
    color: white;
}

.legend-icon.on-leave {
    background: #FEE2E2;
    color: #EF4444;
}

.legend-icon.no-schedule {
    background: #F1F5F9;
    color: #94A3B8;
}

.legend-icon.fully-booked {
    background: #FED7AA;
    color: #FB923C;
}

/* Calendar Grid */
.calendar-grid {
    padding: 16px 20px;
}

.day-headers {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.day-header {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #64748B;
    padding: 8px 0;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.day-cell {
    aspect-ratio: 0.9;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s;
    font-size: 16px;
    font-weight: 600;
}

.day-cell.empty {
    background: transparent;
}

/* Day cell states */
.day-cell.status-available {
    background: #DCFCE7;
    color: #166534;
    cursor: pointer;
}

.day-cell.status-available:hover {
    background: #BBF7D0;
    transform: translateY(-2px);
}

.day-cell.status-available.selected {
    background: #22C55E;
    color: white;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.day-cell.status-on_leave {
    background: #FEE2E2;
    color: #EF4444;
}

.day-cell.status-closed {
    background: #DC2626;
    color: white;
}

.day-cell.status-closed .day-number {
    opacity: 0.7;
}

.closed-label {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-top: 2px;
    text-transform: uppercase;
}

.day-cell.status-fully_booked {
    background: #FED7AA;
    color: #C2410C;
}

.day-cell.status-no_schedule {
    background: #F1F5F9;
    color: #94A3B8;
    position: relative;
}

.day-cell.status-no_schedule::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70%;
    height: 2px;
    background: #CBD5E1;
    transform: translate(-50%, -50%) rotate(-45deg);
    opacity: 0.5;
}

.day-cell.past {
    background: #F8FAFC;
    color: #CBD5E1;
}

.day-cell.today {
    border: 2px solid #0F172A;
}

.day-number {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 2px;
}

.status-icon {
    margin-top: 2px;
}

.slots-badge {
    margin-top: 2px;
    padding: 1px 4px;
    background: rgba(34, 197, 94, 0.9);
    color: white;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 700;
}

.day-cell.selected .slots-badge {
    background: white;
    color: #22C55E;
}

/* Work Hours Mini Display */
.work-hours-mini {
    margin-top: 1px;
    padding: 1px 3px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    font-size: 7px;
    font-weight: 600;
    color: inherit;
    white-space: nowrap;
}

.day-cell.status-available .work-hours-mini {
    background: rgba(255, 255, 255, 0.95);
    color: #166534;
}

.day-cell.status-fully_booked .work-hours-mini {
    background: rgba(255, 255, 255, 0.95);
    color: #C2410C;
}

.day-cell.selected .work-hours-mini {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* Status Icons Enhanced */
.status-icon {
    margin-top: 2px;
    opacity: 0.8;
}

.status-icon.leave-icon {
    color: #EF4444;
}

.status-icon.booked-icon {
    color: #C2410C;
}

.status-icon.no-work-icon {
    color: #94A3B8;
}

/* Aggregated mode badges */
.staff-count-badge {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: 2px;
    padding: 2px 5px;
    background: #3B82F6;
    color: white;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
}

.staff-count-badge svg {
    flex-shrink: 0;
}

.slots-info-text {
    margin-top: 2px;
    font-size: 8px;
    font-weight: 600;
    opacity: 0.75;
}

/* Loading State */
.calendar-loading {
    padding: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #F1F5F9;
    border-top-color: #0F172A;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 640px) {
    .calendar-header {
        padding: 16px;
    }
    
    .month-info .month-name {
        font-size: 20px;
    }
    
    .calendar-legend {
        padding: 12px 16px;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .legend-item {
        padding: 5px 8px;
        font-size: 10px;
    }
    
    .legend-icon {
        width: 20px;
        height: 20px;
    }
    
    .legend-icon svg {
        width: 10px;
        height: 10px;
    }
    
    .calendar-grid {
        padding: 12px 16px;
    }
    
    .day-header {
        font-size: 11px;
        padding: 4px 0;
    }
    
    .day-number {
        font-size: 14px;
    }
    
    .nav-btn {
        width: 36px;
        height: 36px;
    }
    
    .work-hours-mini {
        font-size: 6px;
        padding: 1px 2px;
    }
    
    .slots-badge {
        font-size: 8px;
        padding: 1px 3px;
    }
}

/* Tooltip styles */
.day-cell[title] {
    cursor: help;
}

.day-cell[title][data-action="select-date"] {
    cursor: pointer;
}

/* Info box enhanced */
.calendar-info-box .info-text strong {
    color: #3B82F6;
}
