/* ============================================================
   VAULTIXAI — Admin Panel Stylesheet
   Stack: Bootstrap 5 + Premium Sidebar + Card Overrides
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&display=swap');

/* ─── CSS Variables ──────────────────────────────────────────── */
:root {
    --clr-bg:         #f1f5f9;
    --clr-sidebar:    #080f1e;
    --clr-sidebar-2:  #0d1c35;
    --clr-gold:       #d4960f;
    --clr-gold-lt:    #f0b429;
    --clr-gold-glow:  rgba(212,150,15,.3);
    --clr-white:      #ffffff;
    --clr-text:       #1e293b;
    --clr-muted:      #64748b;
    --clr-border:     #e2e8f0;
    --clr-card:       #ffffff;
    --sidebar-width:  265px;
    --radius-sm:      8px;
    --radius-md:      12px;
    --radius-lg:      18px;
    --shadow-sm:      0 2px 10px rgba(0,0,0,.06);
    --shadow-md:      0 6px 22px rgba(0,0,0,.1);
    --shadow-lg:      0 16px 40px rgba(0,0,0,.15);
    --ease:           cubic-bezier(.4,0,.2,1);
    --transition:     all .28s var(--ease);
}

/* ─── Base Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Cairo', 'Inter', sans-serif;
    background: var(--clr-bg);
    color: var(--clr-text);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

[dir="ltr"] body { font-family: 'Inter', 'Cairo', sans-serif; }

/* ─── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--clr-bg); }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 99px; }

/* ════════════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(170deg, var(--clr-sidebar) 0%, var(--clr-sidebar-2) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,.22);
    flex-shrink: 0;
    position: relative;
    z-index: 100;
    min-height: 100vh;
    overflow: hidden;
}

/* Decorative gold line */
.sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    inset-inline-end: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, var(--clr-gold), transparent 60%);
}

/* Brand Logo Area */
.sidebar-brand {
    padding: 1.8rem 1.5rem 1.4rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
    margin-bottom: .5rem;
    text-align: center;
}

.sidebar-brand h2 {
    font-size: 1.55rem;
    font-weight: 900;
    letter-spacing: 2px;
    margin: 0;
    background: linear-gradient(120deg, #fff 40%, var(--clr-gold-lt) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-brand h2::before {
    content: '🛡️';
    display: block;
    font-size: 2rem;
    margin-bottom: 6px;
    -webkit-text-fill-color: initial;
    filter: drop-shadow(0 2px 6px rgba(212,150,15,.4));
    animation: float-shield 4s ease-in-out infinite;
}

@keyframes float-shield {
    0%, 100% { transform: translateY(0);    }
    50%       { transform: translateY(-6px); }
}

/* Sidebar Nav */
.sidebar nav {
    padding: .5rem 1rem;
    flex: 1;
}

.sidebar ul {
    list-style: none;
    padding: 0; margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar ul li a {
    color: #94a3b8;
    text-decoration: none;
    font-weight: 600;
    font-size: .93rem;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    position: relative;
}

.sidebar ul li a .nav-icon {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
    color: #ffffff;
    background: rgba(255,255,255,.07);
}

.sidebar ul li a.active {
    color: var(--clr-gold-lt) !important;
    background: rgba(212,150,15,.12) !important;
    border-inline-start: 3px solid var(--clr-gold);
}

/* Logout at bottom */
.sidebar-footer {
    padding: 1rem 1.2rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,.06);
    margin-top: auto;
}

.sidebar-footer a {
    color: #94a3b8;
    text-decoration: none;
    font-weight: 600;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.sidebar-footer a:hover {
    color: #fca5a5;
    background: rgba(239,68,68,.1);
}

/* Lang button in sidebar */
.sidebar-lang-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    background: rgba(212,150,15,.12);
    color: var(--clr-gold-lt);
    border: 1.5px solid rgba(212,150,15,.3);
    border-radius: 99px;
    font-weight: 700;
    font-size: .82rem;
    text-decoration: none;
    transition: var(--transition);
    margin: .8rem 1.2rem 0;
}

.sidebar-lang-btn:hover {
    background: var(--clr-gold);
    color: #000;
    border-color: var(--clr-gold);
}

/* ════════════════════════════════════════════════════════════
   MAIN CONTENT AREA
═══════════════════════════════════════════════════════════ */
.main-content {
    flex: 1;
    padding: 2.4rem 2.8rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: center;
}

/* Top Bar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1.4rem;
    border-bottom: 2px solid var(--clr-border);
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 12px;
    width: min(100%, 1200px);
}

.topbar h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--clr-text);
    margin: 0;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--clr-card);
    border: 1.5px solid var(--clr-border);
    border-radius: 99px;
    padding: 6px 16px;
    font-weight: 600;
    font-size: .88rem;
    color: var(--clr-muted);
    box-shadow: var(--shadow-sm);
}

/* ─── Stat Cards ─────────────────────────────────────────────── */
.stat-card {
    background: var(--clr-card);
    border: none;
    border-radius: var(--radius-lg);
    padding: 1.8rem 1.5rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    text-decoration: none;
    display: block;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
}

.stat-card.services::before { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }
.stat-card.pages::before    { background: linear-gradient(90deg, var(--clr-gold), var(--clr-gold-lt)); }
.stat-card.users::before    { background: linear-gradient(90deg, #10b981, #34d399); }

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 2.4rem;
    margin-bottom: 1rem;
    display: block;
    opacity: .85;
}

.stat-number {
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--clr-text);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: .82rem;
    font-weight: 700;
    color: var(--clr-muted);
    text-transform: uppercase;
    letter-spacing: .8px;
}

.stat-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 1rem;
    font-weight: 700;
    font-size: .85rem;
    color: var(--clr-gold);
    text-decoration: none;
    transition: var(--transition);
}

