:root {
    --primary-color: #ec4899;        /* وردي أساسي */
    --secondary-color: #db2777;      /* وردي غامق */
    --bg-color: #fdf2f8;             /* خلفية وردي فاتح جدًا */
    --text-color: #831843;           /* لون النص وردي غامق */
    --header-bg: rgba(255, 240, 246, 0.9);
    --card-bg: #ffffff;
    --footer-bg: #500724;
    --footer-text: #fce7f3;
    --whatsapp-green: #22c55e;      /* سيبه زي ما هو */
    --modal-overlay: rgba(0, 0, 0, 0.5);
    --shadow: 0 4px 8px rgb(236 72 153 / 0.25);
}

.dark-mode {
    --bg-color: #2a0a1f;            /* خلفية غامقة وردي */
    --text-color: #fce7f3;
    --header-bg: rgba(80, 7, 36, 0.9);
    --card-bg: #3b0a2a;
    --footer-bg: #1a0210;
    --footer-text: #fbcfe8;
    --shadow: 0 10px 20px rgb(0 0 0 / 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Header & Navigation */
header {
    background-color: var(--header-bg);
    backdrop-filter: blur(8px);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.025em;
}

#logo-img {
    height: 40px;
    width: auto;
}

.dark-mode #logo-img {
    filter: brightness(1.2);
}

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

.search-bar-container {
    max-width: 600px;
    margin: 0.75rem auto 0;
    width: 100%;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

#search-input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    background-color: var(--card-bg);
    color: var(--text-color);
    outline: none;
    font-size: 0.9rem;
}

#search-icon {
    position: absolute;
    left: 1rem;
    color: #94a3b8;
}

[dir="rtl"] #search-input {
    padding: 0.6rem 2.5rem 0.6rem 1rem;
}

[dir="rtl"] #search-icon {
    left: auto;
    right: 1rem;
}

button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}

#theme-toggle {
    background: transparent;
    color: var(--text-color);
    font-size: 1.2rem;
    padding: 0.5rem;
}

#lang-toggle {
    background-color: var(--primary-color);
    color: white;
}

/* Intro Section */
.intro-section {
    padding: 4rem 1rem;
    text-align: center;
    background: linear-gradient(to bottom, transparent, rgba(37, 99, 235, 0.05));
}

.intro-content {
    max-width: 800px;
    margin: 0 auto;
}

.intro-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.intro-content p {
    font-size: 1.1rem;
    color: #64748b;
    margin-bottom: 2rem;
}

.cta-btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 700;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.4);
}

/* Book Grid */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.book-card {
    background-color: var(--card-bg);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.book-card img {
    width: 100%;
    height: 380px;
    object-fit: cover;
}

.book-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.book-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.book-info .author {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.book-info .description {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-info .price {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-top: auto;
    margin-bottom: 1rem;
}

.buy-btn {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--whatsapp-green);
    color: white;
    border-radius: 0.5rem;
    font-size: 1rem;
}

/* Footer */
footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 3rem 1rem 1rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2rem;
}

.dev-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.dev-links a {
    color: var(--whatsapp-green);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-bottom {
    text-align: center;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: #94a3b8;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background-color: var(--modal-overlay);
    z-index: 2000;
    padding: 1rem;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 1rem;
    width: 100%;
    max-width: 450px;
    position: relative;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.5);
}

.close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
}

.contact-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.contact-btn {
    padding: 1rem;
    background-color: var(--whatsapp-green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .intro-content h1 {
        font-size: 2rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .dev-links {
        align-items: center;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.5rem;
    }
    
    .logo {
        font-size: 1.25rem;
    }

    .intro-section {
        padding: 2.5rem 1rem;
    }

    .book-card img {
        height: 300px;
    }
}

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