/* ============================================
   ديوان الإرث - Premium Creative Theme
   Responsive | Interactive | Modern
   ============================================ */

:root {
    --navy: #1a2a3a;
    --navy-deep: #0f1c2e;
    --navy-light: #243447;
    --gold: #d4af37;
    --gold-light: #e8d48b;
    --gold-dark: #b8941f;
    --cream: #f8f6f0;
    --cream-dark: #f0ede3;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --white: #ffffff;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-sm: 10px;
    --shadow: 0 4px 24px rgba(15, 28, 46, 0.08);
    --shadow-md: 0 8px 32px rgba(15, 28, 46, 0.1);
    --shadow-lg: 0 16px 56px rgba(15, 28, 46, 0.14);
    --shadow-gold: 0 4px 24px rgba(212, 175, 55, 0.3);
    --shadow-gold-lg: 0 12px 40px rgba(212, 175, 55, 0.35);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== Global ===== */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (min-width: 576px) { html { font-size: 15px; } }
@media (min-width: 992px) { html { font-size: 16px; } }

body {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    color: var(--text); margin: 0; line-height: 1.9;
    background: var(--white); overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 180px;
}
::selection { background: var(--gold); color: var(--navy-deep); }
a { color: var(--navy); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--gold); }
img { max-width: 100%; height: auto; }

/* ===== Scroll Progress ===== */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 9999; pointer-events: none; }
.scroll-progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold)); transition: width 0.1s linear; border-radius: 0 4px 4px 0; }

/* ===== Back to Top ===== */
.back-to-top {
    position: fixed; bottom: 30px; left: 30px;
    width: 48px; height: 48px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--navy-deep); border: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; cursor: pointer; z-index: 999;
    opacity: 0; visibility: hidden; transform: translateY(20px);
    transition: var(--transition-bounce); box-shadow: var(--shadow-gold);
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-5px) scale(1.1); box-shadow: var(--shadow-gold-lg); }

