/**
 * Booking Styles - Shared CSS for hotel and bus booking pages
 * Mobile-first responsive design with desktop fallbacks
 */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

/* Autocomplete Container */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none;
}

.suggestion-item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Validation Messages */
.validation-error {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.validation-success {
    color: var(--success-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Form Controls */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* Card Styles */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Badges */
.badge {
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .autocomplete-suggestions {
        max-height: 200px;
    }

    .form-control,
    .form-select,
    input[type="date"],
    input[type="email"],
    input[type="tel"] {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }

    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

/* Booking Widget - Sticky on Desktop */
@media (min-width: 992px) {
    .booking-widget {
        position: sticky;
        top: 100px;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

/* Accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Error Messages */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
}

.error-message strong {
    font-weight: 600;
}

/* Success Messages */
.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
}

/* Info Messages */
.info-message {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
}

/* Pricing Display */
.pricing-breakdown {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
}

.price-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.price-row.total {
    border-top: 2px solid #dee2e6;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-color);
}

/* Responsive Grid */
@media (max-width: 768px) {
    .row {
        flex-direction: column;
    }

    .col-md-8,
    .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Touch Friendly */
@media (hover: none) {
    .btn,
    .suggestion-item {
        padding: 0.75rem;
    }

    .btn {
        min-height: 44px;
    }
}

/* Print Styles */
@media print {
    .form-control,
    .btn,
    .booking-widget {
        display: none;
    }

    .booking-confirmation {
        width: 100%;
        max-width: 100%;
    }
}
