* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #FCFCF9;
    min-height: 100vh;
}

/* Header Section */
.header-image {
    max-width: 100%;
    border-radius: 0px 0px 20px 20px; 
    box-shadow: 0 4px 20px rgba(236, 176, 7, 0.2);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

/* أنماط الأقسام */
.category-section {
    margin-bottom: 60px;
    animation: fadeInUp 0.6s ease-out;
    scroll-margin-top: 30px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-header {
    background: linear-gradient(135deg, #ECB007 0%, #f5c842 100%);
    padding: 30px 40px;
    border-radius: 20px;
    margin-bottom: 35px;
    box-shadow: 0 10px 40px rgba(236, 176, 7, 0.25);
    display: flex;
    align-items: center;
    gap: 20px;
    border: 3px solid rgba(252, 252, 249, 0.3);
    transition: all 0.3s ease;
}

.category-header:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(236, 176, 7, 0.35);
}

.category-icon {
    font-size: 3em;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.2));
}

.category-icon i {
    font-size: 1em;
}

.category-info {
    flex: 1;
}

.category-name {
    font-size: 2.2em;
    color: white;
    font-weight: bold;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.category-description {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.15em;
    font-weight: 500;
}

.category-count {
    background: white;
    color: #ECB007;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.1em;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.search-input {
    width: 100%;
    padding: 20px 30px;
    border: 3px solid #ECB007;
    border-radius: 20px;
    font-size: 1.1em;
    transition: all 0.3s ease;
    background: white;
    color: #333;
    box-shadow: 0 8px 30px rgba(236, 176, 7, 0.15);
    margin: 50px 0px;
    display: block;
    position: relative;
}

.search-input:focus {
    outline: none;
    border-color: #ECB007;
    box-shadow: 0 8px 40px rgba(236, 176, 7, 0.25);
    transform: translateY(-3px);
}

.search-input::placeholder {
    color: #999;
}

/* Books Grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(350px, 100%), 1fr));
    justify-items: center;
    gap: 35px;
    margin-bottom: 40px;
}

.book-card {
    background: white;
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 10px 30px rgba(236, 176, 7, 0.15);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    width: 350px;
    max-width: 100%;
    height: 500px;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.5s ease-out;
}

.book-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(236, 176, 7, 0.1) 0%, rgba(252, 252, 249, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.book-card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 20px 50px rgba(236, 176, 7, 0.3);
}

.book-card:hover::before {
    opacity: 1;
}

.book-icon {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: linear-gradient(135deg, #ECB007 0%, #f5c842 100%);
    color: white;
    margin: 0;
    border-radius: 20px 20px 0 0;
    flex: 1;
    position: relative;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
    padding: 20px;
}

.icon-emoji {
    font-size: 5em;
}

.icon-emoji i {
    font-size: 1em;
}

.icon-title {
    font-size: 1.2em;
    font-weight: bold;
    line-height: 1.4;
    max-width: 90%;
}

.book-cover-wrapper {
    position: relative;
    width: 100%;
    flex: 1;
    height: auto;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
}

.book-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.8s ease;
}

.book-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 70%, transparent 100%);
    color: white;
    padding: 30px 15px 15px;
    font-size: 1.1em;
    font-weight: bold;
    text-align: center;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.read-btn {
    display: block;
    background: linear-gradient(135deg, #ECB007 0%, #f5c842 100%);
    color: white;
    padding: 18px 25px;
    text-decoration: none;
    margin: 0;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: bold;
    font-size: 1.15em;
    border-radius: 0 0 20px 20px;
    position: relative;
    z-index: 10;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    box-shadow: 0 -2px 10px rgba(236, 176, 7, 0.2);
}

.read-btn:hover {
    background: linear-gradient(135deg, #f5c842 0%, #ECB007 100%);
    box-shadow: 0 5px 20px rgba(236, 176, 7, 0.4);
}

.no-books {
    text-align: center;
    padding: 80px 40px;
    background: white;
    border-radius: 25px;
    box-shadow: 0 10px 40px rgba(236, 176, 7, 0.15);
    border: 3px solid #ECB007;
}

.no-books-icon {
    color: #ECB007;
    font-size: 6em;
    margin-bottom: 25px;
    filter: drop-shadow(2px 2px 4px rgba(236, 176, 7, 0.3));
}

.no-books-icon i {
    font-size: 1em;
}

.no-books h2 {
    color: #ECB007;
    margin-bottom: 15px;
    font-size: 2em;
}

.no-books p {
    color: #666;
    font-size: 1.2em;
}

/* فورم التواصل */
.contact-section {
    background: white;
    border-radius: 25px;
    padding: 50px;
    margin-top: 60px;
    margin-bottom: 40px;
    box-shadow: 0 15px 50px rgba(236, 176, 7, 0.2);
    border: 3px solid #ECB007;
    position: relative;
    overflow: hidden;
}

.contact-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #ECB007 0%, #f5c842 50%, #ECB007 100%);
}

