/* --- Import Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600&display=swap');

/* --- CSS Variables for easy theming --- */
:root {
    --primary-color: #002060; /* Dark Blue */
    --secondary-color: #4d0099; /* Red/Orange Accent */
    --light-gray-bg: #f4f5f7;
    --border-color: #dee2e6;
    --text-color: #495057;
    --header-text-color: #ffffff;
    /* Use Poppins first, fallback to Cairo for Arabic, then system default */
    --font-family: 'Poppins', 'Cairo', sans-serif;
}

/* --- General Body and Layout Styles --- */
body {
    background-color: var(--light-gray-bg);
    font-family: var(--font-family);
    color: var(--text-color);
    font-size: 0.9rem;
}

input[readonly],
textarea[readonly] {
    background-color: #e9ecef; /* Bootstrap-like disabled background */
    opacity: 1; /* Prevent dimming too much */
    cursor: not-allowed;
}

.AppHidden {
    display: none;
}

.page-container {
    padding: 20px;
}

/* --- Top Announcement Banner --- */
.top-banner {
    background-color: var(--primary-color);
    color: #ffc107;
    text-align: center;
    padding: 10px 20px;
    font-weight: 500;
    font-size: 1.2rem; /* Your requested font size */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 45px;
}

/* --- Main Header --- */
.main-header {
    background-color: var(--primary-color);
    color: var(--header-text-color);
    padding: 5px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Style the links inside the first group (main navigation) */
.main-nav-links a {
    color: var(--header-text-color);
    text-decoration: none;
    padding: 10px 15px;
    margin: 0 2px;
    font-size: 1.1rem; /* Your requested font size */
    text-transform: uppercase;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease-in-out;
}

    /* Style for the active navigation link */
    .main-nav-links a.active,
    .main-nav-links a:hover {
        border-bottom-color: var(--header-text-color);
    }

/* --- Header User Actions Group --- */
.user-actions {
    display: flex;
    align-items: center;
    gap: 5px; /* Adds a small space between the items in this group */
}

    .user-actions .welcome-user {
        padding: 10px 15px;
        margin: 0 10px;
        font-weight: 500;
        color: #f0f0f0;
        white-space: nowrap; /* Prevent wrapping */
    }

    .user-actions .lang-switcher {
        color: var(--header-text-color);
        text-decoration: none;
        border: none;
        padding: 10px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

        .user-actions .lang-switcher:hover {
            background-color: rgba(255, 255, 255, 0.1);
        }

        .user-actions .lang-switcher .fa-language {
            font-size: 1.3rem;
        }

    .user-actions .logout-icon {
        font-size: 1.2rem;
        padding: 10px;
        color: var(--header-text-color);
        text-decoration: none;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

        .user-actions .logout-icon:hover {
            background-color: rgba(255, 255, 255, 0.1);
        }


/* --- Content Panels / Cards --- */
.content-panel {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.panel-header {
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title {
    color: var(--secondary-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 1.1rem;
    margin: 0;
}

/* --- Sub-Navigation / Tab Bar --- */
.sub-nav {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}

.sub-nav-item {
    padding: 12px 20px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    border-inline-end: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

    .sub-nav-item:last-child {
        border-inline-end: none;
    }

    .sub-nav-item:hover,
    .sub-nav-item.active {
        background-color: var(--light-gray-bg);
    }

    .sub-nav-item .fa-solid {
        margin-inline-end: 8px;
    }

/* --- Forms & Buttons --- */
.form-label {
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border-radius: 2px;
    border-color: #ced4da;
}

    .form-control:focus,
    .form-select:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0.25rem rgba(0, 32, 96, 0.25);
    }

.btn-main-action {
    background-color: var(--secondary-color);
    color: white;
    border: none;
}

    .btn-main-action:hover {
        background-color: #cc99ff;
        color: black;
    }

.btn-icon-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/*
=====================================================
    ✅ DATA TABLES & GENERAL TABLE STYLES
=====================================================
*/
.table thead th {
    white-space: nowrap;
    background-color: var(--light-gray-bg);
    color: var(--text-color);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    vertical-align: middle;
}

.table tbody td {
    vertical-align: middle;
}

/* Per-column filter input styles */
thead .filters th {
    padding: 5px;
}

thead .filters input {
    width: 100%;
    padding: 4px 6px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: normal;
}
/* Center DataTables native controls (Show entries, search box, pagination) */
.dataTables_wrapper .row:first-of-type > div,
.dataTables_wrapper .row:last-of-type > div {
    display: flex;
    align-items: center;
}

    .dataTables_wrapper .row:last-of-type > div:last-of-type {
        justify-content: flex-end;
    }

[dir="rtl"] .dataTables_wrapper .row:last-of-type > div:last-of-type {
    justify-content: flex-start;
}

/*
=====================================================
    ✅ MODERN LOGIN PAGE STYLES
=====================================================
*/
.login-page-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 120px);
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 450px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border-top: 5px solid var(--primary-color);
}

.login-logo-placeholder {
    background-color: #f8f9fa;
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.login-form-container {
    padding: 30px 40px;
}

    .login-form-container .form-title {
        text-align: center;
        color: var(--text-color);
        font-size: 1.5rem;
        font-weight: 500;
        margin-bottom: 25px;
    }

    .login-form-container .form-control {
        height: 50px;
        padding: 10px 15px;
    }

    .login-form-container .btn-login {
        background-color: var(--light-gray-bg);
        color: var(--primary-color);
        font-weight: 500;
        font-size: 1.1rem;
        border-radius: 4px;
        padding: 12px;
        border: none;
        transition: background-color 0.2s;
    }

        .login-form-container .btn-login:hover {
            background-color: var(--primary-color);
            color: var(--light-gray-bg);
        }

/* Language Switcher on Login Page */
.login-lang-switcher {
    text-align: center;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

    .login-lang-switcher a {
        color: var(--text-color);
        text-decoration: none;
        font-size: 0.9rem;
        opacity: 0.8;
        transition: opacity 0.2s;
    }

        .login-lang-switcher a:hover {
            opacity: 1;
            text-decoration: underline;
        }

    .login-lang-switcher .fa-globe {
        margin-right: 5px;
    }

/* --- RTL (Right-to-Left) Specific Overrides --- */
[dir="rtl"] body {
    text-align: right;
}

[dir="rtl"] .login-lang-switcher .fa-globe {
    margin-right: 0;
    margin-left: 5px;
}

.form-group {
    margin-bottom: 1rem;
}

    .form-group label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 500;
    }

    .form-group input, .form-group select, .form-group textarea {
        width: 100%;
        padding: 0.75rem;
        border-radius: 8px;
        border: 1px solid var(--border-color);
        font-family: 'Poppins', sans-serif;
        font-size: 1rem;
    }

/*.form-row {
    display: flex;
    gap: 1rem;
}

    .form-row .form-group {
        flex: 1;
    }*/

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap; /* Optional: allows wrapping on small screens */
}

    .form-row .form-group {
        flex: 1;
    }

    /* Fixed width columns */
    .form-row .col-1 {
        flex: 0 0 8.3333%;
        max-width: 8.3333%;
    }

    .form-row .col-2 {
        flex: 0 0 16.6667%;
        max-width: 16.6667%;
    }

    .form-row .col-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }

    .form-row .col-4 {
        flex: 0 0 33.3333%;
        max-width: 33.3333%;
    }

    .form-row .col-5 {
        flex: 0 0 41.6667%;
        max-width: 41.6667%;
    }

    .form-row .col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .form-row .col-7 {
        flex: 0 0 58.3333%;
        max-width: 58.3333%;
    }

    .form-row .col-8 {
        flex: 0 0 66.6667%;
        max-width: 66.6667%;
    }

    .form-row .col-9 {
        flex: 0 0 75%;
        max-width: 75%;
    }

    .form-row .col-10 {
        flex: 0 0 83.3333%;
        max-width: 83.3333%;
    }

    .form-row .col-11 {
        flex: 0 0 91.6667%;
        max-width: 91.6667%;
    }

    .form-row .col-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }

.table {
    border: 1px solid #ddd;
}

    /* --- Table Header (thead) --- */

    /* Main Header Row (Column Titles) */
    .table thead th {
        background-color: #f7f7f7;
        color: var(--text-color);
        font-weight: 600;
        border-bottom: 2px solid #ddd;
        text-transform: uppercase;
        font-size: 1.0rem; /* As per your last file */
        vertical-align: middle;
        white-space: nowrap;
        /* ✅ Default alignment for LTR (English) */
        text-align: left;
    }

/* ✅ Override for RTL (Arabic) */
[dir="rtl"] .table thead th {
    text-align: right;
}

/* Filter Row Styles (the <tr> containing the inputs) */
.table thead tr.filters th {
    padding: 8px;
    background-color: #ffffff;
    border-top: 1px solid #ddd;
    border-bottom-width: 1px;
}

/* The <input> search boxes themselves */
.table thead tr.filters input[type="text"] {
    width: 100%;
    padding: 6px 10px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: normal;
}

    .table thead tr.filters input[type="text"]:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 1px var(--primary-color);
        outline: none;
    }


/* --- Table Body (tbody) --- */

.table tbody td {
    vertical-align: middle;
    padding: 10px;
    border: 1px solid #eee; /* Lighter cell borders */
    /* ✅ Default alignment for LTR (English) */
    text-align: left;
}

/* ✅ Override for RTL (Arabic) */
[dir="rtl"] .table tbody td {
    text-align: right;
}

/* Special alignment for multi-line content generated by JS render functions */
.table tbody .text-wrap,
.table tbody .status-booked {
    text-align: left;
}

[dir="rtl"] .table tbody .text-wrap,
[dir="rtl"] .table tbody .status-booked,
[dir="rtl"] .dataTables_wrapper .dataTables_length {
    text-align: right;
}


/* --- DataTables Wrapper Controls (Pagination, Info Text) --- */

/* Hide the default global search and length menu since we have per-column filters
.dataTables_wrapper .dataTables_length, */
.dataTables_wrapper .dataTables_filter {
    display: none;
}

/* Style the bottom row containing "Showing..." text and pagination */
.dataTables_wrapper .row:last-of-type {
    margin-top: 1.5rem;
}

    /* "Showing x of y" text alignment */
    .dataTables_wrapper .row:last-of-type > div:first-of-type {
        display: flex;
        align-items: center;
    }

    /* Pagination alignment */
    .dataTables_wrapper .row:last-of-type > div:last-of-type {
        display: flex;
        align-items: center;
        justify-content: flex-end; /* Default for LTR */
    }

[dir="rtl"] .dataTables_wrapper .row:last-of-type > div:last-of-type {
    justify-content: flex-start; /* Override for RTL */
}

/* --- Style for Required Form Field Labels --- */
.form-label.required::after {
    content: ' *';
    color: var(--secondary-color); /* Uses your theme's red color */
    font-weight: bold;
    margin-inline-start: 2px;
}

/*
=====================================================
    ✅ MODERN FORM LAYOUT & SECTION STYLES
=====================================================
*/

/* Style for the main section headers (e.g., "Booking Details") */
.form-section-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    padding-bottom: 8px;
    border-bottom: 2px solid #9c27b0; /* A nice purple accent */
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

    .form-section-header:first-of-type {
        margin-top: 1rem;
    }

    .form-section-header i {
        margin-inline-end: 10px;
        color: #9c27b0;
    }

/* This is the key fix for the label-input layout */
.form-group {
    display: flex;
    flex-direction: column; /* Stack label and input vertically */
    gap: 5px; /* Add a small space between label and input */
    width: 100%;
}

/* Ensure labels have a consistent style */
.form-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 0; /* Remove default margin */
}

