/* =============================================
   Horizon Knowledge — Main Stylesheet
   Colors: #162851 (Navy) | #AC8249 (Gold)
   Font: Cairo
   RTL/LTR Support | Dark/Light Mode
   ============================================= */

/* ============== CSS Variables ============== */
:root {
    /* Light Mode (Default) */
    --navy: #162851;
    --navy-dark: #0d1b36;
    --navy-light: #1e3870;
    --gold: #AC8249;
    --gold-light: #c9a06a;
    --gold-dark: #8a6435;
    --white: #ffffff;
    --off-white: #f8f5f0;
    --text-light: #e8e0d4;
    --text-muted: #8a9bb8;
    --text-dark: #162851;
    --border: rgba(172, 130, 73, 0.2);
    --shadow: 0 20px 60px rgba(22, 40, 81, 0.15);
    --shadow-gold: 0 10px 40px rgba(172, 130, 73, 0.2);
    --radius: 16px;
    --radius-sm: 8px;
    --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);

    /* Background colors */
    --bg-primary: #f8f5f0;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-navbar: rgba(22, 40, 81, 0.97);
    --bg-footer: #162851;
    --bg-hero: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 50%, var(--navy-light) 100%);
    --bg-input: #f8f5f0;

    /* Text colors */
    --text-primary: #162851;
    --text-secondary: #6b7a99;
}

/* ============== Dark Mode ============== */
[data-theme="dark"] {
    --bg-primary: #0d1b36;
    --bg-secondary: #162851;
    --bg-card: #1e3870;
    --bg-navbar: rgba(13, 27, 54, 0.98);
    --bg-footer: #0a1525;
    --bg-input: #1e3870;
    --text-primary: #e8e0d4;
    --text-secondary: #a0aec0;
    --text-dark: #e8e0d4;
    --border: rgba(172, 130, 73, 0.15);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    --off-white: #1e3870;
}

/* ============== RTL Support ============== */
[dir="rtl"] {
    --dir: rtl;
}

html { direction: var(--dir, ltr); }

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Cairo', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.7;
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }

/* ========== Theme Toggle Button ========== */
.theme-toggle {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 1001;
    background: var(--gold);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(172, 130, 73, 0.4);
    transition: var(--transition);
}

[dir="rtl"] .theme-toggle {
    right: auto;
    left: 20px;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(172, 130, 73, 0.5);
}

/* ========== NAVBAR ========== */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: var(--bg-navbar);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 75px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-main { font-size: 1.3rem; font-weight: 900; color: var(--white); letter-spacing: 4px; }
.logo-sub { font-size: 0.6rem; font-weight: 400; color: var(--gold); letter-spacing: 6px; }

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 18px;
    border-radius: 50px;
    transition: var(--transition);
    letter-spacing: 0.5px;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--white);
    background: var(--gold);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: var(--transition);
}

/* ========== PAGE WRAPPER ========== */
.page-wrapper { padding-top: 75px; min-height: 100vh; }

/* ========== HERO SECTION ========== */
.hero {
    min-height: 100vh;
    background: var(--bg-hero);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 75px;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 800px 600px at 80% 50%, rgba(172,130,73,0.08) 0%, transparent 70%),
        radial-gradient(ellipse 400px 400px at 20% 80%, rgba(172,130,73,0.05) 0%, transparent 60%);
}

.hero-grid-pattern {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(172,130,73,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(172,130,73,0.04) 1px, transparent 1px);
    background-size: 60px 60px;
}

.hero-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 6rem 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(172,130,73,0.15);
    border: 1px solid rgba(172,130,73,0.3);
    color: var(--gold-light);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.hero-badge::before {
    content: '';
    width: 6px; height: 6px;
    background: var(--gold);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4.2rem);
    font-weight: 900;
    color: var(--white);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-title .accent { color: var(--gold); display: block; }

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 480px;
}

.hero-buttons { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gold);
    color: var(--white);
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: var(--transition);
    border: 2px solid var(--gold);
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
}

