/* ==========================================================================
   أسماك الخليل (El Khalil Fish) - Dark Theme Stylesheet (Vanilla CSS)
   ========================================================================== */

:root {
    --primary-color: #0b222c;
    --primary-dark: #07161e;
    --primary-light: #164354;
    --accent-color: #13a0c0;
    --accent-hover: #0e839e;
    --accent-light: #66fcf1;
    --accent-gold: #c8963e;
    --text-white: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --bg-body: #f0f2f5;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --success: #25D366;
    --danger: #e63946;
    
    --font-cairo: 'Cairo', sans-serif;
    --font-tajawal: 'Tajawal', sans-serif;
    
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-md: 12px;
    --radius-lg: 24px;
    --radius-sm: 8px;
    --radius-full: 9999px;
    --shadow-sm: 0 4px 15px rgba(7, 22, 30, 0.06);
    --shadow-md: 0 10px 30px rgba(7, 22, 30, 0.1);
    --shadow-lg: 0 20px 50px rgba(7, 22, 30, 0.16);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background-color: var(--bg-body);
    color: var(--text-dark);
    font-family: var(--font-cairo);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.container {
    width: min(100% - 40px, 1200px);
    margin-inline: auto;
}

.spa-view {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.spa-view.active-view {
    display: block;
    opacity: 1;
}

/* ── Shared admin header ── */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background: var(--primary-dark);
    box-shadow: 0 5px 25px rgba(7, 22, 30, 0.18);
}

.header-container {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 800;
}

.logo-icon {
    color: var(--accent-color);
    font-size: 1.55rem;
}

.logo-text {
    font-family: var(--font-tajawal);
    font-size: 1.15rem;
}

/* ── Login page ── */
.admin-login-layout {
    position: relative;
    min-height: calc(100vh - 150px);
    display: grid;
    place-items: center;
    padding: 35px 0;
}

.admin-login-layout::before,
.admin-login-layout::after {
    content: '';
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    filter: blur(2px);
    pointer-events: none;
}

.admin-login-layout::before {
    width: 360px;
    height: 360px;
    top: 80px;
    right: -150px;
    background: rgba(19, 160, 192, 0.1);
}

.admin-login-layout::after {
    width: 430px;
    height: 430px;
    bottom: -210px;
    left: -160px;
    background: rgba(200, 150, 62, 0.08);
}

.admin-login-card {
    width: min(100%, 470px);
    padding: 42px;
    background: var(--bg-white);
    border: 1px solid rgba(7, 22, 30, 0.07);
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
}

.admin-login-title {
    position: relative;
    margin: 0 0 32px;
    padding-bottom: 18px;
    color: var(--primary-color);
    font-family: var(--font-tajawal);
    font-size: 1.65rem;
    font-weight: 900;
    text-align: center;
}

.admin-login-title::after {
    content: '';
    position: absolute;
    right: 50%;
    bottom: 0;
    width: 52px;
    height: 4px;
    border-radius: 999px;
    background: var(--accent-color);
    transform: translateX(50%);
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-color);
    font-size: 0.92rem;
    font-weight: 700;
}

