/* ============================================================
   اقرأ لفلسطين - نظام التصميم الشامل
   Palestinian Identity Design System
   ============================================================ */

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

/* ============================================================
   CSS Custom Properties - المتغيرات
   ============================================================ */
:root {
    /* Palestinian Flag Colors */
    --pal-red:       #CC2229;
    --pal-red-dark:  #9e1217;
    --pal-red-light: #e8474d;
    --pal-green:     #007A3D;
    --pal-green-dark:#005a2c;
    --pal-green-light:#00a854;
    --pal-black:     #1a1a1a;
    --pal-white:     #FFFFFF;

    /* Neutrals */
    --gray-50:   #f9fafb;
    --gray-100:  #f3f4f6;
    --gray-200:  #e5e7eb;
    --gray-300:  #d1d5db;
    --gray-500:  #6b7280;
    --gray-700:  #374151;
    --gray-900:  #111827;

    /* Semantic Colors */
    --bg-primary:   #f5f5f0;
    --bg-secondary: #eeeee8;
    --surface:      #ffffff;
    --surface-alt:  #f8f8f5;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-muted:   #787878;
    --border-color: #e0e0d8;

    /* Shadows */
    --shadow-xs:  0 1px 3px rgba(0,0,0,0.08);
    --shadow-sm:  0 2px 8px rgba(0,0,0,0.08);
    --shadow-md:  0 4px 20px rgba(0,0,0,0.10);
    --shadow-lg:  0 10px 40px rgba(0,0,0,0.13);
    --shadow-xl:  0 20px 60px rgba(0,0,0,0.16);
    --shadow-green: 0 8px 30px rgba(0, 122, 61, 0.25);
    --shadow-red:   0 8px 30px rgba(204, 34, 41, 0.25);

    /* Typography */
    --font-main: 'Cairo', 'Arial', sans-serif;
    --font-serif: 'Amiri', serif;

    /* Radius */
    --radius-sm:  6px;
    --radius-md:  12px;
    --radius-lg:  18px;
    --radius-xl:  24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 180ms ease;
    --transition-base: 280ms cubic-bezier(0.4,0,0.2,1);
    --transition-slow: 420ms cubic-bezier(0.4,0,0.2,1);

    /* Layout */
    --navbar-height: 70px;
    --sidebar-width: 265px;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-base);
}

ul { list-style: none; }

img { max-width: 100%; height: auto; display: block; }

/* ============================================================
   Scrollbar
   ============================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--pal-green); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--pal-green-dark); }

/* ============================================================
   Layout Utilities
   ============================================================ */
.container {
    max-width: 1260px;
    margin: 0 auto;
    padding: 0 24px;
}

.main-content {
    flex: 1;
    padding: 50px 0 70px;
}

/* Spacing */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-auto { margin-top: auto; }

/* Text */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* ============================================================
   ══════════════ NAVBAR ══════════════
   ============================================================ */
.navbar {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,122,61,0.15);
    box-shadow: 0 2px 20px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--navbar-height);
}

/* Palestinian stripe accent on top */
.navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to left, var(--pal-black) 25%, var(--pal-white) 25% 50%, var(--pal-green) 50% 75%, var(--pal-red) 75%);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 24px;
}

/* Brand / Logo */
.navbar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--pal-green-dark);
    letter-spacing: -0.3px;
}

.navbar .brand .brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--pal-green), var(--pal-green-light));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    box-shadow: var(--shadow-green);
    transition: var(--transition-base);
}

.navbar .brand:hover .brand-icon {
    transform: rotate(-8deg) scale(1.1);
}