/* ===== Navbar ===== */
.main-navbar {
    background: rgba(15, 28, 46, 0.97) !important;
    backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(212, 175, 55, 0.08);
    padding: 0.6rem 0; transition: var(--transition); z-index: 1050;
}
.main-navbar.scrolled { background: rgba(15, 28, 46, 0.99) !important; box-shadow: 0 4px 30px rgba(0,0,0,0.15); padding: 0.4rem 0; }
.main-navbar .navbar-brand { font-size: 1.4rem; font-weight: 800; color: #fff !important; transition: var(--transition); }
.main-navbar .navbar-brand:hover { transform: scale(1.03); }
.main-navbar .brand-gold { color: var(--gold); }
.main-navbar .nav-link {
    font-weight: 500; color: rgba(255,255,255,0.7) !important;
    padding: 8px 14px !important; border-radius: 10px;
    font-size: 0.88rem; position: relative; transition: var(--transition);
}
.main-navbar .nav-link:hover, .main-navbar .nav-link.active { color: #fff !important; background: rgba(212, 175, 55, 0.1); }
.main-navbar .nav-link::after {
    content: ''; position: absolute; bottom: 0; right: 50%; transform: translateX(50%);
    width: 0; height: 2px; background: linear-gradient(90deg, var(--gold), var(--gold-light));
    transition: width 0.35s ease; border-radius: 2px;
}
.main-navbar .nav-link:hover::after, .main-navbar .nav-link.active::after { width: 60%; }
.search-input {
    background: rgba(255,255,255,0.07) !important; border: 1px solid rgba(255,255,255,0.1) !important;
    color: #fff !important; border-radius: 25px !important;
    padding: 7px 18px !important; font-size: 0.82rem; transition: var(--transition); width: 160px;
}
.search-input::placeholder { color: rgba(255,255,255,0.35) !important; }
.search-input:focus { background: rgba(255,255,255,0.13) !important; border-color: var(--gold) !important; box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12) !important; width: 220px; }
.navbar-toggler { border: 1px solid rgba(212,175,55,0.3) !important; padding: 4px 10px; }
.navbar-toggler:focus { box-shadow: 0 0 0 3px rgba(212,175,55,0.15); }

@media (max-width: 991px) {
    .main-navbar .navbar-collapse { background: rgba(15, 28, 46, 0.98); margin-top: 10px; border-radius: var(--radius); padding: 16px; border: 1px solid rgba(212,175,55,0.08); }
    .main-navbar .nav-link { padding: 10px 14px !important; }
    .search-input, .search-input:focus { width: 100% !important; margin-top: 8px; }
}

/* ===== Hero ===== */
.hero-section {
    position: relative; overflow: hidden;
    background: linear-gradient(160deg, var(--navy-deep) 0%, var(--navy) 35%, var(--navy-light) 100%);
    padding: 80px 0 70px;
}
.hero-section::before {
    content: ''; position: absolute; top: -40%; left: -15%;
    width: 700px; height: 700px;
    background: radial-gradient(circle, rgba(212,175,55,0.07) 0%, transparent 65%);
    border-radius: 50%; animation: heroOrb1 12s ease-in-out infinite;
}
.hero-section::after {
    content: ''; position: absolute; bottom: -35%; right: -10%;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(212,175,55,0.05) 0%, transparent 65%);
    border-radius: 50%; animation: heroOrb2 15s ease-in-out infinite;
}
.hero-particles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hero-particle {
    position: absolute; border-radius: 50%; background: rgba(212,175,55,0.2);
    animation: particleFloat var(--duration) ease-in-out infinite; animation-delay: var(--delay);
}
@keyframes heroOrb1 { 0%, 100% { transform: translate(0,0) scale(1); } 33% { transform: translate(30px,-40px) scale(1.05); } 66% { transform: translate(-20px,20px) scale(0.95); } }
@keyframes heroOrb2 { 0%, 100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-40px,-30px) scale(1.08); } }
@keyframes particleFloat { 0%,100% { transform: translateY(0) rotate(0); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; } }