/* Style for read-only/disabled inputs to match the image */
.form-control:disabled,
.form-control[readonly] {
    background-color: #e9ecef; /* Light gray background */
    opacity: 1; /* Ensure text is not faded */
}

/* Specific styling for the payment history table */
.payment-history-table {
    margin-top: 1rem;
}

    .payment-history-table th,
    .payment-history-table td {
        text-align: center;
    }

[dir="rtl"] .payment-history-table th,
[dir="rtl"] .payment-history-table td {
    text-align: right;
}


select.readonly-select {
    background-color: #e9ecef; /* Standard disabled background color */
    pointer-events: none; /* Prevents clicks, making it unchangeable */
    touch-action: none; /* Prevents touch interaction */
    opacity: 1; /* Keep text fully visible */
}

select {
    width: 100%;
    padding: 0.375rem 2rem 0.375rem 0.75rem; /* default LTR: arrow on right */
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    background-color: #fff;
    background-repeat: no-repeat;
    background-size: 1rem;
    background-position: right 0.5rem center;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='black' height='16' viewBox='0 0 24 24' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
}

/* RTL Override */
[dir="rtl"] select {
    padding: 0.375rem 0.75rem 0.375rem 2rem; /* arrow on left */
    text-align: right;
    background-position: left 0.5rem center;
}