.navbar .brand span {
    background: linear-gradient(135deg, var(--pal-green-dark), var(--pal-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Nav Links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-links a {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    position: relative;
    transition: var(--transition-base);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    left: 50%;
    height: 2px;
    background: var(--pal-green);
    border-radius: var(--radius-full);
    transition: var(--transition-base);
}

.nav-links a:hover {
    color: var(--pal-green-dark);
    background: rgba(0,122,61,0.07);
}

.nav-links a:hover::after {
    right: 10px;
    left: 10px;
}

/* Nav Toggle */
.nav-toggle {
    display: none;
    background: none;
    border: 2px solid var(--pal-green);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 1.1rem;
    color: var(--pal-green-dark);
    cursor: pointer;
    transition: var(--transition-base);
}

.nav-toggle:hover {
    background: var(--pal-green);
    color: white;
}

/* ============================================================
   ══════════════ HERO SECTION ══════════════
   ============================================================ */
.hero-section {
    position: relative;
    background: linear-gradient(145deg, #0d2e1a 0%, #1a4a28 40%, #0f3520 100%);
    color: white;
    padding: 90px 0 80px;
    overflow: hidden;
    margin-bottom: 60px;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(204,34,41,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(0,168,84,0.12) 0%, transparent 50%);
}

/* Decorative kufiya pattern */
.hero-section::after {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 250px;
    height: 250px;
    background: repeating-linear-gradient(
        45deg,
        rgba(255,255,255,0.03) 0px,
        rgba(255,255,255,0.03) 1px,
        transparent 1px,
        transparent 12px
    ),
    repeating-linear-gradient(
        -45deg,
        rgba(255,255,255,0.03) 0px,
        rgba(255,255,255,0.03) 1px,
        transparent 1px,
        transparent 12px
    );
    border-radius: 50%;
    opacity: 0.6;
}

.hero-content {
    position: relative;
    text-align: center;
    max-width: 740px;
    margin: 0 auto;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-full);
    padding: 6px 18px;
    font-size: 0.85rem;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.hero-badge .dot {
    width: 8px;
    height: 8px;
    background: var(--pal-red-light);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.7); }
}

.hero-section h1 {
    font-family: var(--font-serif);
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.hero-section h1 .highlight {
    color: var(--pal-red-light);
}

.hero-section p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    max-width: 580px;
    margin: 0 auto 36px;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Palestinian flag stripe at bottom of hero */
.hero-stripe {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(to left, var(--pal-black) 25%, var(--pal-white) 25% 50%, var(--pal-green) 50% 75%, var(--pal-red) 75%);
}

/* ============================================================
   ══════════════ BUTTONS ══════════════
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 24px;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition-base);
    white-space: nowrap;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.15);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.btn:hover::before { transform: scaleX(1); }

/* Primary - Green */
.btn-primary {
    background: linear-gradient(135deg, var(--pal-green), var(--pal-green-light));
    color: white !important;
    box-shadow: 0 4px 15px rgba(0,122,61,0.35);
    border-color: transparent;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,122,61,0.45);
}

.btn-primary:active { transform: translateY(0); }

/* Danger - Red */
.btn-danger {
    background: linear-gradient(135deg, var(--pal-red), var(--pal-red-light));
    color: white !important;
    box-shadow: 0 4px 15px rgba(204,34,41,0.3);
    border-color: transparent;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(204,34,41,0.4);
}

/* Outline */
.btn-outline {
    background: transparent;
    border: 2px solid var(--pal-green);
    color: var(--pal-green-dark) !important;
}

.btn-outline:hover {
    background: var(--pal-green);
    color: white !important;
    transform: translateY(-2px);
}

/* Ghost / White */
.btn-ghost {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.4);
    color: white !important;
    backdrop-filter: blur(8px);
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.7);
    transform: translateY(-2px);
}

/* Sizes */
.btn-sm { padding: 7px 16px; font-size: 0.85rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }
.btn-block { display: flex; width: 100%; }

/* ============================================================
   ══════════════ SECTION HEADERS ══════════════
   ============================================================ */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--pal-green);
    background: rgba(0,122,61,0.1);
    padding: 5px 16px;
    border-radius: var(--radius-full);
    margin-bottom: 12px;
}

