/*
//  Created by Mohammad Rabi on 05/01/2026.
//  Copyright © 2026 Horizon Stay. All rights reserved.
*/

/* =========================================
   1. VARIABLES & SETUP
   ========================================= */
:root {
    /* Brand Colors */
    --brand-red: #ed4264;
    --brand-gold: #ffedbc;
    --brand-gradient: linear-gradient(90deg, var(--brand-red), var(--brand-gold));

    /* Backgrounds */
    --bg-body: #0d1126;
    --bg-card: #151b36;
    --bg-input: #0d1126;
    
    /* Text Colors */
    --text-primary: #e0e0e0;
    --text-secondary: #ccc;
    --text-muted: #888;
    --text-white: #ffffff;
    --text-readonly: rgba(255, 255, 255, 0.35);

    /* Borders & Overlays */
    --border-light: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    --overlay-dark: rgba(13, 17, 38, 0.85);
}

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', 'Helvetica', 'Arial', 'sans-serif';
}

body {
    background: var(--bg-body);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =========================================
   2. HERO SECTION
   ========================================= */
.hero {
    position: relative;
    width: 100%;
    height: 30vh;
    min-height: 320px;
    background: center / cover no-repeat;
    background-color: var(--bg-card); /* Dark fallback while loading */
    display: flex;
    align-items: flex-end;
}

/* Skeleton Loading Effect */
.hero.skeleton {
    position: relative;
    overflow: hidden;
}

.hero.skeleton::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    z-index: 3; /* <--- INCREASED: Forces it above the dark overlay */
}

/* Smooth Fade-in when image is ready */
.hero.loaded {
    animation: fadeInHero 0.5s ease-in-out forwards;
}

@keyframes fadeInHero {
    from { opacity: 0.8; }
    to { opacity: 1; }
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(13, 17, 38, 1), rgba(13, 17, 38, 0.65), transparent);
}

.content {
    position: relative;
    z-index: 4;
    padding: 0 30px;
    color: var(--text-white);
}

.logo {
    width: 110px;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

/* Typography Gradient */
.text h1, .text p {
    font-weight: 700;
    letter-spacing: 0.15em;
    background: var(--brand-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.5));
}

.text h1 {
    font-size: clamp(28px, 4vw, 1px);
    text-transform: uppercase;
}

.text p {
    font-size: clamp(20px, 4vw, 1px);
    margin: 10px 0;
    font-weight: 400;
    opacity: 1;
}

/* =========================================
   3. CHECK-IN FORM
   ========================================= */
.form-container {
    width: 100%;
    padding: 0 25px;
    margin-top: 20px; 
    position: relative;
    z-index: 10;
}

.checkin-form {
    background-color: var(--bg-card);
    padding: 25px 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-width: 800px;
    margin: 0 auto 80px auto;
}

.form-intro { text-align: left; margin-bottom: 25px; }

.intro-title {
    font-size: 1.6rem;
    font-weight: 500;
    margin-bottom: 15px;
    display: inline-block;
}

.form-intro p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 100%;
    margin: 0 auto;
}

/* Layout Grid */
.form-group { margin-bottom: 20px; display: flex; flex-direction: column; }
.form-row { display: flex; gap: 20px; }
.form-row .form-group { flex: 1; }

label {
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 400;
}

/* Inputs & Selects */
input, select {
    background-color: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0px 15px;
    color: var(--text-white);
    width: 100%;
    font-size: 1rem;
    outline: none;
    height: 44px; 
    transition: border-color 0.3s;
}

input:focus, select:focus {
    border-color: var(--brand-red);
}


/* =========================================
   CUSTOM CALENDAR ICON
   ========================================= */
#date-display {
    /* Pure CSS SVG of a sleek white calendar */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 18px;
    padding-right: 40px; /* Prevents long text from typing over the icon */
    opacity: 0.8;
}

/* RTL Support for the Arabic Layout */
[dir="rtl"] #date-display {
    background-position: left 15px center;
    padding-right: 15px;
    padding-left: 40px;
    direction: ltr;
    text-align: right;
}

/* --- FIX: SAFARI/CHROME AUTOFILL YELLOW BACKGROUND --- */

/* 1. General Autofill State (Not focused) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:active {
    /* Cover yellow background with dark inset shadow */
    -webkit-box-shadow: 0 0 0 1000px var(--bg-input) inset !important;
    -webkit-text-fill-color: var(--text-white) !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* 2. Focused Autofill State (The fix for the red border) */
input:-webkit-autofill:focus {
    /* Layered shadows: Top layer is thin red border, Bottom layer is dark background fill */
    -webkit-box-shadow: 0 0 0 1px var(--brand-red) inset, 0 0 0 1000px var(--bg-input) inset !important;
    -webkit-text-fill-color: var(--text-white) !important;
    /* Ensure standard border property matches just to be safe */
    border-color: var(--brand-red) !important; 
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("images/downChevronIcon.png");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    cursor: pointer;
}

