/* Books Page Custom Styles (Book-style vertical cover aspect & mobile responsive margins) */

/* Books Grid & Cards */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
}

.book-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.book-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 35px rgba(9, 34, 84, 0.12);
    border-color: #fca311;
}

.book-card-image-wrapper {
    position: relative;
    width: 100%;
    min-height: 300px;
    max-height: 400px;
    height: fit-content;
    background: linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-card-image {
    max-width: 100%;
    max-height: 125%;
    width: auto;
    object-fit: cover;
    filter: drop-shadow(0 8px 16px rgba(9, 34, 84, 0.18));
    border-radius: 6px;
    transition:
        transform 0.4s ease,
        filter 0.4s ease;
}

.book-card:hover .book-card-image {
    transform: scale(1.04) translateY(-2px);
    filter: drop-shadow(0 12px 22px rgba(9, 34, 84, 0.25));
}

.book-card-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(9, 34, 84, 0.88);
    color: #ffffff;
    backdrop-filter: blur(6px);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    z-index: 2;
}

.book-card-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.book-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #092254;
    margin-bottom: 4px;
    line-height: 1.3;
}

.book-card-teacher {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.book-card-description {
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: auto;
}

.book-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.book-card-price {
    font-size: 17px;
    font-weight: 800;
    color: #075bd3;
}

.book-card-price span {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-right: 2px;
}

.btn-buy-book {
    background: #fca311;
    color: #ffffff !important;
    border: none;
    border-radius: 65px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 3px 10px rgba(252, 163, 17, 0.25);
    text-decoration: none;
}

.btn-buy-book:hover {
    background: #e59500;
    box-shadow: 0 6px 16px rgba(229, 149, 0, 0.35);
    transform: scale(1.02);
}

/* Modal Custom Tweaks */
.books-modal-content {
    max-width: 580px !important;
    width: 92% !important;
    padding: 30px !important;
    border-radius: 20px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.books-modal-content::-webkit-scrollbar {
    display: none;
}

.modal-book-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal-book-img {
    width: 60px;
    height: 75px;
    border-radius: 8px;
    object-fit: cover;
    background: #ffffff;
    padding: 4px;
    border: 1px solid #e2e8f0;
}

.modal-book-info h4 {
    font-size: 16px;
    font-weight: 700;
    color: #092254;
    margin-bottom: 4px;
}

.modal-book-info .modal-book-price {
    font-size: 15px;
    font-weight: 800;
    color: #075bd3;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.form-col {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.input-group {
    margin-bottom: 16px;
}

.input-label {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
    display: block;
}

.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    color: #0f172a;
    background-color: #ffffff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #fca311;
    box-shadow: 0 0 0 3px rgba(252, 163, 17, 0.15);
}

.book-purchase-modal .choices {
    margin: 0;
}

.book-purchase-modal .choices__inner {
    min-height: 46px;
    padding: 8px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    font-size: 14px;
}

.book-purchase-modal .is-focused .choices__inner,
.book-purchase-modal .is-open .choices__inner {
    border-color: #fca311;
    box-shadow: 0 0 0 3px rgba(252, 163, 17, 0.15);
}

.book-purchase-modal .choices__list--dropdown {
    z-index: 3;
    border-color: #cbd5e1;
}

.book-purchase-modal .choices__input {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #0f172a;
}

.book-purchase-modal .choices__list--dropdown .choices__item--selectable.is-highlighted {
    background: #fff7e6;
}

.btn-book-submit {
    width: 100%;
    background-color: #fca311;
    color: #ffffff;
    border: none;
    border-radius: 65px;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.2s ease;
    box-shadow: 0 6px 20px rgba(252, 163, 17, 0.3);
}

.btn-book-submit:hover {
    background-color: #e59500;
    box-shadow: 0 8px 25px rgba(229, 149, 0, 0.4);
}

/* Mobile & Responsive Adjustments */
@media (max-width: 768px) {
    .search-container form {
        gap: 10px;
        min-width: 0;
    }

    .search-container .search-input-wrapper {
        min-width: 0;
    }

    .search-container .search-btn {
        position: static;
        flex: 0 0 auto;
        width: auto;
        padding: 12px 18px;
    }

    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 22px;
        padding: 0 12px;
    }

    .book-card {
        max-width: 320px;
        margin: 0 auto;
        width: 100%;
    }

    .hero-section,
    .courses-section {
        width: 94% !important;
        margin: 0 auto !important;
        padding: 20px 0 !important;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .books-modal-content {
        padding: 20px !important;
        max-height: calc(100dvh - 24px);
    }

    .book-purchase-modal {
        height: 100dvh;
        align-items: flex-start;
        padding: 12px 0;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .books-grid {
        grid-template-columns: 1fr;
        padding: 0 16px;
    }

    .book-card {
        max-width: 100%;
    }
}