.section-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.25;
    margin-bottom: 12px;
}

.section-title .accent { color: var(--pal-green); }

.section-underline {
    width: 50px;
    height: 4px;
    background: linear-gradient(to left, var(--pal-red), var(--pal-green));
    border-radius: var(--radius-full);
    margin: 12px auto 0;
}

/* Auth title (used in forms) */
.auth-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 32px;
    position: relative;
}

.auth-title::after {
    content: '';
    display: block;
    width: 45px;
    height: 4px;
    background: linear-gradient(to left, var(--pal-green), var(--pal-red));
    border-radius: var(--radius-full);
    margin: 12px auto 0;
}

/* ============================================================
   ══════════════ BOOK CARDS ══════════════
   ============================================================ */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 28px;
}

.book-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: var(--transition-slow);
    position: relative;
}

.book-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    border: 2px solid var(--pal-green);
    opacity: 0;
    transition: var(--transition-base);
    pointer-events: none;
    z-index: 1;
}

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

.book-card:hover::before { opacity: 1; }

.book-cover-wrapper {
    position: relative;
    overflow: hidden;
    height: 300px;
}

.book-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.book-card:hover .book-cover { transform: scale(1.05); }

.book-cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 55%);
    opacity: 0;
    transition: var(--transition-base);
    display: flex;
    align-items: flex-end;
    padding: 20px;
}

.book-card:hover .book-cover-overlay { opacity: 1; }

.book-cover-action {
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.book-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: linear-gradient(135deg, var(--pal-red), var(--pal-red-light));
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
    z-index: 2;
}

.book-info {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 10px;
}

.book-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.book-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--pal-green-dark);
    display: flex;
    align-items: center;
    gap: 5px;
}

.book-price .currency {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--pal-green);
}

.book-card .btn {
    margin-top: auto;
}

/* ============================================================
   ══════════════ FORM STYLES ══════════════
   ============================================================ */
.form-container {
    background: var(--surface);
    padding: 44px 48px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 520px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(to left, var(--pal-red), var(--pal-black) 33%, var(--pal-white) 33% 66%, var(--pal-green) 66%);
}

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

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-group label i {
    color: var(--pal-green);
    font-size: 0.85rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--gray-50);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: var(--transition-base);
    outline: none;
}

.form-control:focus {
    background: white;
    border-color: var(--pal-green);
    box-shadow: 0 0 0 4px rgba(0,122,61,0.12);
}

.form-control:hover:not(:focus) {
    border-color: var(--gray-300);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* File input */
.file-upload-wrapper {
    position: relative;
    border: 2px dashed var(--pal-green);
    border-radius: var(--radius-md);
    padding: 30px 20px;
    text-align: center;
    background: rgba(0,122,61,0.03);
    cursor: pointer;
    transition: var(--transition-base);
}

.file-upload-wrapper:hover {
    background: rgba(0,122,61,0.07);
    border-color: var(--pal-green-dark);
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
}

.file-upload-icon {
    font-size: 2rem;
    color: var(--pal-green);
    margin-bottom: 10px;
}

.file-upload-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.file-upload-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================================
   ══════════════ ALERTS ══════════════
   ============================================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid transparent;
    animation: alert-in 0.35s ease forwards;
}

