/* === إعادة تعيين الأنماط الأساسية === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === المتغيرات الأساسية === */
:root {
    --gold: #D4AF37;
    --gold-light: #E5C76B;
    --gold-dark: #B8960C;
    --charcoal: #1A1A1A;
    --charcoal-light: #2D2D2D;
    --beige: #FAF8F5;
    --beige-dark: #F0EDE8;
    --white: #FFFFFF;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--beige);
    color: var(--charcoal);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === الأنيميشن === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* تأخير الأنيميشن */
.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.2s; opacity: 0; }
.delay-3 { animation-delay: 0.3s; opacity: 0; }
.delay-4 { animation-delay: 0.4s; opacity: 0; }
.delay-5 { animation-delay: 0.5s; opacity: 0; }
.delay-6 { animation-delay: 0.6s; opacity: 0; }
.delay-7 { animation-delay: 0.7s; opacity: 0; }

/* === الهيدر === */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(250, 248, 245, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    transition: all 0.3s ease;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--charcoal);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--charcoal);
}

.logo-text span {
    color: var(--gold);
}

/* شريط البحث */
.search-container {
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 2px solid var(--beige-dark);
    border-radius: 50px;
    background: var(--white);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
}

/* التنقل - سطح المكتب */
.nav-desktop {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    text-decoration: none;
    color: var(--charcoal);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--gold);
    background: rgba(212, 175, 55, 0.1);
}

.btn-login {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
}

.btn-register {
    background: transparent;
    color: var(--charcoal);
    padding: 0.55rem 1.25rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid var(--gold);
    font-size: 0.9rem;
}

.btn-register:hover {
    background: var(--gold);
    color: white;
}

/* زر البرجر - الجوال */
.burger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 5px;
}

.burger-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--charcoal);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.burger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.burger-btn.active span:nth-child(2) {
    opacity: 0;
}

.burger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* قائمة الجوال */
.nav-mobile {
    display: none;
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    background: rgba(250, 248, 245, 0.98);
    backdrop-filter: blur(12px);
    padding: 1rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    flex-direction: column;
}

.nav-mobile.active {
    display: flex;
}

.nav-mobile .search-container {
    margin: 0 0 1rem 0;
    max-width: 100%;
}

.nav-mobile .nav-link {
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.nav-mobile .btn-login,
.nav-mobile .btn-register {
    text-align: center;
    margin-top: 0.5rem;
    display: inline-block;
    width: auto;
}

/* === قسم البطل (Hero) === */
.hero {
    padding: 8rem 1.5rem 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: 
        radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 100%, rgba(212, 175, 55, 0.05) 0%, transparent 50%);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(212, 175, 55, 0.15);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--gold-dark);
    font-weight: 500;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-title span {
    color: var(--gold);
}

.hero-description {
    font-size: 1.15rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(212, 175, 55, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--charcoal);
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    border: 2px solid var(--beige-dark);
}