.btn-primary:hover {
    background: var(--gold-dark);
    border-color: var(--gold-dark);
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(172,130,73,0.4);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--white);
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    border: 2px solid rgba(255,255,255,0.3);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--white);
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.books-stack {
    position: relative;
    width: 320px;
    height: 400px;
}

.stack-book {
    position: absolute;
    border-radius: 8px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.4);
    animation: float 6s ease-in-out infinite;
}

.stack-book:nth-child(1) {
    width: 220px; height: 300px;
    background: linear-gradient(135deg, #AC8249, #8a6435);
    left: 50%; top: 50%;
    transform: translate(-50%, -50%) rotate(-8deg);
    animation-delay: 0s;
}

.stack-book:nth-child(2) {
    width: 200px; height: 280px;
    background: linear-gradient(135deg, #162851, #1e3870);
    left: 50%; top: 50%;
    transform: translate(-50%, -50%) rotate(5deg);
    animation-delay: 1s;
    border: 2px solid rgba(172,130,73,0.3);
}

.stack-book:nth-child(3) {
    width: 190px; height: 270px;
    background: linear-gradient(135deg, #0d1b36, #162851);
    left: 50%; top: 50%;
    transform: translate(-50%, -50%) rotate(-2deg);
    animation-delay: 2s;
    border: 1px solid rgba(172,130,73,0.2);
}

@keyframes float {
    0%, 100% { transform: translate(-50%, -50%) rotate(var(--r, 0deg)) translateY(0); }
    50% { transform: translate(-50%, -50%) rotate(var(--r, 0deg)) translateY(-12px); }
}

.hero-stats {
    display: flex;
    gap: 2rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.stat { text-align: center; }
.stat-num { font-size: 2rem; font-weight: 900; color: var(--gold); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); letter-spacing: 1px; }

/* ========== SECTION STYLES ========== */
.section { padding: 6rem 2rem; }
.section-dark { background: var(--navy); }
.section-alt { background: linear-gradient(to bottom, var(--bg-primary), #e8e3dc); }

[data-theme="dark"] .section-alt {
    background: linear-gradient(to bottom, var(--bg-primary), #162851);
}

.container { max-width: 1280px; margin: 0 auto; }

.section-header { text-align: center; margin-bottom: 4rem; }

.section-tag {
    display: inline-block;
    background: rgba(172,130,73,0.12);
    color: var(--gold-dark);
    padding: 5px 16px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    border: 1px solid rgba(172,130,73,0.25);
}

.section-dark .section-tag {
    background: rgba(172,130,73,0.15);
    color: var(--gold-light);
    border-color: rgba(172,130,73,0.3);
}

.section-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.section-dark .section-title { color: var(--white); }

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 550px;
    margin: 0 auto;
}

.section-dark .section-subtitle { color: var(--text-muted); }

/* ========== BOOKS GRID ========== */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.book-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(22,40,81,0.08);
    transition: var(--transition);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

[data-theme="dark"] .book-card {
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(22,40,81,0.15);
}

.book-cover {
    position: relative;
    height: 240px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.book-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    position: relative;
}

.book-cover-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23AC8249' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.book-cover-placeholder i {
    font-size: 4rem;
    color: var(--gold);
    opacity: 0.7;
    position: relative;
    z-index: 1;
}

.book-category-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--gold);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

[dir="rtl"] .book-category-badge {
    left: auto;
    right: 14px;
}

.book-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.book-author { font-size: 0.8rem; color: var(--gold); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.4rem; }
.book-title { font-size: 1.05rem; font-weight: 800; color: var(--text-primary); margin-bottom: 0.8rem; line-height: 1.3; }
.book-summary { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.7; flex: 1; }

.book-meta {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--off-white);
    font-size: 0.8rem;
    color: var(--text-muted);
}

[data-theme="dark"] .book-meta {
    border-top-color: var(--border);
}

.book-meta span { display: flex; align-items: center; gap: 4px; }
.book-meta i { color: var(--gold); font-size: 0.7rem; }

/* ========== PAGE HERO ========== */
.page-hero {
    background: var(--bg-hero);
    padding: 5rem 2rem 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 600px 400px at 50% 100%, rgba(172,130,73,0.1), transparent);
}

.page-hero-content { position: relative; z-index: 1; }

.page-hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    color: var(--white);
    margin-bottom: 1rem;
}