@keyframes alert-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert i { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.alert-danger {
    background: #fff1f2;
    color: #9f1239;
    border-color: #fecdd3;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

/* ============================================================
   ══════════════ TABLES ══════════════
   ============================================================ */
.table-wrapper {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

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

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.table thead tr {
    background: linear-gradient(135deg, var(--pal-green-dark), var(--pal-green));
}

.table th {
    padding: 15px 18px;
    text-align: right;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.table td {
    padding: 14px 18px;
    text-align: right;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.table tbody tr {
    transition: var(--transition-fast);
}

.table tbody tr:last-child td { border-bottom: none; }

.table tbody tr:hover {
    background-color: rgba(0,122,61,0.04);
}

/* Table actions */
.table-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ============================================================
   ══════════════ BADGES ══════════════
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.7;
}

.badge-pending {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.badge-approved {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.badge-rejected {
    background: #fff1f2;
    color: #9f1239;
    border: 1px solid #fecdd3;
}

/* ============================================================
   ══════════════ STAT CARDS ══════════════
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 22px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    bottom: 0;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.stat-card.green::after  { background: var(--pal-green); }
.stat-card.red::after    { background: var(--pal-red); }
.stat-card.black::after  { background: var(--pal-black); }
.stat-card.blue::after   { background: #3b82f6; }

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 16px;
}

.stat-icon.green  { background: rgba(0,122,61,0.12);  color: var(--pal-green); }
.stat-icon.red    { background: rgba(204,34,41,0.10);  color: var(--pal-red); }
.stat-icon.black  { background: rgba(26,26,26,0.08);   color: var(--pal-black); }
.stat-icon.blue   { background: rgba(59,130,246,0.1);  color: #3b82f6; }

.stat-value {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ============================================================
   ══════════════ BOOK DETAIL PAGE ══════════════
   ============================================================ */
.book-detail-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 44px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 44px;
}

.book-detail-cover {
    flex: 0 0 300px;
    max-width: 320px;
}

.book-detail-cover img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 4px solid var(--gray-100);
}

.book-detail-info {
    flex: 1;
    min-width: 280px;
}

.book-detail-info h1 {
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.25;
}

.book-detail-price {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--pal-green-dark);
    background: rgba(0,122,61,0.08);
    padding: 10px 24px;
    border-radius: var(--radius-full);
    margin-bottom: 28px;
}

.book-detail-description {
    font-size: 1rem;
    line-height: 1.9;
    color: var(--text-secondary);
    margin-bottom: 32px;
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border-right: 3px solid var(--pal-green);
}

.book-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

/* ============================================================
   ══════════════ CHECKOUT / PAYMENT ══════════════
   ============================================================ */
.checkout-container {
    max-width: 860px;
    margin: 0 auto;
}

.order-summary {
    background: linear-gradient(135deg, var(--pal-green-dark), var(--pal-green));
    color: white;
    padding: 24px 28px;
    border-radius: var(--radius-lg);
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    box-shadow: var(--shadow-green);
}

.order-summary-title {
    font-size: 1rem;
    opacity: 0.85;
    margin-bottom: 4px;
}

.order-summary-book {
    font-size: 1.2rem;
    font-weight: 700;
}

.order-summary-price {
    text-align: center;
    font-size: 2rem;
    font-weight: 900;
    background: rgba(255,255,255,0.2);
    padding: 10px 24px;
    border-radius: var(--radius-md);
}

.payment-methods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 36px;
}

        .payment-method-card {
            background: var(--surface);
            border: 2px solid var(--border-color);
            border-radius: var(--radius-lg);
            padding: 24px;
            transition: var(--transition-base);
            display: flex;
            flex-direction: column;
            min-width: 0;
            box-sizing: border-box;
        }

        .payment-method-card:hover {
            border-color: var(--pal-green);
            box-shadow: var(--shadow-green);
        }

        .payment-method-name {
            font-size: 1rem;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 12px;
            padding-bottom: 10px;
            border-bottom: 2px solid var(--pal-green);
            display: inline-block;
        }

        .payment-method-number {
            font-family: 'Courier New', monospace;
            font-size: 1.1rem;
            background: var(--gray-100);
            padding: 10px;
            border-radius: var(--radius-sm);
            text-align: center;
            letter-spacing: 1px;
            margin-bottom: 12px;
            border: 1px dashed var(--gray-300);
            user-select: all;
            cursor: pointer;
            word-break: break-word;
            overflow-wrap: break-word;
            white-space: normal;
            width: 100%;
            display: block;
            direction: ltr;
            line-height: 1.6;
            transition: background 0.3s ease;
        }
.payment-method-instructions {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Upload section */
.upload-section {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.upload-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.upload-notice {
    background: rgba(0,122,61,0.07);
    border-right: 3px solid var(--pal-green);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 22px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ============================================================
   ══════════════ ORDERS PAGE ══════════════
   ============================================================ */
.page-header {
    margin-bottom: 36px;
}

.page-title {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title i {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--pal-green), var(--pal-green-light));
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: var(--shadow-green);
}

.page-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-right: 56px;
}

/* ============================================================
   ══════════════ ADMIN LAYOUT ══════════════
   ============================================================ */
.admin-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0f2318 0%, #0a1a10 100%);
    color: rgba(255,255,255,0.85);
    height: 100vh;
    position: fixed;
    top: 0;
    right: 0;
    overflow-y: auto;
    z-index: 100;
    box-shadow: -4px 0 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.admin-sidebar-header {
    padding: 28px 24px 22px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.admin-brand-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--pal-green), var(--pal-green-light));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    box-shadow: 0 4px 16px rgba(0,122,61,0.5);
}

.admin-brand-text {
    font-size: 1rem;
    font-weight: 800;
    color: white;
    line-height: 1.2;
}

.admin-brand-sub {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.5);
    font-weight: 400;
}