.stat-link:hover { color: var(--clr-gold-lt); gap: 8px; }

/* ─── Info/Welcome Card ──────────────────────────────────────── */
.welcome-card {
    background: linear-gradient(135deg, var(--clr-sidebar) 0%, #1a3260 100%);
    border-radius: var(--radius-lg);
    padding: 2rem 2.4rem;
    color: #fff;
    border: 1px solid rgba(212,150,15,.2);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    width: min(100%, 1200px);
    margin-inline: auto;
}

.welcome-card::after {
    content: '🛡️';
    position: absolute;
    font-size: 8rem;
    opacity: .05;
    inset-inline-end: 1.5rem;
    bottom: -1rem;
    pointer-events: none;
}

.welcome-card h2 {
    color: var(--clr-gold-lt);
    font-weight: 800;
    margin-bottom: .5rem;
    font-size: 1.3rem;
}

.welcome-card p { color: rgba(255,255,255,.75); line-height: 1.8; }

/* ─── Action Buttons ─────────────────────────────────────────── */
.btn-gold {
    background: linear-gradient(135deg, var(--clr-gold), var(--clr-gold-lt));
    color: #080f1e !important;
    border: none;
    font-weight: 700;
    border-radius: 99px;
    transition: var(--transition);
    box-shadow: 0 4px 14px var(--clr-gold-glow);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--clr-gold-glow);
    color: #000 !important;
}

.btn-add {
    background: linear-gradient(135deg, var(--clr-gold), var(--clr-gold-lt)) !important;
    color: #080f1e !important;
    border: none !important;
    font-weight: 700;
    border-radius: 99px !important;
    box-shadow: 0 4px 14px var(--clr-gold-glow) !important;
    transition: var(--transition);
}

.btn-add:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px var(--clr-gold-glow) !important;
}

.btn-link {
    color: var(--clr-gold);
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
}

.btn-link:hover { color: var(--clr-gold-lt); text-decoration: underline; }

/* ─── Tables ─────────────────────────────────────────────────── */
.table-card {
    background: var(--clr-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--clr-border);
    width: min(100%, 1200px);
    margin-inline: auto;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .7px;
    border-bottom: 2px solid var(--clr-border);
    padding: 14px 18px;
    white-space: nowrap;
}

.table tbody td {
    padding: 14px 18px;
    vertical-align: middle;
    border-color: #f1f5f9;
    font-size: .9rem;
}

.table tbody tr:hover td { background: #fafbfc; }

/* Edit/Delete Buttons */
.btn-edit {
    background: rgba(59,130,246,.1) !important;
    color: #2563eb !important;
    border: 1.5px solid rgba(59,130,246,.25) !important;
    font-weight: 600;
    border-radius: var(--radius-sm) !important;
    transition: var(--transition);
}

.btn-edit:hover {
    background: #2563eb !important;
    color: #fff !important;
    border-color: #2563eb !important;
    transform: translateY(-1px);
}

.btn-delete {
    background: rgba(239,68,68,.08) !important;
    color: #dc2626 !important;
    border: 1.5px solid rgba(239,68,68,.2) !important;
    font-weight: 600;
    border-radius: var(--radius-sm) !important;
    transition: var(--transition);
}

.btn-delete:hover {
    background: #dc2626 !important;
    color: #fff !important;
    border-color: #dc2626 !important;
    transform: translateY(-1px);
}

/* ─── Form Controls ──────────────────────────────────────────── */
.form-control, .form-select {
    border: 1.5px solid var(--clr-border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-family: inherit;
    background: #f8fafc;
}

.form-control:focus, .form-select:focus {
    border-color: var(--clr-gold);
    box-shadow: 0 0 0 3px rgba(212,150,15,.18);
    background: #fff;
}

.form-label {
    font-weight: 700;
    color: #374151;
    font-size: .9rem;
}

/* ─── Alert Overrides ────────────────────────────────────────── */
.alert { border-radius: var(--radius-md); border: none; }
.alert-success {
    background: rgba(16,185,129,.08);
    border-inline-start: 4px solid #10b981;
    color: #065f46;
}
.alert-danger {
    background: rgba(239,68,68,.08);
    border-inline-start: 4px solid #ef4444;
    color: #991b1b;
}

/* ─── Login Page ─────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #080f1e 0%, #0f2044 50%, #1a3260 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(212,150,15,.12) 0%, transparent 70%);
    border-radius: 50%;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    animation: pulse-orb 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse-orb {
    0%,100% { transform: translate(-50%,-50%) scale(1);   opacity: .6; }
    50%      { transform: translate(-50%,-50%) scale(1.3); opacity: 1;  }
}

.login-card {
    background: rgba(255,255,255,.97);
    padding: 3rem 2.8rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 80px rgba(0,0,0,.5);
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(212,150,15,.2);
    position: relative;
    z-index: 2;
}

.login-card .brand-shield {
    font-size: 3.5rem;
    display: block;
    text-align: center;
    margin-bottom: .5rem;
    animation: float-shield 4s ease-in-out infinite;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 992px) {
    body { flex-direction: column; }
    .main-content { align-items: stretch; }
    .sidebar {
        width: 100%;
        min-height: auto;
        padding-bottom: 1rem;
    }
    .sidebar::after { display: none; }
    .sidebar nav { padding: .5rem 1rem; }
    .sidebar ul { flex-direction: row; flex-wrap: wrap; gap: 4px; }
    .sidebar ul li a { padding: 8px 12px; font-size: .82rem; }
    .sidebar-footer { padding: .8rem 1rem; }
    .main-content { padding: 1.6rem; }
}

@media (max-width: 576px) {
    .main-content { padding: 1.2rem; }
    .login-card { padding: 2rem 1.5rem; }
}