.btn-secondary:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* كتب متحركة في الخلفية */
.floating-books {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.floating-book {
    position: absolute;
    font-size: 2rem;
    opacity: 0.15;
}

.floating-book:nth-child(1) { top: 20%; left: 10%; animation: float 4s ease-in-out infinite; }
.floating-book:nth-child(2) { top: 60%; left: 5%; animation: float 5s ease-in-out infinite 1s; }
.floating-book:nth-child(3) { top: 30%; right: 10%; animation: float 4.5s ease-in-out infinite 0.5s; }
.floating-book:nth-child(4) { top: 70%; right: 8%; animation: float 5.5s ease-in-out infinite 1.5s; }
.floating-book:nth-child(5) { top: 45%; left: 15%; animation: float 3.5s ease-in-out infinite 2s; }

/* === قسم الكتب === */
.books-section {
    padding: 4rem 1.5rem;
    background: var(--white);
}

.books-container {
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.section-subtitle {
    color: #666;
    font-size: 1rem;
}

/* بطاقات الكتب */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.book-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid var(--beige-dark);
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    border-color: var(--gold);
}

.book-image-container {
    position: relative;
    height: 220px;
    background: linear-gradient(135deg, var(--beige-dark) 0%, var(--beige) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.book-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-emoji {
    font-size: 4rem;
}

.bestseller-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: white;
    font-size: 0.75rem;
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.category-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(26, 26, 26, 0.8);
    color: var(--gold-light);
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-weight: 500;
}

.book-content {
    padding: 1.5rem;
}

.book-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.book-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-footer {
    display: flex;
    gap: 0.75rem;
}

.btn-view {
    flex: 1;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-view:hover {
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3);
}

.btn-favorite {
    width: 48px;
    height: 48px;
    border: 2px solid var(--beige-dark);
    border-radius: 10px;
    background: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.btn-favorite:hover {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.1);
}

.btn-favorite.active {
    background: var(--gold);
    border-color: var(--gold);
}

.btn-favorite.active .heart-icon {
    color: white;
}

/* === قسم من نحن === */
.about-section {
    padding: 4rem 1.5rem;
    background: var(--beige);
}

.about-container {
    max-width: 1280px;
    margin: 0 auto;
    text-align: center;
    padding: 0 1rem;
}

.about-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.about-content {
    max-width: 100%;
    margin: 0 auto;
    text-align: justify;
}

.about-card {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    transition: none;
}

.about-card:hover {
    box-shadow: none;
}

.about-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.about-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold-dark);
    margin-bottom: 1.25rem;
    text-align: center;
}

.about-card-text {
    color: #444;
    font-size: 1rem;
    line-height: 1.9;
    margin-bottom: 1rem;
}

/* === الفوتر === */
.footer {
    background: var(--charcoal);
    padding: 3rem 1.5rem 1.5rem;
    margin-top: auto;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--gold);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-section p,
.footer-section a {
    color: var(--beige);
    font-size: 0.9rem;
    line-height: 1.8;
    text-decoration: none;
    display: block;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--gold);
}

.footer-bottom {
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    padding-top: 1.5rem;
    text-align: center;
    color: var(--beige);
    font-size: 0.9rem;
}

.footer-bottom span {
    color: var(--gold);
}

/* === شاشة الأيباد === */
@media (min-width: 769px) and (max-width: 1024px) {
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* === التجاوب للجوال === */
@media (max-width: 768px) {
    .header-container {
        padding: 0.75rem 1rem;
    }

    .search-container {
        display: none;
    }

    .nav-desktop {
        display: none;
    }

    .burger-btn {
        display: flex;
    }

    .hero {
        padding: 6rem 1rem 3rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .section-title {
        font-size: 1.5rem;
        flex-wrap: wrap;
    }

    .books-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }

    .logo-text {
        font-size: 1rem;
    }
}

/* أنماط شعار hero */
.hero-logo-container {
    margin: 15px 0 20px;
    text-align: center;
}

.hero-logo {
    max-width: 100%;
    height: auto;
    max-height: 250px; /* يمكنك تعديل هذا الارتفاع حسب حجم الشعار */
    width: auto;
    object-fit: contain;
}

/* للشاشات الصغيرة */
@media (max-width: 768px) {
    .hero-logo {
        max-height: 150px;
    }
}

/* للشاشات الصغيرة جداً */
@media (max-width: 480px) {
    .hero-logo {
        max-height: 120px;
    }
}

/* الفاصل في قائمة الجوال */
.nav-mobile .mobile-separator {
    display: none; /* يظهر فقط عندما يكون موجوداً بين عنصرين */
}

/* عندما يظهر الفاصل بين Tentang Kami و E-book Saya نجعل له عرض */
.nav-mobile .separator.mobile-separator {
    display: inline;
    color: #ccc;
    margin: 0 5px;
    font-size: 1rem;
}

/* تحسين مظهر الأيقونات في سطح المكتب */
@media (min-width: 769px) {
    .nav-desktop .nav-link {
        font-size: 1.3rem;
        padding: 0.5rem;
    }

    .nav-desktop .btn-login,
    .nav-desktop .btn-register {
        font-size: 0.9rem;
        padding: 0.6rem 1.25rem;
    }

    .nav-desktop .separator {
        color: #ccc;
        font-size: 1.2rem;
        margin: 0 0.2rem;
    }
}