/* Force Number Input Arrows White */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    filter: invert(1);
    cursor: pointer;
    opacity: 1;
}

/* Fix Chrome Date Picker Icon Color & Cursor */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1); /* Flips the black icon to white */
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* =========================================
   CLEANING PAGE SPINNER (Perfect Alignment)
   ========================================= */
.input-spinner {
    position: absolute;
    right: 16px; 
    bottom: 14px; /* Anchors it perfectly inside the select box, ignoring the label */
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--grad-start);
    border-radius: 50%;
    display: none;
    pointer-events: none;
    z-index: 5;
    animation: spin 0.8s linear infinite; /* Reverted to a simple spin */
}

.input-spinner.active {
    display: block; 
}

/* Temporarily erases BOTH native and custom background arrows */
select.hide-arrow {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: none !important; 
}

select.hide-arrow::-ms-expand {
    display: none !important;
}

/* Simple spin animation without the vertical shift */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Read Only Inputs */
.readonly-input {
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--text-readonly);
    border-color: rgba(255, 255, 255, 0.05);
    cursor: default;
}
.readonly-input:focus { border-color: rgba(255, 255, 255, 0.05); }

/* Update the Main Container */
.custom-upload {
    background-color: rgba(255, 255, 255, 0.02);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    
    /* Optimize Mobile Touch */
    touch-action: manipulation; /* Removes tap delay on mobile */
    -webkit-tap-highlight-color: transparent; /* Removes default grey tap box */
    
    transition: all 0.3s ease; /* Keep transition for smooth DESKTOP hover */
}

/* 2. Mobile: INSTANT Red Border on Tap (Finger Press) */
/* The 'transition: none' fixes the "Long Tap" issue */
.custom-upload:active {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--brand-red);
    transition: none; /* <--- CRITICAL FIX: Changes color instantly! */
    transform: scale(0.98); /* Slight press animation */
}

.upload-placeholder img { width: 40px; margin-bottom: 10px; opacity: 0.7; }
.upload-placeholder p { color: var(--text-white); font-weight: 600; margin-bottom: 5px; }
.upload-placeholder span { color: var(--text-muted); font-size: 0.8rem; }


/* =========================================
   TEXTAREA STYLING (Additional Notes)
   ========================================= */
textarea {
    width: 100%;
    padding: 14px 15px;
    background-color: var(--bg-body); /* Matches your dark inputs */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    
    /* Good UX: Lets users make the box taller if they write a lot, but stops it from breaking your layout horizontally */
    resize: vertical; 
    min-height: 80px;
}

textarea::placeholder {
    color: #888;
}

textarea:focus {
    border-color: var(--brand-red); 
}

/* File List & Thumbnails */
.file-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.file-item {
    position: relative;
    width: 100%; height: 100px;
    border-radius: 8px; overflow: hidden;
    border: 1px solid var(--border-light);
    background: #000;
}

.file-item img { width: 100%; height: 100%; object-fit: cover; }

.file-item .file-icon {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: #1a1f3c;
    color: var(--text-secondary);
    font-size: 0.7rem; text-align: center; padding: 5px;
}

.remove-btn {
    position: absolute; top: 5px; right: 5px;
    background: rgba(237, 66, 100, 0.9);
    color: white; border: none;
    width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    line-height: 0; font-size: 16px; padding-bottom: 2px;
    cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    transition: transform 0.2s;
}
.remove-btn:hover { transform: scale(1.2); background: #ff4b6e; }

/* =========================================
   4. BUTTONS & UI ELEMENTS
   ========================================= */
.btn-submit {
    background: var(--brand-gradient);
    color: var(--bg-body);
    border: none;
    padding: 12px;
    width: 100%;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    margin-bottom: 15px;
    transition: transform 0.2s, opacity 0.2s;
}

.btn-submit:hover { 
    opacity: 0.95; 
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(237, 66, 100, 0.3); 
}
.btn-submit:disabled { 
    opacity: 0.6; cursor: not-allowed; transform: none; 
}

.lang-btn {
    position: absolute;
    top: 20px; right: 20px; z-index: 100;
    background: rgba(13, 17, 38, 0.2);
    border: 1px solid var(--border-light);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    backdrop-filter: blur(5px);
    transition: all 0.2s;
    color: rgba(255, 255, 255, 0.9);
}

.lang-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.1);
}

