/* Timeline Picker Styles */
.timeline-picker {
    direction: rtl;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 10px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timeline-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.timeline-info {
    font-size: 12px;
    color: #666;
}

.timeline-container {
    position: relative;
    height: 60px;
    background: linear-gradient(to right, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
    margin: 15px 0;
}

.timeline-hours {
    display: flex;
    height: 100%;
    position: relative;
}

.timeline-hour {
    flex: 1;
    border-left: 1px solid #dee2e6;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.timeline-hour:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

.timeline-hour.occupied {
    background-color: #ffcdd2 !important;
    color: #c62828 !important;
    border-color: #f44336 !important;
    cursor: not-allowed !important;
    position: relative;
}

.timeline-hour.occupied:hover {
    background-color: #ffcdd2 !important;
    transform: none !important;
    box-shadow: 0 2px 4px rgba(244, 67, 54, 0.3) !important;
}

.timeline-hour.available {
    background-color: #e8f5e8;
    color: #2e7d32;
    border-color: #4caf50;
    cursor: pointer;
}

.timeline-hour.available:hover {
    background-color: #c8e6c9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.lock-icon {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
    opacity: 0.8;
    pointer-events: none;
}

/* انیمیشن برای ساعت‌های رزرو شده */
.timeline-hour.occupied {
    animation: pulse-booked 3s infinite;
}

@keyframes pulse-booked {
    0% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(244, 67, 54, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0);
    }
}

.timeline-hour.selected {
    background-color: #28a745;
}

.timeline-hour.selecting {
    background-color: #17a2b8;
}

.hour-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #666;
    white-space: nowrap;
}

.timeline-selection {
    position: absolute;
    top: 0;
    height: 100%;
    background: linear-gradient(45deg, #28a745, #20c997);
    border: 2px solid #155724;
    border-radius: 4px;
    opacity: 0.8;
    pointer-events: none;
    transition: all 0.2s ease;
}

.selection-info {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #155724;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 10;
}

.selection-info::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #155724;
}

.timeline-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-available { background-color: #f8f9fa; border: 1px solid #dee2e6; }
.legend-occupied { background-color: #dc3545; }
.legend-selected { background-color: #28a745; }

.timeline-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;

}

.time-display {
    display: flex;
    gap: 15px;
    align-items: center;
}

.time-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.time-label {
    font-size: 12px;
    color: #666;
    font-weight: bold;
}

.time-value {
    font-size: 14px;
    color: #333;
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    min-width: 80px;
    text-align: center;
}

.timeline-actions {
    display: flex;
    gap: 10px;
}

.timeline-btn {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #fff;
    color: #333;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.timeline-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.timeline-btn.primary {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.timeline-btn.primary:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.timeline-btn.danger {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.timeline-btn.danger:hover {
    background: #c82333;
    border-color: #c82333;
}

.timeline-suggestions {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.suggestions-title {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-item {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #28a745;
    border-radius: 4px;
    color: #28a745;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.suggestion-item:hover {
    background: #28a745;
    color: white;
}

.timeline-error {
    margin-top: 10px;
    padding: 10px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    font-size: 12px;
    display: none;
}

.timeline-error.show {
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .timeline-picker {
        padding: 15px;
    }
    
    .timeline-container {
        height: 50px;
    }
    
    .hour-label {
        font-size: 9px;
    }
    
    .timeline-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .time-display {
        justify-content: center;
    }
    
    .timeline-actions {
        justify-content: center;
    }
    
    .timeline-legend {
        flex-direction: row;
        gap: 3px;
        align-items: center;
    }

    .mr-status-badge{
        width: 101px;
    }
}

/* Animation for selection */
@keyframes selectPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.timeline-selection.animate {
    animation: selectPulse 0.3s ease;
}