.hero-profile-img {
    width: 150px; height: 150px; object-fit: cover; border-radius: 50%;
    border: 3px solid rgba(212, 175, 55, 0.35);
    box-shadow: 0 0 0 8px rgba(212,175,55,0.08), 0 0 60px rgba(212, 175, 55, 0.15);
    transition: var(--transition-bounce); animation: profilePulse 4s ease-in-out infinite;
}
@keyframes profilePulse {
    0%, 100% { box-shadow: 0 0 0 8px rgba(212,175,55,0.08), 0 0 60px rgba(212,175,55,0.15); }
    50% { box-shadow: 0 0 0 14px rgba(212,175,55,0.05), 0 0 80px rgba(212,175,55,0.2); }
}
.hero-profile-img:hover { border-color: var(--gold); transform: scale(1.08) rotate(3deg); box-shadow: 0 0 0 12px rgba(212,175,55,0.1), 0 0 100px rgba(212,175,55,0.3); }
.hero-title {
    font-size: 2.8rem; font-weight: 800; line-height: 1.3;
    background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    background-size: 200% 100%; animation: titleShimmer 4s ease-in-out infinite;
}
@keyframes titleShimmer { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.hero-tagline { font-size: 1.1rem; color: rgba(255,255,255,0.55); font-weight: 300; letter-spacing: 1px; }
.hero-bio { max-width: 650px; margin: auto; color: rgba(255,255,255,0.7); font-size: 1rem; line-height: 2.2; }
.hero-divider { width: 60px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); margin: 1.2rem auto; border: none; opacity: 0.5; }
.hero-btn {
    padding: 12px 30px; border-radius: 50px; font-weight: 600; font-size: 0.9rem;
    transition: var(--transition-bounce); position: relative; overflow: hidden;
}
.hero-btn::before { content: ''; position: absolute; top: 50%; left: 50%; width: 0; height: 0; border-radius: 50%; background: rgba(255,255,255,0.15); transform: translate(-50%,-50%); transition: width 0.6s ease, height 0.6s ease; }
.hero-btn:hover::before { width: 300px; height: 300px; }
.hero-btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: var(--navy-deep) !important; border: none; box-shadow: var(--shadow-gold); }
.hero-btn-gold:hover { transform: translateY(-4px); box-shadow: var(--shadow-gold-lg); color: var(--navy-deep) !important; }
.hero-btn-outline { border: 2px solid rgba(255,255,255,0.2); color: #fff; background: transparent; }
.hero-btn-outline:hover { border-color: var(--gold); color: var(--gold); background: rgba(212,175,55,0.05); transform: translateY(-4px); }

.hero-stats { display: flex; justify-content: center; gap: 2rem; margin-top: 2.5rem; flex-wrap: wrap; }
.hero-stat { text-align: center; padding: 0 1rem; border-right: 1px solid rgba(255,255,255,0.08); }
.hero-stat:last-child { border-right: none; }
.hero-stat-number { font-size: 2rem; font-weight: 800; color: var(--gold); display: block; line-height: 1; }
.hero-stat-label { font-size: 0.8rem; color: rgba(255,255,255,0.5); margin-top: 4px; }

@media (max-width: 991px) { .hero-section { padding: 60px 0 50px; } .hero-title { font-size: 2.2rem; } .hero-profile-img { width: 120px; height: 120px; } }
@media (max-width: 575px) { .hero-section { padding: 50px 0 40px; } .hero-title { font-size: 1.7rem; } .hero-bio { font-size: 0.9rem; } .hero-btn { padding: 10px 22px; font-size: 0.82rem; } .hero-stats { gap: 1rem; } .hero-stat-number { font-size: 1.5rem; } .hero-profile-img { width: 100px; height: 100px; } }

/* ===== Section Title ===== */
.section-title { font-weight: 800; color: var(--navy); font-size: 1.8rem; position: relative; padding-bottom: 16px; }
.section-title::after { content: ''; display: block; width: 50px; height: 3px; background: linear-gradient(90deg, var(--gold), var(--gold-light)); margin: 12px auto 0; border-radius: 4px; }
@media (max-width: 575px) { .section-title { font-size: 1.4rem; } }

/* ===== Reveal on Scroll ===== */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.7s cubic-bezier(0.4,0,0.2,1), transform 0.7s cubic-bezier(0.4,0,0.2,1); }
.reveal.revealed { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; } .reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; } .reveal-delay-4 { transition-delay: 0.4s; }

/* ===== Cards ===== */
.content-card { border-radius: var(--radius); overflow: hidden; border: 1px solid rgba(0,0,0,0.04); background: var(--white); transition: var(--transition); position: relative; }
.content-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: rgba(212, 175, 55, 0.12); }
.content-card::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius); opacity: 0; transition: opacity 0.4s ease; box-shadow: inset 0 0 0 2px rgba(212, 175, 55, 0.15); pointer-events: none; }
.content-card:hover::after { opacity: 1; }
.card-gold-top { height: 3px; background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold)); transition: height 0.3s ease; }
.content-card:hover .card-gold-top { height: 4px; }
.featured-section { background: var(--cream); position: relative; overflow: hidden; }
.featured-section::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: 0.3; }
.featured-section::after { content: ''; position: absolute; bottom: -200px; right: -100px; width: 400px; height: 400px; background: radial-gradient(circle, rgba(212,175,55,0.04) 0%, transparent 70%); border-radius: 50%; }

/* ===== Book Card ===== */
.book-card .card-img-wrapper { overflow: hidden; position: relative; }
.book-card .card-img-top { height: 280px; object-fit: cover; transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.book-card:hover .card-img-top { transform: scale(1.08); }
.book-card .card-img-wrapper::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 80px; background: linear-gradient(transparent, rgba(0,0,0,0.12)); pointer-events: none; }
@media (max-width: 767px) { .book-card .card-img-top { height: 200px; } }
@media (max-width: 575px) { .book-card .card-img-top { height: 160px; } .book-card .card-body h6 { font-size: 0.8rem; } }