.contact-title {
    color: #ECB007;
    font-size: 2.5em;
    text-align: center;
    margin-bottom: 15px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(236, 176, 7, 0.1);
}

.contact-subtitle {
    color: #666;
    text-align: center;
    margin-bottom: 40px;
    font-size: 1.2em;
}

.contact-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group-contact {
    margin-bottom: 20px;
}

.form-group-contact label {
    display: block;
    color: #ECB007;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.05em;
}

.form-group-contact input,
.form-group-contact textarea {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #ECB007;
    border-radius: 12px;
    font-size: 1.05em;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.3s ease;
    background: #FCFCF9;
}

.form-group-contact input:focus,
.form-group-contact textarea:focus {
    outline: none;
    border-color: #ECB007;
    box-shadow: 0 0 0 4px rgba(236, 176, 7, 0.1);
    transform: translateY(-2px);
}

.form-group-contact textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-submit-btn {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, #ECB007 0%, #f5c842 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    box-shadow: 0 5px 20px rgba(236, 176, 7, 0.3);
}

.contact-submit-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(236, 176, 7, 0.5);
    background: linear-gradient(135deg, #f5c842 0%, #ECB007 100%);
}

.contact-submit-btn:active {
    transform: translateY(-2px);
}

.contact-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    margin-top: 25px;
    font-weight: bold;
    border: 3px solid #28a745;
    box-shadow: 0 5px 20px rgba(40, 167, 69, 0.2);
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer */
footer {
    text-align: center;
    background: linear-gradient(135deg, #ECB007 0%, #f5c842 100%);
    color: white;
    padding: 30px 20px;
    margin-top: 60px;
    box-shadow: 0 -5px 20px rgba(236, 176, 7, 0.2);
    font-size: 1.1em;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* التجاوب مع الشاشات الصغيرة */
@media (max-width: 768px) {

    .search-input {
        padding: 18px 20px;
        font-size: 1em;
        margin: 30px 0px;
    }

    .category-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 25px 20px;
    }

    .category-name {
        font-size: 1.8em;
    }

    .category-icon {
        font-size: 2.5em;
    }

    .category-description {
        font-size: 1em;
    }

    .books-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .book-card {
        height: 500px;
    }

    .book-title-overlay {
        font-size: 1em;
        padding: 25px 12px 12px;
    }

    .book-card:hover {
        transform: translateY(-10px) scale(1.01);
    }

    .icon-emoji {
        font-size: 4em;
    }

    .icon-title {
        font-size: 1em;
    }

    .read-btn {
        font-size: 1.05em;
        padding: 16px 20px;
    }

    .contact-section {
        padding: 30px 20px;
        margin-top: 40px;
    }

    .contact-title {
        font-size: 2em;
    }

    .contact-subtitle {
        font-size: 1.05em;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-group-contact label {
        font-size: 0.95em;
    }

    .form-group-contact input,
    .form-group-contact textarea {
        padding: 14px 18px;
        font-size: 1em;
    }

    .contact-submit-btn {
        font-size: 1.1em;
        padding: 16px 25px;
    }

    footer {
        font-size: 1em;
        padding: 25px 15px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .category-header {
        padding: 28px 35px;
    }

    .contact-section {
        padding: 45px 35px;
    }
}

@media (min-width: 1025px) {
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* تأثيرات إضافية */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Font Awesome Icons Styling */
i.fas, i.far, i.fab {
    margin-left: 5px;
    margin-right: 5px;
}

label i.fas {
    margin-left: 8px;
}

.contact-submit-btn i.fas {
    margin-left: 8px;
}

/* Selection Color */
::selection {
    background: #ECB007;
    color: white;
}

::-moz-selection {
    background: #ECB007;
    color: white;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #FCFCF9;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ECB007 0%, #f5c842 100%);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #f5c842 0%, #ECB007 100%);
}