.spinner {
    display: inline-block;
    width: 18px; height: 18px;
    margin-left: 10px;
    border: 3px solid rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    border-top-color: var(--bg-body);
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

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

/* =========================================
   5. MODAL
   ========================================= */
.modal-overlay {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: var(--overlay-dark);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.show { opacity: 1; visibility: visible; pointer-events: auto; }

.modal-card {
    background: var(--bg-card);
    width: 65%; max-width: 600px;
    padding: 20px 20px; border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: translateY(30px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 85vh;       /* Never taller than 85% of screen */
    overflow-y: auto;       /* Scroll if content is too long */
    overscroll-behavior: contain; /* CRITICAL: Stops scroll from passing to background */
}

.modal-overlay.show .modal-card { transform: translateY(0); }

#modal-title { font-size: 1.5rem; margin-bottom: 15px; color: var(--text-white); }

#modal-message {
    color: var(--text-secondary);
    font-size: 1rem; margin-bottom: 25px;
    line-height: 1.5;
    text-align: left; width: 100%;
}

#modal-message a {
    color: var(--brand-red);
    text-decoration: none; font-weight: bold;
    border-bottom: 1px solid rgba(237, 66, 100, 0.3);
    transition: all 0.2s;
}
#modal-message a:hover { color: var(--brand-gold); border-bottom-color: var(--brand-gold); }

#modal-close-btn {
    background: transparent; /* Remove background to make it secondary */
    color: var(--text-secondary); /* Softer text color */
    border: 1px solid var(--border-light);
    padding: 12px; /* Match padding of submit btn */
    border-radius: 8px; /* Match radius of submit btn */
    cursor: pointer;
    font-weight: 500;
    width: 100%; 
    font-size: 1rem;
    transition: all 0.2s;
}

#modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
    border-color: var(--text-white);
}

#download-pdf-btn {
    display: none; 
    width: 100%;
    margin-top: 10px;
    margin-bottom: 15px;
    background: var(--brand-gradient); 
    color: var(--bg-body);     
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    transition: transform 0.2s, opacity 0.2s;
}

#download-pdf-btn:hover {
    opacity: 0.95; 
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(237, 66, 100, 0.3); 
}

.success-icon, .error-icon {
    width: 60px; height: 60px; margin: 0 auto 20px auto;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.success-icon { background: rgba(37, 211, 102, 0.1); }
.success-icon svg { width: 40px; fill: #25D366; }

.error-icon { background: rgba(237, 66, 100, 0.1); }
.error-icon svg { width: 40px; fill: #ed4264; }

/* =========================================
   6. FOOTER
   ========================================= */
footer {
    background-color: var(--bg-card);
    text-align: center; padding: 30px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: auto;
}
.footer-text { color: var(--text-muted); font-size: 0.8rem; letter-spacing: 1px;}

/* =========================================
   7. RTL SUPPORT (ARABIC)
   ========================================= */
[dir="rtl"] { 
    direction: rtl; 
    text-align: right; 
    /* 1. Change Font to one that supports Arabic better */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 2. Increase Font Size for Arabic elements by approx 15% */
[dir="rtl"] .form-intro p,
[dir="rtl"] label,
[dir="rtl"] input,
[dir="rtl"] select,
[dir="rtl"] .btn-submit,
[dir="rtl"] #modal-message,
[dir="rtl"] #modal-title {
    font-size: 1.15rem; 
}

/* Make Arabic Titles slightly bigger */
[dir="rtl"] .intro-title {
    font-size: 1.4rem;
}

[dir="rtl"] .text h1 {
    font-size: clamp(35px, 4vw, 1px);
    text-transform: uppercase;
}

[dir="rtl"] .lang-btn { right: auto; left: 20px; }
[dir="rtl"] .form-intro { text-align: right; }
[dir="rtl"] select { background-position: left 15px center; padding-right: 15px; padding-left: 30px; }
[dir="rtl"] #modal-message { text-align: right; }

[dir="rtl"] #whatsapp,
[dir="rtl"] #email {
    direction: rtl;
    text-align: right;
}

/* Move the spinner to the left side in Arabic */
[dir="rtl"] .input-spinner {
    right: auto; /* Clears the English right-side positioning */
    left: 16px;  /* Pins it to the left side exactly where the arrow is */
}

/* =========================================
   8. MEDIA QUERIES (MOBILE)
   ========================================= */
@media (max-width: 768px) {
    .intro-title { font-size: 1.4rem; }
    .form-intro { margin-bottom: 25px; }
    .form-intro p { font-size: 1rem; max-width: 100%; }
    .logo { width: 80px; }
    .form-row { flex-direction: column; gap: 0; }
    .modal-card { width: 85%; }
}

/* Only show white background on devices with a mouse */
@media (hover: hover) {
    .lang-btn:hover { background: white; color: black; }
}

/* 1. Desktop: Smooth Red Fade on Hover (Mouse Only) */
@media (hover: hover) {
    .custom-upload:hover {
        background-color: rgba(255, 255, 255, 0.05);
        border-color: var(--brand-red);
    }
}