/* ===== Poem Card ===== */
.poem-card { background: linear-gradient(135deg, var(--cream) 0%, var(--white) 100%); border: 1px solid rgba(212, 175, 55, 0.12); position: relative; }
.poem-card::before { content: '\201C'; position: absolute; top: 15px; right: 20px; font-size: 5rem; line-height: 1; color: rgba(212,175,55,0.08); font-family: Georgia, serif; }
.poem-text, .poem-preview { font-family: 'Tajawal', sans-serif; line-height: 2.8; text-align: center; color: var(--navy); }

/* ===== Badges ===== */
.badge { font-weight: 500; padding: 5px 12px; border-radius: 20px; font-size: 0.78rem; }
.badge-gold { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: var(--navy-deep); }
.badge-navy { background: var(--navy); color: #fff; }

/* ===== Content HTML ===== */
.content-html { font-size: 1.05rem; line-height: 2.3; color: var(--text); }
.content-html img { max-width: 100%; border-radius: var(--radius-sm); margin: 1.5rem 0; box-shadow: var(--shadow); }
.content-html h2, .content-html h3 { color: var(--navy); margin-top: 2rem; }
.content-html blockquote { border-right: 3px solid var(--gold); padding: 1rem 1.5rem; background: var(--cream); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 1.5rem 0; }

/* ===== Buttons ===== */
.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: var(--navy-deep); border: none;
    border-radius: var(--radius-sm); font-weight: 600; padding: 10px 24px; transition: var(--transition-bounce);
    position: relative; overflow: hidden;
}
.btn-gold::before { content: ''; position: absolute; top: 50%; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent); transform: translateY(-50%); transition: left 0.5s ease; }
.btn-gold:hover::before { left: 100%; }
.btn-gold:hover { transform: translateY(-3px); box-shadow: var(--shadow-gold); color: var(--navy-deep); }
.btn-navy { background: var(--navy); color: #fff; border: none; border-radius: var(--radius-sm); font-weight: 600; padding: 10px 24px; transition: var(--transition-bounce); }
.btn-navy:hover { background: var(--navy-light); color: #fff; transform: translateY(-3px); box-shadow: var(--shadow-md); }
.btn-outline-gold { border: 2px solid var(--gold); color: var(--gold-dark); background: transparent; border-radius: var(--radius-sm); font-weight: 600; transition: var(--transition-bounce); }
.btn-outline-gold:hover { background: var(--gold); color: var(--navy-deep); transform: translateY(-3px); box-shadow: var(--shadow-gold); }

/* ===== Pagination ===== */
.pagination { gap: 4px; flex-wrap: wrap; justify-content: center; }
.pagination .page-link { color: var(--navy); border: 1px solid #e5e5e5; border-radius: 10px !important; margin: 0; padding: 8px 14px; font-weight: 500; transition: var(--transition); min-width: 42px; text-align: center; }
.pagination .page-link:hover { background: var(--cream); border-color: var(--gold); color: var(--gold-dark); transform: translateY(-2px); }
.pagination .page-item.active .page-link { background: linear-gradient(135deg, var(--navy), var(--navy-light)); border-color: var(--navy); color: #fff; }

/* ===== Filter Bar ===== */
.filter-bar { background: var(--white); border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,0.04); transition: var(--transition); }
.filter-bar:focus-within { box-shadow: var(--shadow-md); border-color: rgba(212,175,55,0.1); }
.filter-bar .form-control, .filter-bar .form-select { border-radius: var(--radius-sm); border: 1px solid #e5e5e5; padding: 10px 16px; font-size: 0.9rem; }
.filter-bar .form-control:focus, .filter-bar .form-select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1); }
@media (max-width: 767px) { .filter-bar { padding: 1rem; border-radius: var(--radius); } .filter-bar .form-control, .filter-bar .form-select { font-size: 0.85rem; padding: 8px 12px; } }

/* ===== Footer ===== */
.main-footer { background: var(--navy-deep); color: rgba(255,255,255,0.6); position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; overflow: hidden; }
.main-footer::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.main-footer::after { content: ''; position: absolute; bottom: -150px; left: 50%; transform: translateX(-50%); width: 500px; height: 300px; background: radial-gradient(ellipse, rgba(212,175,55,0.03) 0%, transparent 70%); }
.main-footer .social-link {
    display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center;
    border-radius: 50%; background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.5);
    margin: 0 5px; transition: var(--transition-bounce); font-size: 1.1rem; border: 1px solid rgba(255,255,255,0.06);
}
.main-footer .social-link:hover { background: var(--gold); color: var(--navy-deep); transform: translateY(-5px) scale(1.1); box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3); border-color: var(--gold); }
.footer-brand { color: #fff; font-size: 1.3rem; font-weight: 700; }
.footer-gold { color: var(--gold); }
@media (max-width: 767px) { .main-footer .social-link { width: 38px; height: 38px; font-size: 0.95rem; margin: 0 3px; } }

/* ===== Contact ===== */
.contact-card { border-radius: var(--radius-lg); border: none; background: var(--white); box-shadow: var(--shadow-lg); overflow: hidden; transition: var(--transition); }
.contact-card:hover { transform: translateY(-4px); box-shadow: 0 20px 60px rgba(15,28,46,0.15); }
.contact-card-header {
    background: linear-gradient(135deg, var(--navy-deep), var(--navy), var(--navy-light));
    color: var(--gold); padding: 1.5rem; text-align: center; font-weight: 700; font-size: 1.15rem;
    position: relative; overflow: hidden;
}
.contact-card-header::after { content: ''; position: absolute; top: -50%; right: -50%; width: 200%; height: 200%; background: radial-gradient(circle, rgba(212,175,55,0.06) 0%, transparent 50%); animation: contactGlow 8s ease-in-out infinite; }
@keyframes contactGlow { 0%, 100% { transform: translate(0,0); } 50% { transform: translate(-20%,20%); } }
.contact-card .form-control { border-radius: var(--radius-sm); border: 1.5px solid #e8e8e8; padding: 12px 16px; transition: var(--transition); }
.contact-card .form-control:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.08); transform: translateY(-1px); }