.page-hero h1 span { color: var(--gold); }

.page-hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.breadcrumb {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.breadcrumb a { color: var(--gold); text-decoration: none; }
.breadcrumb a:hover { color: var(--gold-light); }
.breadcrumb .sep { color: rgba(255,255,255,0.2); }

/* ========== ABOUT PAGE ========== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
}

.about-visual { position: relative; }

.about-card {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.about-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(172,130,73,0.15), transparent 70%);
}

.about-card-icon {
    width: 80px; height: 80px;
    background: rgba(172,130,73,0.15);
    border: 2px solid rgba(172,130,73,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: var(--gold);
    position: relative;
    z-index: 1;
}

.about-card h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.about-card p {
    color: var(--text-muted);
    line-height: 1.8;
    position: relative;
    z-index: 1;
}

.about-badge {
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 120px;
    height: 120px;
    background: var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: white;
    font-weight: 900;
    box-shadow: 0 10px 30px rgba(172,130,73,0.4);
}

[dir="rtl"] .about-badge {
    right: auto;
    left: -20px;
}

.about-badge span:first-child { font-size: 2rem; }
.about-badge span:last-child { font-size: 0.7rem; letter-spacing: 1px; }

.about-content .section-tag { text-align: left; }
.about-content .section-title { text-align: left; }

[dir="rtl"] .about-content .section-tag,
[dir="rtl"] .about-content .section-title {
    text-align: right;
}

.about-lead {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 2rem;
    border-left: 3px solid var(--gold);
    padding-left: 1.5rem;
}

[dir="rtl"] .about-lead {
    border-left: none;
    border-right: 3px solid var(--gold);
    padding-left: 0;
    padding-right: 1.5rem;
}

.goals-list { list-style: none; display: flex; flex-direction: column; gap: 1rem; }

.goals-list li {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem 1.2rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(22,40,81,0.05);
    transition: var(--transition);
}

.goals-list li:hover {
    border-color: var(--gold);
    box-shadow: 0 4px 20px rgba(172,130,73,0.12);
    transform: translateX(4px);
}

[dir="rtl"] .goals-list li:hover {
    transform: translateX(-4px);
}

.goals-list li i {
    color: var(--gold);
    margin-top: 3px;
    font-size: 1rem;
    flex-shrink: 0;
}

.goals-list li div strong { display: block; color: var(--text-primary); font-weight: 700; margin-bottom: 2px; }
.goals-list li div span { font-size: 0.88rem; color: var(--text-secondary); }

.contact-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.contact-item {
    background: var(--navy);
    color: var(--white);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.contact-item:hover { background: var(--navy-light); transform: translateY(-3px); }
.contact-item i { color: var(--gold); font-size: 1.3rem; }
.contact-item div small { display: block; font-size: 0.7rem; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; }
.contact-item div span { font-size: 0.9rem; font-weight: 600; }

/* ========== REQUEST FORM ========== */
.request-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }

.form-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: 0 8px 30px rgba(22,40,81,0.08);
    border: 1px solid var(--border);
}

[data-theme="dark"] .form-card {
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.form-card h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--off-white);
    display: flex;
    align-items: center;
    gap: 10px;
}

[data-theme="dark"] .form-card h2 {
    border-bottom-color: var(--border);
}

.form-card h2 i { color: var(--gold); }

.form-group { margin-bottom: 1.3rem; }

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.3px;
}

.form-group label .req { color: var(--gold); }

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e8ecf4;
    border-radius: var(--radius-sm);
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-input);
    transition: var(--transition);
    outline: none;
}