/* Fullscreen overlay */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8); /* White semi-transparent */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Spinner animation */
.loader {
    border: 6px solid #f3f3f3; /* Light grey */
    border-top: 6px solid var(--primary-color, #002060); /* Theme primary */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}
/* 🔸 Uniform height for filter inputs and select2 */
.filters th input.form-control,
.filters th .select2-container .select2-selection--single {
    height: 32px !important; /* same height for both */
    line-height: 32px !important;
    padding: 2px 8px !important; /* same padding */
    box-sizing: border-box;
}

/* 🔸 Align select2 selection text properly */
.filters th .select2-container .select2-selection__rendered {
    line-height: 30px !important; /* slightly less than total height for balance */
    padding-left: 8px !important;
    padding-right: 24px !important; /* space for clear + arrow */
}

/* 🔸 Arrow alignment */
.filters th .select2-container .select2-selection__arrow {
    top: 50% !important;
    transform: translateY(-50%);
}

/* 🔸 Clear (x) button alignment */
.filters th .select2-container .select2-selection__clear {
    top: 50% !important;
    transform: translateY(-50%);
}

/* 🔸 Optional: make sure table headers don't clip the controls */
.filters th {
    vertical-align: middle !important;
    padding: 4px !important;
}

@media print {
    html, body {
        margin: 0;
        padding: 0;
        height: 100%;
    }
    .buttons {
        display: none !important;
    }
    .printable-content {
        width: 210mm;
        min-height: 297mm;
        max-height: 297mm;
        margin: 0 auto;
        padding: 0;
        overflow: hidden;
        box-sizing: border-box;
        page-break-after: avoid;
        page-break-before: avoid;
        page-break-inside: avoid;
    }
}

.swal-wide {
    max-width: 1000px !important;
    width: 80% !important;
}