/*
 * css/booking.css - Premium booking page styles
 * FIXED: Hero content properly overlaid on background
 * Uses main.css centralized styles and variables - NO hardcoded colors/fonts
 */

/* =============================================
 * CRITICAL FIX: HERO BACKGROUND IMAGE
 * ============================================= */

/* Force hero slideshow background image */
.hero-slideshow {
    position: relative !important;
    min-height: 65vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    z-index: 1 !important;
    /* Multiple fallback background images with correct paths */
    background-image: 
        url('./images/slider/heritage-srilanka-main-sliderjpg.jpg'),
        url('../images/slider/heritage-srilanka-main-sliderjpg.jpg'),
        url('/images/slider/heritage-srilanka-main-sliderjpg.jpg'),
        url('images/slider/heritage-srilanka-main-sliderjpg.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
}

/* Dynamic background layers - absolute positioned behind content */
.hero-slideshow .hero-bg-layer,
.hero-slideshow .slick-slide img,
.hero-slideshow .hero-background,
.hero-slideshow .slick-slide {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    z-index: 1 !important; /* Background layer */
}

/* Ensure slideshow images cover the full area */
.hero-slideshow img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Dark overlay for better text readability - REDUCED OPACITY */
.hero-slideshow::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(to bottom, 
        rgba(0, 0, 0, 0.3) 0%, 
        rgba(0, 0, 0, 0.2) 50%, 
        rgba(0, 0, 0, 0.4) 100%) !important;
    z-index: 2 !important; /* Above background but below content */
    pointer-events: none !important;
}

/* Hero content container - above overlay */
.hero-slideshow .container {
    position: relative !important;
    z-index: 10 !important; /* Above everything else */
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Hero content wrapper */
#hero-content {
    position: relative !important;
    z-index: 10 !important;
    text-align: center !important;
    padding: 3rem 1rem !important;
    width: 100% !important;
    max-width: 800px !important;
}

/* Hero title styling - ensure visibility */
#hero-title {
    color: var(--white-color) !important;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.9) !important;
    font-size: 3.5rem !important;
    font-weight: 700 !important;
    margin-bottom: 1.5rem !important;
    line-height: 1.2 !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Hero subtitle styling */
#hero-subtitle {
    color: var(--white-color) !important;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8) !important;
    font-size: 1.3rem !important;
    opacity: 0.95 !important;
    margin-bottom: 2.5rem !important;
    line-height: 1.5 !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Hero badges container - centered alignment */
.hero-badges {
    position: relative !important;
    z-index: 10 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 1rem !important;
    margin: 2rem auto 0 auto !important;
    max-width: 600px !important; /* Constrain width for better alignment */
}

/* Individual badge styling */
.hero-badges .badge {
    backdrop-filter: blur(15px) !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    padding: 0.7rem 1.2rem !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5) !important;
    transition: all 0.3s ease !important;
}

.hero-badges .badge:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4) !important;
}

/* Colored badges with proper contrast */
.hero-badges .bg-success {
    background: rgba(40, 167, 69, 0.8) !important;
    color: white !important;
}

.hero-badges .bg-primary {
    background: rgba(0, 123, 255, 0.8) !important;
    color: white !important;
}

.hero-badges .bg-warning {
    background: rgba(255, 193, 7, 0.9) !important;
    color: var(--dark-color) !important;
}

.hero-badges .bg-info {
    background: rgba(23, 162, 184, 0.8) !important;
    color: white !important;
}

/* Hero glow effect - positioned correctly */
.hero-glow {
    position: absolute !important;
    bottom: -60px !important;
    left: 0 !important;
    width: 100% !important;
    height: 120px !important;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        var(--dark-color) 100%) !important;
    z-index: 3 !important; /* Above overlay but below content */
    pointer-events: none !important;
}

/* Ensure proper stacking context for booking page */
.booking-page .hero-slideshow {
    background-attachment: fixed !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Force visibility of all hero elements */
.hero-slideshow,
.hero-slideshow .container,
#hero-content,
#hero-title,
#hero-subtitle,
.hero-badges {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.hero-badges {
    display: flex !important;
}

/* =============================================
 * BOOKING FORM SECTION - ALIGNED WITH HERO
 * ============================================= */

.booking-form-section {
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--dark-secondary) 100%) !important;
    padding: 3rem 0 4rem 0 !important;
    min-height: auto;
    position: relative;
    margin-top: -50px !important; /* Overlap with hero */
    z-index: 5 !important; /* Above hero but below header */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.booking-form-section .container {
    max-width: 1200px !important; /* Match hero container */
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 1rem !important;
}

.booking-form-section .row {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
    margin: 0 !important;
}

.booking-form-section .col-lg-8 {
    width: 100% !important;
    max-width: 800px !important; /* Match hero content width */
    margin: 0 auto !important;
    padding: 0 !important;
}

.booking-form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(var(--primary-color-rgb), 0.08) 0%, transparent 50%);
    pointer-events: none;
}