[data-theme="dark"] .form-control {
    border-color: var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-control:focus {
    border-color: var(--gold);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(172,130,73,0.1);
}

.form-control::placeholder { color: #a0aec0; }

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

select.form-control { cursor: pointer; }

.file-upload-area {
    border: 2px dashed #c5cfe0;
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-input);
}

.file-upload-area:hover, .file-upload-area.dragover {
    border-color: var(--gold);
    background: rgba(172,130,73,0.05);
}

.file-upload-area i { font-size: 2rem; color: var(--gold); margin-bottom: 0.5rem; display: block; }
.file-upload-area p { font-size: 0.85rem; color: var(--text-secondary); margin: 0; }
.file-upload-area input[type="file"] { display: none; }

.preview-img {
    width: 100%;
    max-height: 180px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    margin-top: 1rem;
    display: none;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--navy);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 0.5px;
    margin-top: 1rem;
}

.submit-btn:hover {
    background: var(--gold);
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

.submit-btn .spinner {
    width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

.success-banner {
    display: none;
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 1px solid #b1dfbb;
    border-radius: var(--radius-sm);
    padding: 1rem 1.5rem;
    text-align: center;
    color: #155724;
    font-weight: 600;
    margin-top: 1rem;
}

[data-theme="dark"] .success-banner {
    background: linear-gradient(135deg, #1a4d2e, #155724);
    color: #9ae6b4;
}

.error-banner {
    display: none;
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: var(--radius-sm);
    padding: 1rem 1.5rem;
    color: #c53030;
    font-weight: 600;
    margin-top: 1rem;
}

[data-theme="dark"] .error-banner {
    background: #4a2020;
    color: #fc8181;
}

/* ========== FLOATING WHATSAPP BUTTON ========== */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.4);
    transition: var(--transition);
    text-decoration: none;
    animation: whatsappPulse 2s infinite;
}

[dir="rtl"] .whatsapp-float {
    right: auto;
    left: 30px;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 40px rgba(37, 211, 102, 0.5);
}

@keyframes whatsappPulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* ========== FOOTER ========== */
.footer {
    background: var(--bg-footer);
    color: var(--text-light);
    padding: 4rem 2rem 2rem;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, var(--gold), var(--gold-dark), var(--gold));
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.fl-main {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--white);
    letter-spacing: 3px;
}

.fl-sub {
    font-size: 0.55rem;
    font-weight: 400;
    color: var(--gold);
    letter-spacing: 5px;
}

.footer-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
    max-width: 300px;
}

.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 1rem;
}

.footer-social a {
    width: 40px;
    height: 40px;
    background: rgba(172,130,73,0.15);
    border: 1px solid rgba(172,130,73,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-light);
    text-decoration: none;
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--gold);
    color: white;
    transform: translateY(-3px);
}

.footer-links h4,
.footer-contact h4 {
    color: var(--white);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    letter-spacing: 1px;
}

.footer-links ul,
.footer-contact ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-links a:hover {
    color: var(--gold);
    padding-left: 5px;
}

[dir="rtl"] .footer-links a:hover {
    padding-left: 0;
    padding-right: 5px;
}

.footer-links a i {
    font-size: 0.6rem;
    color: var(--gold);
}

