* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #693000;
    min-height: 100vh;
    padding: 20px;

}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgb(67 26 3);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgb(10 5 1 / 76%);
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #000000;
}

h1 {
    color: #8b3f0a;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 6px 1px 0px rgb(0 0 0);
}


.search-section {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.search-bar {
    flex: 1;
    min-width: 250px;
    max-width: 500px;
    padding: 15px 20px;
    border: 2px solid #000000;
    border-radius: 50px;
    font-size: 16px;
    background-color: #532600;
    transition: all 0.3s;
}

.search-bar:focus {
    outline: none;
    border: none;
    box-shadow: 14px -4px 20px rgb(0 0 0);
    transform: scale(1.02);
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 12px 25px;
    background: #512a02;
    color: white;
    border: none;
    box-shadow: 8px -4px 0px 1px #000000;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
}

.filter-btn:hover {
    background: #935f00d1;
    transform: translateY(-2px);

}

.filter-btn.active {
    background: #935f00;
    box-shadow: none
}

.shelf-container {
    margin-bottom: 50px;
}

.shelf {
    position: relative;
    padding: 30px 20px 40px;
    margin-bottom: 60px;
    background: #1a1a1a4a;
    border-radius: 10px;
    box-shadow: inset 0px 20px 20px 30px rgb(14 14 14 / 43%);

}

.shelf::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(180deg, #8b5a3c 0%, #654321 100%);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.shelf-title {
    font-size: 1.8em;
    color: #ffffff;
    margin-bottom: 20px;
    padding: 10px;
    background: rgb(81 42 2);
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
}

.books-row {
    display: flex;
    gap: 25px;
    overflow-x: auto;
    padding: 20px 10px;
    align-items: flex-end;
}

.books-row::-webkit-scrollbar {
    height: 10px;
}

.books-row::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.151);
    border-radius: 10px;
}

.books-row::-webkit-scrollbar-thumb {
    background: #935f00;
    border-radius: 10px;
}

.book {
    flex: 0 0 auto;
    width: 180px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.book:hover {
    transform: scale(1.05);
    z-index: 10;
}

.book-cover {
    width: 100%;
    height: 260px;
    border-radius: 8px;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.3), -2px 0 8px rgba(0, 0, 0, 0.2);
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.8);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s;
}

img {
    width: 100%;
    height: 100%;

}

.book:hover .book-cover {
    box-shadow: 8px 8px 25px rgba(0, 0, 0, 0.4), -3px 0 12px rgba(0, 0, 0, 0.3);
}

.book-info {
    padding: 12px 5px;
    text-align: center;
}

.book-title {
    font-weight: bold;
    color: #777777;
    font-size: 14px;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-author {
    color: #666;
    font-size: 12px;
    margin-bottom: 5px;
}

.book-price {
    color: #919191;
    font-weight: bold;
    font-size: 16px;
}

.rating {
    color: #ffd700;
    font-size: 14px;
    margin: 5px 0;
}

.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 15px;
    border-radius: 10px;
    font-size: 13px;
    width: 250px;
    z-index: 1000;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    display: none;
    line-height: 1.6;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: #291800d9;
    padding: 30px;
    border-radius: 20px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.4s;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 30px;
    cursor: pointer;
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #8b3f0a;
    transition: all 0.3s;
}

.close-modal:hover {
    background: #b59164;
    color: white;
    transform: rotate(90deg);
}

.modal-book-details {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.modal-book-cover {
    width: 250px;
    height: 350px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    object-fit: cover;

    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    text-align: center;

}

.modal-book-info {
    flex: 1;
}

.modal-book-info h2 {
    color: #8b3f0a;
    margin-bottom: 10px;
    font-size: 2em;
}

.modal-book-info p {
    margin: 10px 0;
    color: #666;
    line-height: 1.8;
}

.add-to-cart-btn {
    background: #3b2600;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s;
    width: 100%;
}

.add-to-cart-btn:hover {
    background: #67470c;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgb(85 63 3);
}

.cart-icon {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #271a02;
    color: white;
    padding: 15px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    z-index: 1500;
}

.cart-icon:hover {
    background: #935f00;
    transform: scale(1.1);
}

.cart-count {
    background: #513d18;
    border-radius: 50%;
    padding: 2px 8px;
    margin-right: 5px;
    font-size: 14px;
}

.review-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #000000;
}

.review-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}
.review-form input,
.review-form select
{
background-color: #532600;
}

.review-form input,
.review-form textarea
,.review-form select
 {
    padding: 12px;
    border: 2px solid #000000;
    border-radius: 10px;
    font-size: 14px;
    color: white;
    font-family: inherit;
}

.review-form input:focus{
        outline: none;
            border: none;
            box-shadow: -12px -6px 20px 0px #000000;
            transform: scale(1.001);
            transition: .3s;
}

.review-form textarea {
    min-height: 100px;
    resize: vertical;
}

.submit-review-btn {
    background: #5b4214;
    color: white;
    padding: 12px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.submit-review-btn:hover {
    background: #695a3a;
    transform: translateY(-2px);
}

.reviews-list {
    margin-top: 20px;
}

.review-item {
    background: #73564e;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.review-item strong {
    color: white;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 10px 20px;
    background: #e0e0e0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.page-btn:hover {
    background: #667eea;
    color: white;
}

.page-btn.active {
    background: #667eea;
    color: white;
}

.no-books {
    text-align: center;
    padding: 50px;
    color: #666;
    font-size: 1.2em;
}

.admin-section {
    margin-top: 30px;
    padding: 20px;
    background: #391c03;
    border-radius: 15px;
}

.admin-form {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.admin-form input,
.admin-form select {
    padding: 12px;
    border: 2px solid black;
    border-radius: 10px;
    font-size: 14px;
    transition: .3s;
    color: white;

    background-color: #532600;
}

.admin-form input:focus {
    outline: none;
    border: none;
    box-shadow: -12px -6px 20px 0px #000000;
    transform: scale(1.001);
    transition: .3s;
}

.admin-btn {
    padding: 12px 25px;
    background: #5a3b00;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.admin-btn:hover {
    background: #935f00;
    transform: translateY(-2px);
    box-shadow: -12px -6px 20px 0px #000000;
}

.delete-btn {
    background: #dc3545;
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 5px;
}

.delete-btn:hover {
    background: #c82333;
}

@media (max-width: 768px) {
    .modal-book-details {
        flex-direction: column;
    }

    .books-row {
        gap: 15px;
    }

    .book {
        width: 140px;
    }

    .book-cover {
        height: 200px;
    }

    h1 {
        font-size: 1.8em;
    }
}



.book-link-wrapper {
    text-decoration: none;
    display: block;
    position: relative;
}


.book-link-wrapper:hover .book-cover::after {
    content: '🔗 Read';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1.2em;
    pointer-events: none;
}


.read-btn {
    display: block;
    background: #816b39;
    color: white;
    text-align: center;
    padding: 10px;
    margin-top: 10px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
}

.read-btn:hover {
    background: #8b672d;
    transform: translateY(-2px);
}

textarea {
    background-color: #532600;
    border-color: black;
    border-width: 2px;
    padding: 12px;
    border-radius: 10px;
    grid-column: 1 / -1;
}

textarea:focus {
    outline: none;
    border: none;
    box-shadow: -12px -6px 20px 0px #000000;
    transform: scale(1.001);
    transition: .3s;
}