:root {
            --success-color: #4cc9f0;
            --error-color: #e63946;
        }





/* تنسيقات صفحة المكتبة */
#library-page {
    padding: 100px 0 60px;
}

.back-button {
    display: inline-flex;
    align-items: center;
    margin-bottom: 20px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.back-button i {
    margin-right: 8px;
}

.section-title {
    text-align: center;
    margin-bottom: 30px;
}

.section-title h2 {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* السلة تحت النص */
.library-cart-section {
    text-align: center;
    margin: 25px 0 10px;
}

.library-cart-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-color);
    color: white;
    padding: 12px 25px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.library-cart-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    background: var(--secondary-color);
}

.library-cart-count {
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* تنسيقات قائمة الكتب */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.book-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    border: 2px solid transparent;
}

.book-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.book-image {
    width: 100%;
    height: 190px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
}

.book-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--primary-color);
    font-weight: 600;
}

.book-author {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 10px;
}

.book-price {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--success-color);
    margin-bottom: 15px;
}

.book-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.add-to-cart-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
}

.buy-now-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
}

/* تنسيقات سلة المشتريات */
.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.cart-modal.active {
    display: flex;
}

.cart-content {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--bg-color);
}

.cart-title {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.cart-items {
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--bg-color);
}

.item-info {
    flex: 1;
}

.item-name {
    font-weight: 500;
    margin-bottom: 5px;
}

.item-price {
    color: var(--success-color);
    font-weight: 500;
}

.item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    background: var(--bg-color);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity {
    font-weight: 500;
}

.remove-item {
    background: var(--error-color);
    color: white;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    margin-right: 10px;
}

.cart-total {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.checkout-btn {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    width: 100%;
    font-size: 1.1rem;
}

/* تنسيقات نموذج الشراء المنبثق */
.purchase-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.purchase-modal.active {
    display: flex;
}

.purchase-content {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.purchase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--bg-color);
}

.purchase-title {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.close-purchase {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: var(--bg-color);
    color: var(--text-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.submit-order-btn {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    width: 100%;
    font-size: 1.1rem;
    margin-top: 20px;
}

.order-summary {
    background: var(--bg-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* في الشاشات الصغيرة */
@media (max-width: 768px) {
    .books-grid {
        grid-template-columns: 1fr;
    }
    
    .book-actions {
        flex-direction: column;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .cart-content,
    .purchase-content {
        width: 95%;
        padding: 20px;
    }
    
    .library-cart-icon {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}