/* ===== Focus States ===== */
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12); }
.form-control { border-radius: var(--radius-sm); transition: var(--transition); }
.form-control:hover { border-color: #ccc; }

/* ===== Empty State ===== */
.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-state-icon { font-size: 4rem; color: var(--gold); opacity: 0.3; margin-bottom: 1rem; animation: emptyBounce 3s ease-in-out infinite; }
@keyframes emptyBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ===== Animations ===== */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.animate-fade-up { animation: fadeInUp 0.6s ease both; }
.animate-scale { animation: scaleIn 0.5s ease both; }

/* ===== Responsive ===== */
@media (max-width: 991px) { .container { padding-left: 20px; padding-right: 20px; } }
@media (max-width: 767px) { .py-5 { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; } .mb-5 { margin-bottom: 2rem !important; } .card-body { padding: 1rem; } .btn-lg { padding: 10px 20px; font-size: 0.9rem; } body { padding-bottom: 200px; } }
@media (max-width: 575px) { .col-6 { padding-left: 6px; padding-right: 6px; } .row.g-4 { --bs-gutter-x: 0.75rem; --bs-gutter-y: 0.75rem; } }

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--navy-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--navy); }

/* ===== Print ===== */
@media print { .main-navbar, .main-footer, .back-to-top, .scroll-progress, .filter-bar { display: none !important; } .content-card { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; } body { font-size: 12pt; color: #000; } }
