/**
 * Real-time Booking Styles
 * CSS styles cho real-time booking notifications và UI
 * Tác giả: AI Assistant
 * Ngày: 2024
 */

/* =============================================
   Real-time Booking Notification Styles
   ============================================= */

/* Real-time notification modal */
#realtime-notification .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

#realtime-notification .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    padding: 20px;
}

#realtime-notification .modal-title {
    font-weight: 600;
    font-size: 18px;
}

#realtime-notification .modal-body {
    padding: 25px;
    font-size: 16px;
    line-height: 1.6;
}

#realtime-notification .modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e9ecef;
}

#realtime-notification .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

    #realtime-notification .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    }

/* Reservation timer */
.reservation-timer {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* Real-time slot status indicators */
.timepicker-button {
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 5px;
    padding: 12px 20px;
    background: white;
}

    .timepicker-button:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .timepicker-button.disabled {
        background: #f8f9fa;
        color: #6c757d;
        border-color: #dee2e6;
        cursor: not-allowed;
        opacity: 0.6;
    }

        .timepicker-button.disabled:hover {
            transform: none;
            box-shadow: none;
        }

/* Real-time connection status */
.realtime-connection-status {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 10px 15px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

    .realtime-connection-status.connected {
        background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
        color: white;
    }

    .realtime-connection-status.disconnected {
        background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
        color: white;
    }

    .realtime-connection-status.reconnecting {
        background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
        color: white;
        animation: pulse 1.5s infinite;
    }

/* Real-time slot updates animation */
.slot-update-animation {
    animation: slideInFromTop 0.5s ease-out;
}

@keyframes slideInFromTop {
    0% {
        transform: translateY(-20px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Real-time notification toast */
.realtime-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    max-width: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-left: 4px solid #667eea;
    animation: slideInFromRight 0.5s ease-out;
}

@keyframes slideInFromRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.realtime-toast .toast-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    padding: 15px 20px;
    font-weight: 600;
}

.realtime-toast .toast-body {
    padding: 20px;
    font-size: 14px;
    line-height: 1.5;
}

/* Real-time slot capacity indicator */
.slot-capacity-indicator {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

    .slot-capacity-indicator.high {
        background: #d4edda;
        color: #155724;
    }

    .slot-capacity-indicator.medium {
        background: #fff3cd;
        color: #856404;
    }

    .slot-capacity-indicator.low {
        background: #f8d7da;
        color: #721c24;
    }

/* Real-time booking form enhancements */
.realtime-booking-form {
    position: relative;
}

    .realtime-booking-form .form-group {
        position: relative;
    }

    .realtime-booking-form .form-control {
        transition: all 0.3s ease;
        border-radius: 8px;
        border: 2px solid #e9ecef;
    }

        .realtime-booking-form .form-control:focus {
            border-color: #667eea;
            box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
        }

        .realtime-booking-form .form-control.realtime-updated {
            border-color: #28a745;
            background-color: #f8fff9;
        }

        .realtime-booking-form .form-control.realtime-error {
            border-color: #dc3545;
            background-color: #fff8f8;
        }

/* Real-time loading spinner */
.realtime-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Real-time booking button states */
.btn-booking-realtime {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

    .btn-booking-realtime:before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s;
    }

    .btn-booking-realtime:hover:before {
        left: 100%;
    }

    .btn-booking-realtime.loading {
        pointer-events: none;
        opacity: 0.7;
    }

        .btn-booking-realtime.loading:after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 20px;
            height: 20px;
            border: 2px solid #f3f3f3;
            border-top: 2px solid #667eea;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .realtime-connection-status {
        top: 10px;
        right: 10px;
        font-size: 12px;
        padding: 8px 12px;
    }

    .realtime-toast {
        top: 60px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }

    .reservation-timer {
        margin: 10px 0;
        padding: 12px;
        font-size: 14px;
    }

    .timepicker-button {
        padding: 10px 15px;
        font-size: 14px;
        margin: 3px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .realtime-toast {
        background: #2d3748;
        color: white;
    }

        .realtime-toast .toast-body {
            color: #e2e8f0;
        }

    .timepicker-button {
        background: #2d3748;
        color: #e2e8f0;
        border-color: #4a5568;
    }

        .timepicker-button:hover {
            background: #4a5568;
        }

        .timepicker-button.disabled {
            background: #1a202c;
            color: #718096;
            border-color: #2d3748;
        }
}