/* =============================================
 * FORCE FORM VISIBILITY - CRITICAL
 * ============================================= */

.booking-card,
.form-sections,
.form-section,
.form-grid,
.form-group,
.form-label,
.form-control,
.form-select,
.submit-btn {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.form-grid {
    display: grid !important;
}

.submit-btn {
    display: inline-flex !important;
}

/* =============================================
 * HIDE DUPLICATE BOOKING CONTENT IN FORM SECTION
 * ============================================= */

.booking-header {
    display: none !important;
}

/* =============================================
 * PREMIUM BOOKING CARD - PERFECTLY CENTERED
 * ============================================= */

.booking-card {
    background: linear-gradient(145deg, var(--card-background) 0%, var(--dark-color) 100%) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius-large) !important;
    box-shadow: var(--shadow-large) !important;
    padding: 3rem !important;
    position: relative;
    overflow: visible !important;
    margin: 0 auto !important;
    transition: var(--transition-smooth) !important;
    width: 100% !important;
    max-width: 800px !important;
    display: block !important;
}

/* Alert messages container - centered */
../booking.html-message {
    max-width: 800px !important;
    margin: 0 auto 2rem auto !important;
    text-align: center !important;
}

.booking-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, rgba(var(--primary-color-rgb), 0.03), rgba(var(--accent-color-rgb), 0.02));
    border-radius: var(--border-radius-large);
    z-index: -1;
}

.booking-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-extra-large);
}

/* =============================================
 * FORM SECTIONS
 * ============================================= */

.form-sections {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
    width: 100% !important;
}

.form-section {
    position: relative !important;
    background: transparent !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
}

.section-title {
    color: var(--light-text);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.section-title i {
    color: var(--primary-color);
    font-size: 1.2em;
    filter: drop-shadow(0 0 8px rgba(var(--primary-color-rgb), 0.5));
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

/* =============================================
 * FORM LAYOUT - ENHANCED SPACING
 * ============================================= */

.form-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap: 2rem !important;
    width: 100% !important;
}

.form-group {
    position: relative !important;
    margin-bottom: 0 !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

.form-group.full-width {
    grid-column: 1 / -1 !important;
}

/* =============================================
 * FORM CONTROLS - ENHANCED CLARITY
 * ============================================= */

.form-label {
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    margin-bottom: 0.75rem !important;
    display: block !important;
    text-transform: none !important;
    letter-spacing: 0.3px !important;
    line-height: 1.3 !important;
}

.form-label.required::after {
    content: " *";
    color: #00bcd4 !important;
    font-weight: 700;
    font-size: 1.1em;
}

.form-control,
.form-select {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    padding: 1rem 1.25rem !important;
    font-size: 1rem !important;
    font-weight: 400 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    min-height: 48px !important;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
    font-style: italic !important;
    font-weight: 300 !important;
}

.form-control:focus,
.form-select:focus {
    outline: none !important;
    border-color: #00bcd4 !important;
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.2), 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    color: #ffffff !important;
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m6 8 4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 1rem center !important;
    background-repeat: no-repeat !important;
    background-size: 1.2em 1.2em !important;
    padding-right: 3rem !important;
    cursor: pointer !important;
}

.form-select option {
    background: #2c2c2c !important;
    color: #ffffff !important;
    padding: 0.75rem !important;
}

.form-select:hover {
    border-color: rgba(0, 188, 212, 0.6) !important;
}

textarea.form-control {
    min-height: 160px !important;
    resize: vertical !important;
    line-height: 1.6 !important;
    font-family: inherit !important;
}

/* =============================================
 * CHARACTER COUNTER (Added by JS)
 * ============================================= */

.character-counter {
    font-size: 0.85rem;
    margin-top: 0.25rem;
    text-align: right;
    color: var(--muted-text);
}

/* =============================================
 * VALIDATION FEEDBACK - ENHANCED
 * ============================================= */

.invalid-feedback {
    color: #ff5252 !important;
    font-size: 0.875rem !important;
    margin-top: 0.5rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    font-weight: 500 !important;
}

.invalid-feedback::before {
    content: "⚠" !important;
    color: #ff5252 !important;
}

.form-control.is-valid {
    border-color: #4caf50 !important;
    background: rgba(76, 175, 80, 0.1) !important;
}

.form-control.is-invalid {
    border-color: #ff5252 !important;
    background: rgba(255, 82, 82, 0.1) !important;
}

.form-control.is-valid + .invalid-feedback {
    display: none !important;
}

/* Success feedback */
.valid-feedback {
    color: #4caf50 !important;
    font-size: 0.875rem !important;
    margin-top: 0.5rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    font-weight: 500 !important;
}

.valid-feedback::before {
    content: "✓" !important;
    color: #4caf50 !important;
}

/* =============================================
 * SUBMIT SECTION
 * ============================================= */

.submit-section {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.submit-btn {
    background: var(--primary-gradient) !important;
    color: var(--white-color) !important;
    border: none !important;
    border-radius: var(--border-radius) !important;
    padding: 1rem 2.5rem !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    font-family: var(--font-heading) !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    transition: var(--transition-fast) !important;
    box-shadow: var(--button-shadow) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    position: relative !important;
    overflow: hidden !important;
}

.submit-btn::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.6s ease;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: var(--button-shadow-hover) !important;
    background: var(--primary-hover-gradient) !important;
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.btn-icon {
    font-size: 1.1rem;
}

.submit-info {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted-text);
    font-size: 0.875rem;
    font-weight: 500;
}

.info-item i {
    color: var(--primary-color);
}

/* =============================================
 * ALERT MESSAGES
 * ============================================= */

.alert {
    border: none;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
    font-weight: 500;
    box-shadow: var(--shadow-light);
    border-left: 4px solid;
    backdrop-filter: blur(10px);
}

.alert-success {
    background: var(--success-background);
    color: var(--success-color);
    border-left-color: var(--success-color);
}

.alert-danger {
    background: var(--error-background);
    color: var(--error-color);
    border-left-color: var(--error-color);
}

/* =============================================
 * ACCESSIBILITY FEATURES
 * ============================================= */

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

/* =============================================
 * RESPONSIVE DESIGN
 * ============================================= */

@media (max-width: 1199.98px) {
    #hero-title {
        font-size: 3rem !important;
    }
    
    #hero-subtitle {
        font-size: 1.2rem !important;
    }
}

