/*
//  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;
    display: flex;
    align-items: flex-end;
    transition: background-image 0.5s ease-in-out;
}

/* Skeleton Loading Effect */
.hero-loading {
    position: relative;
    background-color: #1a1f3c;
    overflow: hidden;
}

.hero-loading::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: 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: 2;
    padding: 0 30px;
    color: var(--text-white);
}

.logo {
    width: 90px;
    margin-bottom: 20px;
    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);
    -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, 45px);
    text-transform: uppercase;
}

.text p {
    font-size: clamp(28px, 4vw, 45px);
    margin: 10px 0;
    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);
}

/* --- 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;
}

/* 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; }

/* 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: 15px;
    width: 100%;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    margin-bottom: 30px;
    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);
}

.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: 15px; /* 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: 80px; height: 80px; 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.6rem;
}

[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; }

/* =========================================
   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: 75px; }
    .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);
    }
}