.admin-user {
    background: rgba(255,255,255,0.06);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--pal-green), var(--pal-green-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.admin-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
}

.admin-user-role {
    font-size: 0.72rem;
    color: var(--pal-green-light);
}

/* Sidebar Menu */
.admin-menu {
    padding: 16px 12px;
    flex: 1;
}

.admin-menu-label {
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    padding: 12px 12px 6px;
}

.admin-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    color: rgba(255,255,255,0.7);
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 3px;
    transition: var(--transition-base);
    position: relative;
}

.admin-menu a .menu-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    background: rgba(255,255,255,0.06);
    transition: var(--transition-base);
    flex-shrink: 0;
}

.admin-menu a:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.admin-menu a:hover .menu-icon {
    background: rgba(0,122,61,0.5);
    color: var(--pal-green-light);
}

.admin-menu a.active {
    background: linear-gradient(135deg, rgba(0,122,61,0.3), rgba(0,168,84,0.15));
    color: white;
    border: 1px solid rgba(0,122,61,0.4);
}

.admin-menu a.active .menu-icon {
    background: var(--pal-green);
    color: white;
    box-shadow: 0 3px 12px rgba(0,122,61,0.5);
}

.admin-menu a.danger { color: rgba(255,100,100,0.8); }
.admin-menu a.danger:hover { background: rgba(204,34,41,0.15); color: #ff6b6b; }
.admin-menu a.danger .menu-icon { background: rgba(204,34,41,0.15); }
.admin-menu a.danger:hover .menu-icon { background: rgba(204,34,41,0.35); }

/* Palestinian flag stripe in sidebar */
.admin-sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.pal-flag-stripe {
    height: 5px;
    border-radius: var(--radius-full);
    background: linear-gradient(to right, var(--pal-red) 25%, var(--pal-white) 25% 50%, var(--pal-green) 50% 75%, var(--pal-black) 75%);
    margin-bottom: 10px;
}

.sidebar-version {
    text-align: center;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.25);
}

/* Admin Content Area */
.admin-content {
    margin-right: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-primary);
    padding: 36px;
}

/* Admin Top Bar */
.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
}

.admin-topbar h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* Admin Card */
.admin-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-color);
}

.admin-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-card-title i {
    color: var(--pal-green);
}

/* Grid cards (used in old admin code) */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 22px;
    margin-bottom: 24px;
}

.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* ============================================================
   ══════════════ RECEIPT MODAL / PREVIEW ══════════════
   ============================================================ */
.receipt-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--pal-green-dark);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 5px 12px;
    background: rgba(0,122,61,0.1);
    border-radius: var(--radius-full);
    border: 1px solid rgba(0,122,61,0.2);
    transition: var(--transition-base);
}