@media (max-width: 991.98px) {
    .booking-card {
        padding: 2rem !important;
    }
    
    .form-grid {
        grid-template-columns: 1fr !important;
    }
    
    .booking-form-section {
        margin-top: -40px !important;
    }
    
    #hero-title {
        font-size: 2.5rem !important;
    }
    
    #hero-subtitle {
        font-size: 1.1rem !important;
    }
}

@media (max-width: 768px) {
    /* Hero responsive adjustments */
    .hero-slideshow {
        min-height: 55vh !important;
        background-attachment: scroll !important;
    }
    
    .hero-slideshow .container {
        padding: 0 1rem !important;
    }
    
    #hero-content {
        padding: 2rem 1rem !important;
        max-width: 100% !important;
    }
    
    #hero-title {
        font-size: 2.2rem !important;
        margin-bottom: 1rem !important;
    }
    
    #hero-subtitle {
        font-size: 1rem !important;
        margin-bottom: 2rem !important;
    }
    
    .hero-badges {
        gap: 0.75rem !important;
        max-width: 100% !important;
    }
    
    .hero-badges .badge {
        padding: 0.5rem 0.9rem !important;
        font-size: 0.8rem !important;
    }
    
    .booking-form-section {
        padding: 2rem 1rem 3rem 1rem !important;
        margin-top: -30px !important;
    }
    
    .booking-form-section .container {
        padding: 0 !important;
    }
    
    .booking-card {
        padding: 2rem !important;
        margin: 0 !important;
        width: 100% !important;
    }
    
    .submit-btn {
        width: 100% !important;
        padding: 1rem 1.5rem !important;
    }
    
    .submit-info {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 576px) {
    .hero-slideshow {
        min-height: 50vh !important;
    }
    
    #hero-content {
        padding: 1.5rem 0.5rem !important;
    }
    
    #hero-title {
        font-size: 1.8rem !important;
    }
    
    #hero-subtitle {
        font-size: 0.95rem !important;
    }
    
    .hero-badges {
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.5rem !important;
    }
    
    .booking-card {
        padding: 1rem !important;
        margin: 0.5rem !important;
    }
    
    .section-title {
        font-size: 1.1rem;
        text-align: center;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .booking-form-section {
        margin-top: -20px !important;
    }
}