:root {
    --bg-primary: #0f172a;
    --bg-gradient: radial-gradient(circle at top right, #1e293b 0%, #0f172a 100%);
    --accent: #fbbf24;
    --accent-glow: rgba(251, 191, 36, 0.4);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(20px);
    --shadow-card: 0 10px 30px -10px rgba(0,0,0,0.6);
    --font-body: 'Tajawal', sans-serif;
    --font-display: 'Cairo', sans-serif;
    --sidebar-width: 88px;
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --success-color: #10b981;
    --error-color: #ef4444;
}

/* منع تحديد النصوص في كامل الموقع */
* {
    -webkit-user-select: none; /* Chrome, Safari, Opera */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* Internet Explorer/Edge */
    user-select: none;         /* Standard syntax */
}

/* منع سحب الصور (اختياري لزيادة الحماية) */
img {
    pointer-events: none;
    -webkit-user-drag: none;
}

/* استثناء خانات الإدخال لضمان عملها بشكل طبيعي */
input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

[data-theme="horror"] {
    --bg-primary: #0f0505;
    --bg-gradient: radial-gradient(circle at 50% 10%, #3f0e0e 0%, #000000 100%);
    --accent: #ff4d4d;
    --accent-glow: rgba(255, 77, 77, 0.5);
    --glass-bg: rgba(20, 5, 5, 0.85);
    --font-display: 'Aref Ruqaa', serif;
}

[data-theme="islamic"] {
    --bg-primary: #022c22;
    --bg-gradient: radial-gradient(circle at top, #065f46 0%, #022c22 100%);
    --accent: #34d399;
    --accent-glow: rgba(52, 211, 153, 0.4);
    --glass-bg: rgba(2, 44, 34, 0.85);
    --font-display: 'Reem Kufi', sans-serif;
    --font-body: 'Amiri', serif;
}

[data-theme="history"] {
    --bg-primary: #271c19;
    --bg-gradient: radial-gradient(circle, #4e342e 0%, #1a120e 100%);
    --accent: #d7ccc8;
    --accent-glow: rgba(215, 204, 200, 0.3);
    --glass-bg: rgba(44, 30, 22, 0.85);
    --font-display: 'Amiri', serif;
}

[data-theme="adventure"] {
    --bg-primary: #0c1220;
    --bg-gradient: radial-gradient(circle at bottom, #1e3a8a 0%, #0f172a 100%);
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.4);
    --glass-bg: rgba(12, 18, 32, 0.85);
    --font-display: 'Lateef', serif; 
}

[data-theme="psychology"] {
    --bg-primary: #171717;
    --bg-gradient: radial-gradient(circle at center, #2d2d2d 0%, #000000 100%);
    --accent: #e5e5e5;
    --accent-glow: rgba(229, 229, 229, 0.4);
    --glass-bg: rgba(23, 23, 23, 0.85);
    --font-display: 'Marhey', sans-serif;
    --font-body: 'Marhey', sans-serif;
}

.card-info h3 {
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
    min-height: 2.8em;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; outline: none; }

body {
    background: var(--bg-primary);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.8s ease, color 0.5s ease;
    position: relative;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

.world-bg { position: fixed; inset: 0; background: var(--bg-gradient); z-index: -2; transition: 0.8s; }
#particles-js { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.6; }

.sidebar {
    position: fixed; right: 0; top: 0; height: 100vh; width: var(--sidebar-width);
    background: rgba(15, 23, 42, 0.3); backdrop-filter: blur(12px);
    border-left: 1px solid var(--glass-border);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2rem; z-index: 100;
}

.nav-item {
    position: relative;
    width: 50px; height: 50px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; color: rgba(255,255,255,0.4);
    cursor: pointer; transition: var(--transition);
}

.nav-item::before {
    content: ''; position: absolute; inset: 0; border-radius: 14px;
    background: var(--accent); opacity: 0; transform: scale(0.5);
    transition: var(--transition); z-index: -1;
}

.nav-item:hover { color: var(--text-main); transform: translateX(-3px); }
.nav-item.active { color: #000; box-shadow: 0 0 20px var(--accent-glow); }
.nav-item.active::before { opacity: 1; transform: scale(1); }

.nav-item .tooltip {
    position: absolute; right: 65px; background: var(--glass-bg);
    padding: 6px 14px; border-radius: 8px; font-size: 0.85rem;
    color: var(--text-main); opacity: 0; visibility: hidden;
    transform: translateX(10px); transition: 0.3s;
    white-space: nowrap; border: 1px solid var(--glass-border);
    pointer-events: none; box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.nav-item:hover .tooltip { opacity: 1; visibility: visible; transform: translateX(0); }

main {
    margin-right: var(--sidebar-width); padding: 50px 6% 0;
    min-height: 100vh; width: calc(100% - var(--sidebar-width));
    display: flex; flex-direction: column;
}

header {
    display: flex; flex-direction: column; gap: 25px; margin-bottom: 2rem;
}

.header-top { display: flex; justify-content: space-between; align-items: flex-start; }

.brand h1 {
    font-family: var(--font-display);
    font-size: 3.5rem;
    line-height: 1.1; /* غيّر هذه القيمة من 1.1 إلى 1.5 */
    padding-bottom: 10px; /* أضف هذا السطر لمنع قص الحروف من الأسفل */
    background: linear-gradient(to bottom, #fff, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.brand p { color: var(--text-muted); font-size: 1.1rem; margin-top: 10px; max-width: 500px; }
.accent-text { color: var(--accent); -webkit-text-fill-color: var(--accent); }

.controls-area {
    display: flex; gap: 15px; width: 100%; max-width: 700px;
}

.search-container {
    position: relative; flex: 1;
}
.search-icon {
    position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none; transition: 0.3s;
}
.search-input {
    width: 100%; padding: 16px 50px 16px 20px;
    background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border);
    border-radius: 14px; color: #fff; font-family: var(--font-body); font-size: 1rem;
    transition: 0.3s;
}
.search-input:focus {
    background: rgba(255,255,255,0.06); border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}
.search-input:focus + .search-icon { color: var(--accent); }

.custom-select-wrapper {
    position: relative;
    min-width: 200px;
    font-family: var(--font-body);
    user-select: none;
}

.custom-select-trigger {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px;
    background: rgba(255,255,255,0.03); 
    border: 1px solid var(--glass-border);
    border-radius: 14px; 
    cursor: pointer; color: var(--text-muted);
    transition: 0.3s;
    font-size: 0.95rem;
    height: 100%;
}

.custom-select-trigger:hover, .custom-select-wrapper.open .custom-select-trigger {
    border-color: var(--accent);
    color: var(--text-main);
    background: rgba(255,255,255,0.06);
}

.custom-select-trigger i { transition: 0.3s; font-size: 0.8rem; }
.custom-select-wrapper.open .custom-select-trigger i { transform: rotate(180deg); color: var(--accent); }

.custom-options {
    position: absolute; top: 115%; left: 0; right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    overflow: hidden;
    opacity: 0; visibility: hidden;
    transform: translateY(-10px);
    transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 100;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
}

.custom-select-wrapper.open .custom-options {
    opacity: 1; visibility: visible; transform: translateY(0);
}

.custom-option {
    padding: 14px 20px;
    cursor: pointer;
    transition: 0.2s;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    display: flex; align-items: center; gap: 10px;
}

.custom-option:last-child { border-bottom: none; }

.custom-option:hover {
    background: rgba(251, 191, 36, 0.1);
    color: var(--text-main);
    padding-right: 25px;
}

.custom-option.selected {
    color: var(--accent);
    font-weight: bold;
    background: rgba(251, 191, 36, 0.05);
}
.custom-option i { width: 20px; text-align: center; font-size: 0.85rem; }

.cart-trigger {
    width: 55px; height: 55px; border-radius: 50%;
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center;
    cursor: pointer; position: relative; transition: var(--transition);
}
.cart-trigger:hover { transform: rotate(10deg) scale(1.1); border-color: var(--accent); }
.badge {
    position: absolute; top: -2px; left: -2px;
    background: var(--accent); color: #000;
    width: 22px; height: 22px; border-radius: 50%;
    font-size: 0.75rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 10px var(--accent-glow); transform: scale(0);
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.badge.active { transform: scale(1); }

.grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 40px 25px; padding-bottom: 60px; margin-top: 20px;
    flex: 1;
}

.card {
    background: transparent; border-radius: 20px;
    position: relative; transition: var(--transition);
    cursor: pointer; display: flex; flex-direction: column;
    animation: fadeUp 0.6s backwards;
}

.card:hover .card-img-wrap { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0,0,0,0.4); border-color: rgba(255,255,255,0.2); }
.card:hover .card-img-wrap img { transform: scale(1.08); }
.card:hover .fav-btn-card { opacity: 1; transform: translateY(0); }

.card-img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1.414;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    background: #1a1a1a;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    border: 1px solid rgba(255,255,255,0.05);
}

.card-img-wrap::after {
    content: ''; position: absolute; inset:0; 
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transform: translateX(-100%); animation: shimmer 2s infinite; pointer-events: none;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

.card-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: 0.7s; opacity: 0.95; }

.tag {
    position: absolute; top: 12px; left: 12px;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    color: #fff; padding: 4px 10px; border-radius: 30px;
    font-size: 0.75rem; font-weight: bold; border: 1px solid rgba(255,255,255,0.1);
    z-index: 2;
}

.cat-tag {
    font-size: 0.7rem; color: var(--accent); opacity: 0.8; margin-bottom: 5px; display: block;
}

.fav-btn-card {
    position: absolute; top: 12px; right: 12px;
    width: 35px; height: 35px; border-radius: 50%;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    color: #fff; display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,0.1);
    opacity: 0; transform: translateY(-10px); transition: 0.3s; z-index: 2;
}
.fav-btn-card:hover { background: var(--accent); color: #000; }
.fav-btn-card.active { color: #ef4444; background: rgba(255,255,255,0.9); opacity: 1; transform: translateY(0); }
@media(max-width: 768px) { .fav-btn-card { opacity: 1; transform: translateY(0); } }

.card-info { padding: 0 5px; }
.card-info h3 { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-info p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }

.card-footer {
    margin-top: auto; display: flex; justify-content: space-between; align-items: center;
    padding: 10px 5px 0; border-top: 1px solid rgba(255,255,255,0.05);
}
.price-container { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.price { font-weight: 800; color: var(--accent); font-size: 1.2rem; text-shadow: 0 0 15px var(--accent-glow); }
.old-price { font-size: 0.8rem; color: var(--text-muted); text-decoration: line-through; margin-bottom: 3px; }

.add-btn {
    width: 38px; height: 38px; border-radius: 12px;
    background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-main); transition: 0.2s;
}
.add-btn:hover { background: var(--accent); color: #000; border-color: var(--accent); transform: scale(1.1); }
.add-btn.in-cart { background: var(--accent); color: #000; cursor: default; }

.overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px); z-index: 900;
    opacity: 0; visibility: hidden; transition: 0.4s;
}
.overlay.active { opacity: 1; visibility: visible; }

.sheet {
    position: fixed; top: 0; left: 0; width: 450px; height: 100%;
    background: #0f172a; z-index: 1000;
    transform: translateX(-100%); transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex; flex-direction: column; border-right: 1px solid var(--glass-border);
    box-shadow: 20px 0 50px rgba(0,0,0,0.5);
}
.sheet.active { transform: translateX(0); }

[data-theme="horror"] .sheet { background: #1a0505; }
[data-theme="islamic"] .sheet { background: #022c22; }
[data-theme="history"] .sheet { background: #1a120e; }
[data-theme="adventure"] .sheet { background: #0c1220; }
[data-theme="psychology"] .sheet { background: #171717; }

.sheet-head { padding: 25px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--glass-border); }
.sheet-body { flex: 1; overflow-y: auto; padding: 25px; }
.sheet-foot { padding: 25px 30px; background: rgba(0,0,0,0.2); backdrop-filter: blur(10px); border-top: 1px solid var(--glass-border); }

.btn-primary {
    width: 100%; padding: 16px; border-radius: 14px;
    background: var(--accent); color: #000; font-weight: 800;
    border: none; cursor: pointer; font-family: var(--font-body);
    font-size: 1rem; transition: 0.2s; box-shadow: 0 4px 15px var(--accent-glow);
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; filter: grayscale(1); box-shadow: none; }

.btn-secondary {
    width: 100%; padding: 16px; border-radius: 14px;
    background: transparent; color: var(--text-main); font-weight: 700;
    border: 1px solid var(--glass-border); cursor: pointer; font-family: var(--font-body);
    font-size: 1rem; transition: 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-top: 10px;
}
.btn-secondary:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.15); }

.cart-item {
    display: flex; gap: 15px; padding: 15px; margin-bottom: 15px;
    background: rgba(255,255,255,0.03); border-radius: 16px; 
    border: 1px solid var(--glass-border); transition: 0.3s;
    position: relative; overflow: hidden;
}
.cart-item:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); }
.cart-item img { width: 70px; height: 95px; border-radius: 10px; object-fit: cover; }

.input {
    width: 100%; padding: 16px; margin-bottom: 15px;
    background: rgba(0,0,0,0.2); border: 1px solid var(--glass-border);
    border-radius: 12px; color: #fff; font-family: var(--font-body); outline: none;
    text-align: right; transition: 0.3s;
}
.input:focus { border-color: var(--accent); background: rgba(0,0,0,0.4); }
.input.error { border-color: #ef4444; }

.promo-box { display: flex; gap: 10px; margin-bottom: 15px; }
.promo-btn { white-space: nowrap; padding: 0 20px; background: rgba(255,255,255,0.1); border: 1px solid var(--glass-border); color: #fff; border-radius: 12px; cursor: pointer; }
.promo-btn:hover { background: rgba(255,255,255,0.2); }

.payment-methods { display: flex; gap: 10px; margin-bottom: 20px; }
.p-method { 
    flex: 1; padding: 15px; border: 1px solid var(--glass-border); border-radius: 12px;
    text-align: center; cursor: pointer; opacity: 0.6; transition: 0.3s;
}
.p-method.active { opacity: 1; border-color: var(--accent); background: rgba(255,255,255,0.03); }
.p-method i { font-size: 1.5rem; margin-bottom: 5px; display: block; }

footer {
    margin-top: auto;
    border-top: 1px solid var(--glass-border);
    padding: 40px 0;
    background: rgba(0,0,0,0.2);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.footer-social { display: flex; justify-content: center; gap: 20px; margin-bottom: 20px; }
.footer-social a { 
    color: var(--text-muted); font-size: 1.4rem; transition: 0.3s; 
    width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--glass-border);
    display: flex; align-items: center; justify-content: center; text-decoration: none;
}
.footer-social a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-3px); }

#scrollTop {
    position: fixed; bottom: 30px; left: 30px;
    width: 45px; height: 45px; background: var(--glass-bg);
    border: 1px solid var(--glass-border); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-main); cursor: pointer; transition: 0.3s;
    z-index: 90; opacity: 0; visibility: hidden; backdrop-filter: blur(5px);
}
#scrollTop.show { opacity: 1; visibility: visible; }
#scrollTop:hover { background: var(--accent); color: #000; transform: translateY(-5px); }

.related-section { margin-top: 30px; border-top: 1px solid var(--glass-border); padding-top: 20px; }
.related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-top: 15px; }
.related-card { background: rgba(255,255,255,0.03); padding: 10px; border-radius: 10px; display: flex; align-items: center; gap: 10px; cursor: pointer; transition: 0.2s; }
.related-card:hover { background: rgba(255,255,255,0.08); }
.related-card img { width: 40px; height: 60px; object-fit: cover; border-radius: 6px; }

.tabs-nav { display: flex; border-bottom: 1px solid var(--glass-border); margin-bottom: 20px; }
.tab-btn {
    flex: 1; padding: 15px; text-align: center; cursor: pointer;
    color: var(--text-muted); position: relative; font-weight: bold; transition: 0.3s;
}
.tab-btn.active { color: var(--accent); }
.tab-btn.active::after {
    content: ''; position: absolute; bottom: -1px; left: 0; width: 100%;
    height: 2px; background: var(--accent);
}
.tab-content { display: none; animation: fadeUp 0.3s; }
.tab-content.active { display: block; }

.review-form-container { background: rgba(255,255,255,0.02); padding: 15px; border-radius: 10px; margin-bottom: 20px; border: 1px solid var(--glass-border); }
.star-rating { direction: ltr; display: inline-flex; font-size: 1.5rem; cursor: pointer; margin-bottom: 10px; }
.star-rating i { color: #444; transition: 0.2s; margin: 0 2px; }
.star-rating i.active { color: var(--accent); }
.review-item { padding: 15px; background: rgba(255,255,255,0.03); border-radius: 10px; margin-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.review-head { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 0.9rem; }

.share-btn {
    position: absolute; top: 75px; left: 20px;
    width: 45px; height: 45px; border-radius: 50%;
    background: rgba(0,0,0,0.4); backdrop-filter: blur(5px);
    color: #fff; display: flex; align-items: center; justify-content: center;
    border: none; cursor: pointer; transition: 0.2s; z-index: 10;
}
.share-btn:hover { background: var(--accent); color: #000; }

@media (max-width: 768px) {
    .sidebar {
        width: 90%;
        height: auto;
        top: auto;
        bottom: 20px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        flex-direction: row;
        justify-content: space-around;
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 20px;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(20px);
        padding: 10px;
        gap: 5px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    }

    .nav-sep {
        width: 1px;
        height: 25px;
        margin: 0;
        background: rgba(255,255,255,0.15);
    }

    .nav-item {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
        background: transparent;
    }

    .nav-item .tooltip {
        display: none;
    }

    main {
        margin-right: 0;
        width: 100%;
        padding: 25px 20px 100px;
    }

    .brand h1 {
        font-size: 2.5rem;
    }

    header {
        gap: 15px;
        margin-bottom: 2rem;
    }

    .controls-area {
        flex-direction: column;
        gap: 10px;
    }

    .sheet {
        width: 100%;
        height: 85vh;
        top: auto;
        bottom: 0;
        left: 0;
        transform: translateY(110%);
        border-radius: 30px 30px 0 0;
        border-right: none;
        border-top: 1px solid rgba(255,255,255,0.15);
    }

    .sheet.active {
        transform: translateY(0);
    }

    #detail-sheet {
        width: 100% !important;
        height: 92vh !important;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px 15px;
        padding-bottom: 20px;
    }

    .card-img-wrap {
        aspect-ratio: 1 / 1.414;
        margin-bottom: 12px;
    }

    .card-info h3 {
        font-size: 0.95rem;
        line-height: 1.4;
        white-space: normal;
        word-break: break-word;
        min-height: 2.8em;
    }

    .footer-social a {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
    }

    footer {
        padding-bottom: 110px;
    }

    #scrollTop {
        bottom: 100px;
        left: 20px;
    }

    .close-modal-mobile {
        top: 20px;
        right: 20px;
    }
}

.toast-container {
    position: fixed; top: 30px; left: 50%; transform: translateX(-50%);
    z-index: 2000; display: flex; flex-direction: column; gap: 10px; align-items: center;
}

.toast {
    background: var(--accent); color: #000; padding: 12px 30px;
    border-radius: 50px; font-weight: bold; font-size: 0.95rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3); display: flex; align-items: center; gap: 10px;
    white-space: nowrap; animation: slideInDown 0.4s forwards;
    opacity: 0; transform: translateY(-20px);
}
@keyframes slideInDown { to { opacity: 1; transform: translateY(0); } }
@keyframes fadeOutUp { to { opacity: 0; transform: translateY(-20px); } }

/* تنسيق الشاشة الكاملة للدخلة */
#loader {
    position: fixed;
    inset: 0;
    background: var(--bg-primary); /* نفس لون خلفية الموقع */
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease-in-out, visibility 0.8s;
}

/* حاوية المحتوى */
.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* أيقونة الكتاب */
.loader-icon {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 15px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards 0.2s;
    text-shadow: 0 0 20px var(--accent-glow);
}

/* اسم المكتبة الكبير */
.loader-brand {
    font-family: var(--font-display);
    font-size: 3.5rem;
    color: #fff;
    margin: 0;
    line-height: 1;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards 0.5s;
    letter-spacing: 2px;
}

/* الخط الذهبي الفاصل */
.loader-line {
    width: 0;
    height: 2px;
    background: var(--accent);
    margin: 15px 0;
    box-shadow: 0 0 10px var(--accent-glow);
    animation: expandWidth 1s cubic-bezier(0.22, 1, 0.36, 1) forwards 0.8s;
}

/* النص الصغير أسفل الاسم */
.loader-tagline {
    color: var(--text-muted);
    font-size: 1rem;
    opacity: 0;
    animation: fadeIn 1s ease forwards 1.2s;
    font-family: var(--font-body);
}

/* الحركات (Animations) */
@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes expandWidth {
    to { width: 120px; }
}

@keyframes fadeIn {
    to { opacity: 0.8; }
}
.pulse { animation: pulse 1.5s infinite; color: var(--accent); font-size: 2.5rem; }
@keyframes pulse { 0% { opacity: 0.5; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0.5; transform: scale(0.9); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

#floating-buttons {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    transform: translateY(0);
}

#floating-buttons.sticky {
    position: fixed;
    top: 25px;
    left: 25px;
    z-index: 880;
    margin: 0;
    
    animation: smoothFloat 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes smoothFloat {
    0% {
        opacity: 0;
        transform: translateY(-50px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#floating-buttons.exiting {
    opacity: 0;
    transform: translateY(-20px);
}

body.modal-open #floating-buttons.sticky {
    opacity: 0;
    pointer-events: none;
    transition: 0.2s;
}