/* ==========================================================================
   Admin Panel Styles - مجلة السياحة العربية
   Theme: Luxury Gold, Royal Green, and Crisp Clean White
   ========================================================================== */

:root {
    --primary-gold: #c69214;
    --primary-gold-dark: #a27208;
    --primary-gold-light: #fef7e6;
    --royal-green: #0a5c36;
    --royal-green-light: #e8f5ee;
    --dark-slate: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --card-bg: #ffffff;
    --body-bg: #f8fafc;
    --font-heading: 'El Messiri', serif;
    --font-body: 'Noto Kufi Arabic', sans-serif;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 10px 30px rgba(198, 146, 20, 0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--body-bg);
    color: var(--dark-slate);
    direction: rtl;
    line-height: 1.6;
}

/* ==========================================================================
   LOGIN SCREEN
   ========================================================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, #fbf7ee 0%, #ffffff 50%, #f4f6f8 100%);
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    border: 1px solid rgba(198, 146, 20, 0.25);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 440px;
    padding: 40px 35px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--royal-green), var(--primary-gold), var(--royal-green));
}

.gold-emblem {
    width: 68px;
    height: 68px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-gold-light), #fff);
    border: 2px solid var(--primary-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--primary-gold);
    box-shadow: 0 6px 15px rgba(198, 146, 20, 0.2);
}

.login-brand h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    color: var(--dark-slate);
    margin-bottom: 4px;
}

.login-brand p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 25px;
}

.login-form {
    text-align: right;
}

.login-alert {
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #f87171;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark-slate);
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    font-family: var(--font-body);
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fff;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 3px rgba(198, 146, 20, 0.15);
}

.password-wrapper {
    position: relative;
}

.toggle-pass-btn {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
}

.btn-primary-gold {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-gold), var(--primary-gold-dark));
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 15px rgba(198, 146, 20, 0.25);
    transition: var(--transition);
}

.btn-primary-gold:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.login-hint {
    margin-top: 15px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

/* ==========================================================================
   DASHBOARD LAYOUT
   ========================================================================== */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 270px;
    background: #ffffff;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 25px 18px;
    flex-shrink: 0;
}

.sidebar-header {
    margin-bottom: 30px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo .gold-icon {
    font-size: 32px;
    color: var(--primary-gold);
}

.sidebar-logo h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    color: var(--dark-slate);
}

.badge-role {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--royal-green-light);
    color: var(--royal-green);
    font-weight: 600;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: right;
    width: 100%;
}

.nav-item i {
    font-size: 16px;
    width: 20px;
}

.nav-item:hover {
    background: #f8fafc;
    color: var(--primary-gold);
}

.nav-item.active {
    background: var(--primary-gold-light);
    color: var(--primary-gold-dark);
}

.nav-counter {
    margin-right: auto;
    background: #e5e7eb;
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 11px;
    color: var(--dark-slate);
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.sidebar-btn-view, .sidebar-btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-btn-view {
    background: #f3f4f6;
    color: var(--dark-slate);
}

.sidebar-btn-view:hover {
    background: #e5e7eb;
}

.sidebar-btn-logout {
    background: transparent;
    border: 1px solid #fee2e2;
    color: #dc2626;
}

.sidebar-btn-logout:hover {
    background: #fef2f2;
}

/* Main Area */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    padding: 30px;
    overflow-y: auto;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.topbar-welcome h1 {
    font-family: var(--font-heading);
    font-size: 26px;
    color: var(--dark-slate);
}

.topbar-welcome p {
    font-size: 13px;
    color: var(--text-muted);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-gold-action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--primary-gold), var(--primary-gold-dark));
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-gold-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(198, 146, 20, 0.25);
}

.admin-user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 8px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
}

.admin-user-pill .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--royal-green-light);
    color: var(--royal-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

/* ==========================================================================
   STATS CARDS
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-soft);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-icon.gold { background: var(--primary-gold-light); color: var(--primary-gold-dark); }
.stat-icon.green { background: var(--royal-green-light); color: var(--royal-green); }
.stat-icon.blue { background: #eff6ff; color: #2563eb; }
.stat-icon.purple { background: #faf5ff; color: #7c3aed; }

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 24px;
    color: var(--dark-slate);
}

.text-success {
    font-size: 15px !important;
    color: var(--royal-green) !important;
}

/* ==========================================================================
   DASHBOARD BOX & DATA TABLES
   ========================================================================== */
.dashboard-box {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 25px;
}

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

.box-header h3 {
    font-size: 18px;
    color: var(--dark-slate);
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.search-box {
    flex: 1;
    position: relative;
}

.search-box i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 10px 40px 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
}

.filter-select {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    background: #fff;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    text-align: right;
}

.data-table th {
    background: #f9fafb;
    padding: 12px 14px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.data-table tr:hover td {
    background: #fdfaf2;
}

.table-thumbnail {
    width: 50px;
    height: 38px;
    border-radius: 4px;
    object-fit: cover;
    background: #e5e7eb;
}

.badge-cat {
    display: inline-block;
    padding: 3px 8px;
    background: #f3f4f6;
    color: #4b5563;
    border-radius: 12px;
    font-size: 11.5px;
}

.actions-cell {
    display: flex;
    gap: 8px;
}

.btn-action-edit, .btn-action-delete {
    border: none;
    background: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-action-edit {
    background: #eff6ff;
    color: #2563eb;
}

.btn-action-delete {
    background: #fee2e2;
    color: #dc2626;
}

.btn-action-edit:hover { background: #dbeafe; }
.btn-action-delete:hover { background: #fecaca; }

/* Pagination */
.pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
}

.btn-page {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-page:hover:not(:disabled) {
    background: var(--primary-gold-light);
    border-color: var(--primary-gold);
}

.btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   EDITOR FORM
   ========================================================================== */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 18px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.image-input-group {
    display: flex;
    gap: 8px;
}

.image-preview-container {
    margin-bottom: 18px;
    max-width: 320px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.image-preview-container img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    cursor: pointer;
    margin-bottom: 20px;
}

.btn-secondary {
    padding: 8px 14px;
    background: #f3f4f6;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.category-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-card span.name {
    font-weight: 600;
    font-size: 14px;
}

.category-card span.count {
    background: var(--primary-gold-light);
    color: var(--primary-gold-dark);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}

/* Tabs & Utilities */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.25s ease-in;
}

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Toast */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: var(--dark-slate);
    color: #fff;
    padding: 14px 22px;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    font-size: 14px;
    z-index: 9999;
    border-right: 4px solid var(--primary-gold);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 900px) {
    .dashboard-wrapper {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
        border-left: none;
        border-bottom: 1px solid var(--border-color);
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}
