:root {
    --bg-dark: #050508;
    --bg-card: rgba(17, 17, 24, 0.7);
    --accent-blue: #3b82f6;
    --accent-indigo: #6366f1;
    --accent-gradient: linear-gradient(135deg, #6366f1, #3b82f6);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-glass: rgba(255, 255, 255, 0.08);
    --font-heading: 'Tajawal', sans-serif;
    --font-body: 'Almarai', sans-serif;
    --font-ar: 'Almarai', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    direction: rtl;
}

/* Background Visuals */
.bg-glow {
    position: fixed;
    top: -10%;
    right: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    z-index: -1;
    filter: blur(100px);
}

.bg-lines {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navigation */
.glass-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(5, 5, 8, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.logo span {
    color: var(--accent-blue);
}

.code-link {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

.code-link:hover {
    color: var(--text-main);
}

/* Hero Section */
.hero {
    padding: 6rem 0 4rem;
    text-align: center;
}

.badge-premium {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-indigo);
    margin-bottom: 2rem;
}

h1.gradient-text {
    font-family: var(--font-ar);
    font-size: 4rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(to bottom, #ffffff 30%, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero .subtitle {
    max-width: 700px;
    margin: 0 auto 3rem;
    font-size: 1.25rem;
    color: var(--text-muted);
}

.hero-actions {
    margin-bottom: 4rem;
}

.cta-primary {
    display: inline-block;
    padding: 1.25rem 2.5rem;
    background: var(--accent-gradient);
    color: #fff;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    cursor: pointer;
}

.cta-primary:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 50px rgba(99, 102, 241, 0.6);
}

.cta-note {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Trust Bar */
.trust-bar {
    border-top: 1px solid var(--border-glass);
    padding-top: 2rem;
}

.trust-bar span {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 1rem;
}

.trust-icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
    color: #475569;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 6rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
}

.stat-num {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--accent-blue);
    margin-bottom: 0.5rem;
}

/* Features Premium */
.section-badge {
    text-align: center;
    color: var(--accent-blue);
    font-weight: 800;
    margin-bottom: 1rem;
}

.section-title-premium {
    text-align: center;
    font-family: var(--font-ar);
    font-size: 2.5rem;
    margin-bottom: 4rem;
}

.features-grid-premium {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 6rem;
}

.feature-card-premium {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    padding: 2.5rem;
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s;
}

.feature-card-premium:hover {
    border-color: var(--accent-indigo);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.feature-card-premium h3 {
    font-family: var(--font-ar);
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

/* Pricing */
.pricing {
    display: flex;
    justify-content: center;
    margin-bottom: 8rem;
}

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 32px;
}

/* Ebook Cover Enhancements (in style.css for persistence) */
.book-cover-3d {
    width: 280px;
    height: 400px;
    margin: 0 auto 3rem;
    position: relative;
    transform-style: preserve-3d;
    transform: perspective(1000px) rotateY(-20deg) rotateX(10deg);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.book-cover-3d:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg) scale(1.05);
}

.book-front {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 1px solid rgba(197, 160, 89, 0.3);
    border-radius: 4px 12px 12px 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    box-shadow: 15px 15px 40px rgba(0, 0, 0, 0.5);
    color: var(--paper-bg);
}

.book-spine {
    position: absolute;
    top: 5px;
    right: 100%;
    bottom: 5px;
    width: 45px;
    background: #0f1a2a;
    transform-origin: right;
    transform: rotateY(-90deg);
    border-radius: 4px 0 0 4px;
    border-left: 2px solid rgba(197, 160, 89, 0.4);
}

.book-brand-icons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    opacity: 0.8;
}

.tiktok-sign {
    color: #ff0050;
    text-shadow: 0 0 10px rgba(255, 0, 80, 0.5);
}

.chatgpt-sign {
    color: #10a37f;
    text-shadow: 0 0 10px rgba(16, 163, 127, 0.5);
}

.pricing-card {
    padding: 3rem;
    width: 100%;
    max-width: 500px;
    text-align: center;
    position: relative;
    border: 2px solid var(--accent-indigo);
}

.price {
    font-size: 4rem;
    font-weight: 800;
    margin: 1.5rem 0;
    font-family: var(--font-heading);
}

.old-price {
    font-size: 1.2rem;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-right: 1rem;
}

.price-features {
    list-style: none;
    text-align: right;
    margin-bottom: 2.5rem;
}

.price-features li {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.full-width {
    width: 100%;
}

/* Footer */
footer {
    padding: 4rem 0;
    border-top: 1px solid var(--border-glass);
    text-align: center;
}

.footer-content {
    margin-bottom: 2rem;
}

.footer-links {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.copyright {
    font-size: 0.8rem;
    color: #475569;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    padding: 2rem;
    align-items: center;
    justify-content: center;
}

.modal-content {
    width: 100%;
    max-width: 400px;
    padding: 3rem;
    position: relative;
    text-align: center;
}

.close-modal {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    /* RTL */
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
}

.pin-input-container {
    margin: 2rem 0;
}

#pinInput {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-glass);
    border-radius: 12px;
    padding: 1rem;
    font-size: 2rem;
    text-align: center;
    color: #fff;
    letter-spacing: 12px;
    font-family: var(--font-heading);
}

#pinInput:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.shake {
    animation: shakeEffect 0.5s ease-in-out;
}

@keyframes shakeEffect {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

.error-msg {
    color: #ef4444;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: none;
}

/* Library specific styles (reused) */
.prompts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.prompt-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.5rem;
}

.prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.prompt-label {
    font-size: 0.8rem;
    color: var(--accent-indigo);
    font-weight: 800;
}

.copy-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 0.4rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
}

.prompt-content {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 10px;
    font-size: 1.1rem;
    border-right: 3px solid var(--accent-blue);
}

/* Responsive */
@media (max-width: 768px) {
    h1.gradient-text {
        font-size: 2.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}