.input-style {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    color: var(--text-dark);
    background: var(--bg-light);
    border: 1px solid #dbe3e8;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

textarea.input-style {
    resize: vertical;
}

.input-style:focus {
    background: #fff;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(19, 160, 192, 0.12);
}

.btn-checkout-submit,
.btn-primary,
.btn-add-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    color: #fff;
    background: var(--accent-color);
    border: 0;
    border-radius: 10px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn-checkout-submit {
    min-height: 50px;
    font-size: 1rem;
}

.btn-checkout-submit:hover,
.btn-primary:hover,
.btn-add-cart:hover {
    color: #fff;
    background: var(--accent-hover);
    box-shadow: 0 8px 20px rgba(19, 160, 192, 0.2);
    transform: translateY(-1px);
}

.alert-success,
.alert-danger {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 13px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
}

.alert-success {
    color: #137b48;
    background: #e9f9f0;
    border: 1px solid #bdebd0;
}

.alert-danger {
    color: #b42330;
    background: #fff0f1;
    border: 1px solid #ffcbd0;
}

/* ── Authenticated admin layout ── */
.admin-dashboard-layout {
    min-height: calc(100vh - 70px);
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: stretch;
}

.admin-sidebar {
    grid-column: 1;
    padding: 28px 16px;
    background: var(--primary-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-sidebar-nav {
    position: sticky;
    top: 98px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.admin-sidebar-link {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 46px;
    padding: 10px 14px;
    color: rgba(255, 255, 255, 0.72);
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 700;
    transition: color 0.2s ease, background 0.2s ease;
}

.admin-sidebar-link i {
    width: 22px;
    color: var(--accent-color);
    font-size: 1.2rem;
    text-align: center;
}

.admin-sidebar-link:hover,
.admin-sidebar-link.active {
    color: #fff;
    background: rgba(19, 160, 192, 0.18);
}

.admin-sidebar-link.active {
    box-shadow: inset -3px 0 0 var(--accent-color);
}

.admin-content-area {
    grid-column: 2;
    min-width: 0;
    padding: 34px;
    color: var(--text-dark);
    background: #f0f2f5;
}

.admin-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.admin-page-title {
    margin: 0;
    color: var(--primary-color);
    font-family: var(--font-tajawal);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 900;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card {
    position: relative;
    min-height: 135px;
    padding: 24px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(7, 22, 30, 0.06);
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
}

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--accent-color);
}

.stat-card.pending::before { background: var(--danger); }
.stat-card.completed::before { background: var(--success); }
.stat-card.revenue::before { background: var(--accent-gold); }

.stat-info {
    position: relative;
    z-index: 2;
}

.stat-info h4 {
    margin: 0 0 10px;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.stat-info p {
    margin: 0;
    color: var(--primary-color);
    font-family: var(--font-tajawal);
    font-size: 2rem;
    font-weight: 900;
}

.stat-icon {
    position: absolute;
    left: 12px;
    bottom: -13px;
    color: rgba(19, 160, 192, 0.1);
    font-size: 5.5rem;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    padding: 14px 13px;
    border-bottom: 1px solid #e9eef1;
    text-align: right;
    vertical-align: middle;
}

.admin-table th {
    color: var(--primary-color);
    background: var(--bg-light);
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

.admin-table tbody tr:hover {
    background: rgba(19, 160, 192, 0.035);
}

.badge-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    color: #275268;
    background: #e9f1f5;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    white-space: nowrap;
}

.badge-status.pending { color: #a35d0b; background: #fff4dd; }
.badge-status.preparing { color: #08788f; background: #e2f7fb; }
.badge-status.confirmed { color: #08788f; background: #e2f7fb; }
.badge-status.completed { color: #137b48; background: #e7f8ee; }
.badge-status.cancelled { color: #a82c36; background: #ffe9eb; }

.reservation-status-select {
    min-width: 132px;
    padding: 7px 10px;
    color: var(--primary-color);
    background: var(--bg-light);
    border: 1px solid #dbe3e8;
    border-radius: 9px;
    outline: none;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.reservation-status-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(19, 160, 192, 0.1);
}

.admin-pagination {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    color: var(--text-dark);
}

.admin-pagination-summary {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.86rem;
}

.admin-pagination-summary strong {
    color: var(--primary-color);
}

.admin-pagination-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    direction: rtl;
}

.admin-page-link,
.admin-page-ellipsis {
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0 11px;
    color: var(--primary-color);
    background: #fff;
    border: 1px solid #dce5e9;
    border-radius: 9px;
    font-size: 0.84rem;
    font-weight: 800;
    white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.admin-page-link:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.admin-page-link.active {
    color: #fff;
    background: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 5px 12px rgba(19, 160, 192, 0.22);
}

.admin-page-link.disabled {
    color: #aab6bd;
    background: #f5f7f8;
    border-color: #e7ecef;
    cursor: not-allowed;
}

.admin-page-ellipsis {
    min-width: 28px;
    padding: 0 5px;
    border-color: transparent;
}

@media (max-width: 1100px) {
    .admin-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .container {
        width: min(100% - 24px, 1200px);
    }

    .header-container {
        min-height: 64px;
    }

    .header-container > div span {
        display: none;
    }

    .admin-dashboard-layout {
        display: block;
    }

    .admin-sidebar {
        padding: 10px 12px;
    }

    .admin-sidebar-nav {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 3px;
    }

    .admin-sidebar-nav hr,
    .admin-sidebar-nav form {
        display: none;
    }

    .admin-sidebar-link {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .admin-content-area {
        padding: 24px 16px;
    }

    .admin-page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-pagination {
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .admin-login-card {
        padding: 28px 22px;
        border-radius: 16px;
    }

    .admin-login-title {
        font-size: 1.4rem;
    }

    .admin-stats-grid {
        grid-template-columns: 1fr;
    }
}
