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

:root {
    --primary-color: #d4af37;
    /* Gold */
    --primary-hover: #b8962e;
    --bg-dark: #0a0c10;
    --bg-card: #161a22;
    --text-main: #ffffff;
    --text-dim: #a0aec0;
    --accent-blue: #253241;
    /* From store */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    direction: rtl;
    /* Arabic-first landing page */
}

/* Glassmorphism Utility */
.glass {
    background: rgba(22, 26, 34, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.1);
    border-radius: 16px;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 700;
    letter-spacing: -0.5px;
}

.gradient-text {
    background: linear-gradient(135deg, #f6e05e 0%, #d4af37 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1rem 10%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 12, 16, 0.85);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    transition: var(--transition);
}

header.scrolled {
    padding: 0.8rem 10%;
    background: rgba(10, 12, 16, 0.95);
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary-color);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

nav a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10%;
    background: radial-gradient(circle at top right, rgba(212, 175, 55, 0.1) 0%, transparent 40%),
        radial-gradient(circle at bottom left, rgba(37, 50, 65, 0.2) 0%, transparent 40%);
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-dim);
    margin-bottom: 2rem;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

.hero-image img {
    max-width: 450px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transform: rotate(-5deg);
    transition: var(--transition);
}

.hero-image:hover img {
    transform: rotate(0deg) scale(1.02);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, #d4af37, #b8962e);
    color: #000;
    box-shadow: 0 10px 20px rgba(212, 175, 55, 0.2);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(212, 175, 55, 0.3);
}

/* Sections */
section {
    padding: 100px 10%;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
}

/* Features/Chapters */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    padding: 2.5rem;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
}

.feature-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: block;
}

.product-card {
    min-width: 280px;
    max-width: 300px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 420px;
}

.product-card .img-wrapper {
    width: 100%;
    height: 180px;
    margin-bottom: 1.2rem;
    overflow: hidden;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
}

.product-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: var(--transition);
}

.product-card:hover img {
    transform: scale(1.1);
}

.product-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    height: 3rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

/* Footer */
footer {
    background: #050608;
    color: #fff;
    padding-top: 4rem;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    font-size: 0.95rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 3rem;
    padding: 0 10% 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

.footer-col h4 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.footer-col p {
    color: var(--text-dim);
    line-height: 1.8;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.8rem;
}

.footer-col ul a {
    color: var(--text-dim);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-col ul a:hover {
    color: var(--primary-color);
    transform: translateX(-5px);
    /* Move left for RTL */
}

/* Newsletter Input */
.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.newsletter-input {
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-family: 'Cairo', sans-serif;
}

.newsletter-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.newsletter-btn {
    padding: 0.8rem;
    background: var(--primary-color);
    border: none;
    border-radius: 6px;
    color: #000;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

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

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

.social-links {
    display: flex;
    gap: 1.2rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    transition: var(--transition);
    font-size: 1.1rem;
}

.social-links a:hover {
    background: var(--primary-color);
    color: #000;
    transform: translateY(-3px);
}

/* 3D Book Card */
.book-card {
    background: transparent;
    perspective: 1000px;
    width: 280px;
    margin: 0 auto;
}

.book-inner {
    position: relative;
    width: 100%;
    height: 420px;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    cursor: pointer;
}

.book-card:hover .book-inner {
    transform: rotateY(10deg) translateY(-10px);
}

.book-front {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    background: #161a22;
    display: flex;
    flex-direction: column;
}

.book-cover {
    height: 65%;
    overflow: hidden;
    position: relative;
}

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

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

.book-details {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(22, 26, 34, 0.9) 0%, rgba(10, 12, 16, 1) 100%);
}

.book-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #fff;
    line-height: 1.4;
}

.book-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.book-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.2rem;
}

.book-btn {
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    transition: all 0.3s;
}

.book-btn:hover {
    background: var(--primary-color);
    color: #000;
    border-color: var(--primary-color);
}

/* FAQ Styles */
.faq-item {
    margin-bottom: 1rem;
    border: 1px solid rgba(212, 175, 55, 0.1);
    border-radius: 12px;
    overflow: hidden;
}

.faq-question {
    padding: 1.2rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.faq-answer {
    padding: 0 1.2rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease-out;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-dim);
}

.faq-item.active .faq-answer {
    padding: 1.2rem;
    max-height: 500px;
}

/* Responsiveness */
@media (max-width: 1024px) {
    .hero {
        flex-direction: column-reverse;
        padding-top: 120px;
        text-align: center;
    }

    .hero-content {
        margin-top: 3rem;
    }

    .hero-image img {
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-col ul a:hover {
        transform: none;
    }

    .footer-bottom {
        flex-direction: column-reverse;
        /* Copyright at bottom */
        gap: 1.5rem;
    }

    nav {
        display: none;
        /* Hidden by default */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(10, 12, 16, 0.98);
        padding: 2rem;
        border-bottom: 1px solid rgba(212, 175, 55, 0.2);
        animation: slideDown 0.3s ease-out;
    }

    nav.active {
        display: block;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .docs-container {
        flex-direction: column;
        padding-top: 100px;
    }

    .docs-sidebar {
        position: relative;
        top: 0;
        width: 100%;
        margin-bottom: 2rem;
    }

    .mobile-menu-btn {
        display: block !important;
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Audience Section */
.audience-card {
    transition: var(--transition);
}

.audience-card:hover {
    transform: translateY(-5px);
}

/* CTA Section */
.cta-section {
    position: relative;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(212, 175, 55, 0.05) 0%, transparent 70%);
    pointer-events: none;
}