.receipt-link:hover {
    background: var(--pal-green);
    color: white;
}

/* ============================================================
   ══════════════ FOOTER ══════════════
   ============================================================ */
.footer {
    background: linear-gradient(180deg, #0d2318 0%, #070f0c 100%);
    color: rgba(255,255,255,0.75);
    padding: 48px 0 24px;
    margin-top: auto;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(to left, var(--pal-black) 25%, var(--pal-white) 25% 50%, var(--pal-green) 50% 75%, var(--pal-red) 75%);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 800;
    color: white;
    margin-bottom: 4px;
}

.footer-logo i {
    color: var(--pal-green-light);
}

.footer-tagline {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.5);
    max-width: 400px;
    line-height: 1.6;
}

.footer-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(to left, var(--pal-red), var(--pal-green));
    border-radius: var(--radius-full);
    margin: 8px 0;
}

.footer-bottom {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.35);
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-bottom .heart {
    color: var(--pal-red-light);
    animation: heartbeat 1.4s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.25); }
    30% { transform: scale(1); }
    45% { transform: scale(1.15); }
}

/* ============================================================
   ══════════════ EMPTY STATE ══════════════
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--gray-300);
    margin: 0 auto 20px;
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ============================================================
   ══════════════ RESPONSIVE ══════════════
   ============================================================ */
@media (max-width: 992px) {
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .admin-sidebar-header {
        width: 100%;
    }

    .admin-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        padding: 12px;
        width: 100%;
    }

    .admin-menu a {
        flex: 0 0 auto;
        padding: 8px 14px;
    }

    .admin-content {
        margin-right: 0;
        padding: 24px 16px;
    }

    .admin-sidebar-footer {
        display: none;
    }
}

@media (max-width: 768px) {
    .nav-toggle { display: flex; }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: var(--navbar-height);
        left: 0;
        right: 0;
        background: white;
        box-shadow: var(--shadow-lg);
        padding: 16px;
        gap: 4px;
        border-bottom: 4px solid var(--pal-green);
        animation: slideDown 0.2s ease;
        z-index: 999;
    }

    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    .nav-links.active { display: flex; }

    .nav-links a {
        padding: 12px 16px;
        border-radius: var(--radius-md);
        width: 100%;
    }

    .form-container {
        padding: 30px 24px;
    }

    .hero-section {
        padding: 60px 0 50px;
    }

    .book-detail-card {
        padding: 28px 20px;
    }

    .book-detail-cover {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 18px;
    }

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

    .admin-content {
        padding: 18px 14px;
    }
}

@media (max-width: 480px) {
    .stats-grid, .grid-cards {
        grid-template-columns: 1fr;
    }

    .books-grid {
        grid-template-columns: 1fr;
    }

    .hero-section h1 {
        font-size: 1.9rem;
    }

    .container {
        padding: 0 16px;
    }

    .admin-content {
        padding: 14px 12px;
    }
}

/* ============================================================
   ══════════════ ANIMATIONS & MICRO-INTERACTIONS ══════════════
   ============================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.animate-fadeInUp {
    animation: fadeInUp 0.5s ease forwards;
}

.books-grid .book-card {
    animation: fadeInUp 0.4s ease forwards;
}

.books-grid .book-card:nth-child(2) { animation-delay: 0.05s; }
.books-grid .book-card:nth-child(3) { animation-delay: 0.10s; }
.books-grid .book-card:nth-child(4) { animation-delay: 0.15s; }
.books-grid .book-card:nth-child(5) { animation-delay: 0.20s; }
.books-grid .book-card:nth-child(6) { animation-delay: 0.25s; }

/* Focus visible */
:focus-visible {
    outline: 3px solid var(--pal-green);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Selection */
::selection {
    background: rgba(0,122,61,0.2);
    color: var(--pal-green-dark);
}