.footer-contact li {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-contact li i {
    color: var(--gold);
    width: 20px;
    text-align: center;
}

.footer-contact li .fab {
    color: #25D366;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

@media (max-width: 600px) {
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-bottom a {
    color: var(--gold);
    text-decoration: none;
    transition: var(--transition);
}

.footer-bottom a:hover {
    color: var(--gold-light);
}

/* ========== ADMIN STYLES ========== */
.admin-body {
    background: var(--bg-primary);
    font-family: 'Cairo', sans-serif;
}

.admin-wrapper { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: 260px;
    background: var(--navy);
    padding: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(22,40,81,0.2);
}

.sidebar-brand {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(172,130,73,0.2);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand .logo-main { font-size: 1.1rem; }
.sidebar-brand .logo-sub { font-size: 0.55rem; }

.sidebar-section-label {
    padding: 1.2rem 1.5rem 0.5rem;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.3);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.sidebar-nav { padding: 0.5rem 0; flex: 1; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 1.5rem;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    color: var(--white);
    background: rgba(172,130,73,0.1);
    border-left-color: var(--gold);
}

[dir="rtl"] .sidebar-nav a {
    border-left: none;
    border-right: 3px solid transparent;
}

[dir="rtl"] .sidebar-nav a:hover,
[dir="rtl"] .sidebar-nav a.active {
    border-right-color: var(--gold);
}

.sidebar-nav a i { width: 20px; text-align: center; color: var(--gold); }

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(172,130,73,0.2);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
}

.sidebar-footer a:hover { color: #fc8181; }

.admin-main { margin-left: 260px; flex: 1; }

[dir="rtl"] .admin-main {
    margin-left: 0;
    margin-right: 260px;
}

.admin-header {
    background: var(--bg-card);
    padding: 1.2rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.admin-header h1 { font-size: 1.3rem; font-weight: 800; color: var(--text-primary); }
.admin-header-right { display: flex; align-items: center; gap: 1rem; }
.admin-avatar {
    width: 38px; height: 38px;
    background: var(--navy);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 1rem;
}

.admin-content { padding: 2rem; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    box-shadow: 0 2px 10px rgba(22,40,81,0.06);
    border: 1px solid var(--border);
    transition: var(--transition);
}

[data-theme="dark"] .stat-card {
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.stat-card:hover { box-shadow: 0 8px 25px rgba(22,40,81,0.12); transform: translateY(-2px); }

.stat-icon {
    width: 52px; height: 52px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-icon.blue { background: rgba(22,40,81,0.1); color: var(--navy); }
.stat-icon.gold { background: rgba(172,130,73,0.12); color: var(--gold); }
.stat-icon.green { background: rgba(72,187,120,0.12); color: #48bb78; }
.stat-icon.red { background: rgba(252,129,74,0.12); color: #fc814a; }

.stat-card .stat-num { font-size: 1.8rem; font-weight: 900; color: var(--text-primary); }
.stat-card .stat-label { font-size: 0.8rem; color: var(--text-secondary); }

.data-table-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 2px 10px rgba(22,40,81,0.06);
    border: 1px solid var(--border);
    overflow: hidden;
}

[data-theme="dark"] .data-table-wrapper {
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table-header h3 { font-size: 1rem; font-weight: 700; color: var(--text-primary); }

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

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

table thead th {
    background: var(--bg-primary);
    padding: 12px 16px;
    text-align: left;
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}

[dir="rtl"] table thead th {
    text-align: right;
}

table tbody tr { border-bottom: 1px solid var(--border); transition: background 0.2s; }
table tbody tr:hover { background: var(--bg-secondary); }
table tbody td { padding: 12px 16px; color: var(--text-primary); vertical-align: middle; }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-pending { background: #fffbeb; color: #b7791f; border: 1px solid #fcd34d; }
.status-processing { background: #ebf8ff; color: #2b6cb0; border: 1px solid #90cdf4; }
.status-completed { background: #f0fff4; color: #276749; border: 1px solid #9ae6b4; }
.status-cancelled { background: #fff5f5; color: #c53030; border: 1px solid #fed7d7; }

.action-btn {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: 'Cairo', sans-serif;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.action-view { background: #ebf8ff; color: #2b6cb0; }
.action-view:hover { background: #2b6cb0; color: white; }
.action-update { background: rgba(172,130,73,0.1); color: var(--gold-dark); }
.action-update:hover { background: var(--gold); color: white; }
.action-download { background: #f0fff4; color: #276749; }
.action-download:hover { background: #276749; color: white; }

/* ========== LOGIN PAGE ========== */
.login-page {
    min-height: 100vh;
    background: var(--bg-hero);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 40px 80px rgba(0,0,0,0.3);
}

.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo svg { margin-bottom: 1rem; }
.login-logo h2 { font-size: 1.8rem; font-weight: 900; color: var(--text-primary); }
.login-logo p { color: var(--text-secondary); font-size: 0.9rem; }

.login-form .form-group { margin-bottom: 1.2rem; }

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.88rem;
    font-weight: 600;
}

.alert-danger { background: #fff5f5; border: 1px solid #feb2b2; color: #c53030; }
.alert-success { background: #f0fff4; border: 1px solid #9ae6b4; color: #276749; }

/* ========== FILTER BAR ========== */
.filter-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1.5rem;
}

.filter-select {
    padding: 8px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.85rem;
    color: var(--text-primary);
    background: var(--bg-card);
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

.filter-select:focus { border-color: var(--gold); }

.search-input {
    padding: 8px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.85rem;
    color: var(--text-primary);
    background: var(--bg-card);
    outline: none;
    transition: var(--transition);
    flex: 1;
    max-width: 280px;
}

.search-input:focus { border-color: var(--gold); }

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(22,40,81,0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(4px);
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal-box {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 40px 80px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.open .modal-box { transform: scale(1); }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.modal-header h3 { font-size: 1.2rem; font-weight: 800; color: var(--text-primary); }

.modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}

.modal-close:hover { background: var(--off-white); color: var(--text-primary); }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.detail-item label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gold-dark);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 3px;
}

.detail-item span {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.detail-item.full { grid-column: 1 / -1; }

.update-form { display: flex; gap: 0.5rem; align-items: center; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 2px solid var(--border); }

.update-form select {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-card);
    outline: none;
}

/* ========== USER MANAGEMENT ========== */
.user-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(22,40,81,0.06);
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 50px;
    height: 50px;
    background: var(--navy);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 1.2rem;
}

.user-name {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.user-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    transition: var(--transition);
}

.btn-sm-primary {
    background: var(--navy);
    color: white;
}

.btn-sm-primary:hover {
    background: var(--gold);
}

.btn-sm-danger {
    background: #fff5f5;
    color: #c53030;
}

.btn-sm-danger:hover {
    background: #c53030;
    color: white;
}

/* ========== BOOK MANAGEMENT ========== */
.book-upload-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(22,40,81,0.06);
    border: 1px solid var(--border);
}

.book-upload-card h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.book-upload-card h3 i {
    color: var(--gold);
}

.image-preview {
    max-width: 200px;
    max-height: 200px;
    border-radius: var(--radius-sm);
    margin-top: 1rem;
    display: none;
}

/* ========== STORIES DOWNLOAD PAGE ========== */
.story-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(22,40,81,0.08);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(22,40,81,0.15);
}

.story-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-image i {
    font-size: 4rem;
    color: var(--gold);
    opacity: 0.5;
}

.story-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--gold);
    color: white;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

[dir="rtl"] .story-badge {
    right: auto;
    left: 15px;
}

.story-body {
    padding: 1.5rem;
}

.story-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.story-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.story-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.story-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.story-meta i {
    color: var(--gold);
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gold);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.download-btn:hover {
    background: var(--gold-dark);
    transform: translateY(-2px);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .hero-container { grid-template-columns: 1fr; text-align: center; gap: 3rem; }
    .hero-buttons { justify-content: center; }
    .hero-stats { justify-content: center; }
    .hero-visual { order: -1; }
    .about-grid { grid-template-columns: 1fr; gap: 3rem; }
    .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 75px;
        left: 0;
        right: 0;
        background: var(--navy);
        padding: 1rem;
        gap: 0;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 12px 1.5rem; border-radius: 0; }
    .nav-toggle { display: flex; }
    .admin-sidebar { width: 60px; overflow: hidden; }
    .admin-sidebar:hover { width: 260px; }
    .admin-main { margin-left: 60px; }

    [dir="rtl"] .admin-main {
        margin-left: 0;
        margin-right: 60px;
    }

    .sidebar-brand .logo-text, .sidebar-section-label, .sidebar-nav a span, .sidebar-footer a span { display: none; }
    .admin-sidebar:hover .logo-text,
    .admin-sidebar:hover .sidebar-section-label,
    .admin-sidebar:hover .sidebar-nav a span,
    .admin-sidebar:hover .sidebar-footer a span { display: block; }
    .detail-grid { grid-template-columns: 1fr; }
    .books-grid { grid-template-columns: 1fr; }
}