@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #005596; /* Biru Gramedia */
    --primary-hover: #004478;
    --primary-light: rgba(0, 85, 150, 0.1);
    --secondary: #10B981;
    --dark: #1E293B;
    --light: #F8FAFC;
    --gray: #64748B;
    --border-color: #E2E8F0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: #F6F8FC;
    color: var(--dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-wrapper {
    flex: 1;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Navbar Style */
.navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 0;
}

.navbar-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.nav-brand {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.nav-brand span {
    background: linear-gradient(135deg, var(--primary), #3B82F6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Search Bar in Navbar */
.nav-search-container {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.nav-search-form {
    display: flex;
    align-items: center;
    background: #F1F5F9;
    border: 1px solid transparent;
    border-radius: 50px;
    padding: 0.25rem 0.5rem 0.25rem 1.25rem;
    transition: all 0.3s ease;
}

.nav-search-form:focus-within {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 85, 150, 0.15);
}

.search-icon {
    color: var(--gray);
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.nav-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.6rem 0.5rem;
    font-size: 0.95rem;
    outline: none;
    color: var(--dark);
}

.nav-search-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.nav-search-btn:hover {
    background: var(--primary-hover);
}

/* Suggestions Dropdown */
.search-suggestions-box {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    z-index: 1010;
    display: none;
    max-height: 380px;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.search-suggestions-box.active {
    display: block;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    color: var(--dark);
    transition: background-color 0.2s;
}

.suggestion-item:hover {
    background-color: #F8FAFC;
}

.suggestion-item.empty {
    color: var(--gray);
    font-size: 0.95rem;
    text-align: center;
    padding: 1.5rem;
}

.suggestion-cover {
    width: 35px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.suggestion-cover-placeholder {
    width: 35px;
    height: 50px;
    background: #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: var(--gray);
    flex-shrink: 0;
}

.suggestion-info {
    flex: 1;
    min-width: 0;
}

.suggestion-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-author {
    font-size: 0.8rem;
    color: var(--gray);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
}

.nav-link-item {
    text-decoration: none;
    color: var(--dark);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-link-item:hover {
    color: var(--primary);
}

/* Banner Carousel Style */
.hero-carousel-section {
    margin-bottom: 2.5rem;
}

.carousel-container {
    width: 100%;
    height: 380px;
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.carousel-track {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    z-index: 1;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 2;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 85, 150, 0.9) 0%, rgba(0, 0, 0, 0.4) 100%);
    display: flex;
    align-items: center;
    padding: 0 10%;
}

.carousel-content {
    max-width: 550px;
    color: white;
}

.carousel-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 1rem;
}

.carousel-content h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    line-height: 1.25;
}

.carousel-content p {
    font-size: 1.1rem;
    margin-bottom: 1.75rem;
    opacity: 0.9;
    line-height: 1.5;
}

.carousel-btn {
    background: white;
    color: var(--primary);
    text-decoration: none;
    padding: 0.8rem 1.75rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-block;
}

.carousel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
}

.carousel-control:hover {
    background: rgba(255, 255, 255, 0.3);
}

.carousel-control.prev { left: 1.5rem; }
.carousel-control.next { right: 1.5rem; }

.carousel-dots {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: background 0.3s, width 0.3s;
}

.carousel-dot.active {
    background: white;
    width: 24px;
    border-radius: 50px;
}

/* Category Circle Selection */
.categories-section {
    background: white;
    padding: 1.5rem;
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2.5rem;
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.categories-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark);
}

.categories-container-scroll {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.categories-container-scroll::-webkit-scrollbar {
    display: none;
}

.categories-grid {
    display: flex;
    gap: 1.75rem;
    padding: 0.25rem 0.25rem;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--dark);
    gap: 0.65rem;
    transition: transform 0.25s ease;
}

.category-card:hover {
    transform: translateY(-3px);
}

.category-icon-wrapper {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    transition: all 0.25s ease;
}

.category-card:hover .category-icon-wrapper {
    box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}

.category-card.active .category-icon-wrapper {
    box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px var(--primary);
}

.category-name {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

/* Curated Book Horizontal Slider */
.curated-section {
    margin-bottom: 3rem;
}

.section-title-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.section-subtitle {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
}

.scroll-controls {
    display: flex;
    gap: 0.5rem;
}

.scroll-btn {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--dark);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.scroll-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.books-scroll-wrapper {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 0.75rem 0.25rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.books-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

/* Book Card Vertical (Gramedia Style) */
.book-card-vertical {
    flex: 0 0 220px;
    background: white;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.book-card-vertical:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
    border-color: rgba(0, 85, 150, 0.2);
}

.book-cover-container {
    height: 280px;
    width: 100%;
    position: relative;
    background: #ECEFF1;
    overflow: hidden;
}

.book-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.book-card-vertical:hover .book-cover-img {
    transform: scale(1.04);
}

.book-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    font-size: 0.85rem;
    gap: 0.5rem;
}

.book-popular-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #F59E0B;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

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

.book-card-category {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    margin-bottom: 0.35rem;
    letter-spacing: 0.25px;
}

.book-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.6rem;
}

.book-card-title a {
    text-decoration: none;
    color: var(--dark);
}

.book-card-title a:hover {
    color: var(--primary);
}

.book-card-author {
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.book-card-stock {
    font-size: 0.75rem;
    font-weight: 700;
}

.book-card-stock.instock { color: var(--secondary); }
.book-card-stock.outofstock { color: #EF4444; }

.book-card-btn {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.book-card-btn:hover {
    background: var(--primary);
    color: white;
}

/* Main Catalog Grid Styles */
.catalog-section {
    padding-top: 1rem;
    margin-bottom: 4rem;
}

.book-grid-main {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.75rem;
    margin-top: 1.5rem;
}

.book-grid-main .book-card-vertical {
    flex: unset;
}

/* Reset / Clear Search buttons */
.btn-clear-search {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-clear-search:hover {
    background: var(--primary);
    color: white;
}

.btn-clear-search-large {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 85, 150, 0.2);
    transition: all 0.2s;
}

.btn-clear-search-large:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 85, 150, 0.3);
}

.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    grid-column: 1 / -1;
    color: var(--gray);
    background: white;
    border-radius: 24px;
    border: 1px solid var(--border-color);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1.25rem;
    color: #CBD5E1;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.empty-state p {
    font-size: 0.95rem;
}

/* Pagination Styling */
.pagination-wrapper {
    margin-top: 3.5rem;
    display: flex;
    justify-content: center;
}

.pagination-wrapper nav svg {
    width: 20px;
    height: 20px;
}

/* Footer Style */
footer {
    background: #002D54; /* Lebih gelap dari biru utama */
    color: white;
    padding: 3.5rem 1.5rem 2rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-brand h3 {
    font-size: 1.4rem;
    font-weight: 800;
}

.footer-desc {
    max-width: 600px;
    margin: 0 auto 2.5rem;
    font-size: 0.95rem;
    opacity: 0.8;
    line-height: 1.6;
}

.footer-divider {
    border: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.footer-copy {
    font-size: 0.85rem;
    opacity: 0.6;
}

/* Book Detail Page Layout (show.blade.php) */
.detail-container {
    max-width: 1100px;
    margin: 1.5rem auto 4rem;
    animation: fadeUp 0.6s ease-out;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.breadcrumbs a {
    color: var(--gray);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    color: var(--primary);
}

.breadcrumbs svg {
    color: #CBD5E1;
}

.detail-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 2.5rem;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3.5rem;
    box-shadow: var(--shadow-sm);
}

.detail-cover-wrapper {
    position: relative;
    width: 100%;
}

.detail-cover {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
    object-fit: cover;
    aspect-ratio: 3/4;
}

.detail-cover-placeholder {
    width: 100%;
    aspect-ratio: 3/4;
    background: #F1F5F9;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    border: 2px dashed #CBD5E1;
}

.detail-trend-badge {
    margin-top: 1.5rem;
    background: #FEF3C7;
    color: #D97706;
    padding: 0.6rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #FDE68A;
}

.detail-info {
    display: flex;
    flex-direction: column;
}

.detail-badge-wrapper {
    display: flex;
    gap: 0.65rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.detail-category-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-status-badge {
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
}

.detail-status-badge.available {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary);
}

.detail-status-badge.unavailable {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.detail-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 0.35rem;
    line-height: 1.25;
}

.detail-author {
    font-size: 1rem;
    color: var(--gray);
    margin-bottom: 1.5rem;
}

.detail-divider {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
}

.info-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 1rem;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem 1.5rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.meta-label {
    font-size: 0.8rem;
    color: var(--gray);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-value {
    font-size: 0.95rem;
    color: var(--dark);
    font-weight: 600;
}

.detail-description {
    font-size: 0.95rem;
    line-height: 1.65;
    color: #475569;
    white-space: pre-line;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    background: #F1F5F9;
    color: var(--dark);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
}

.btn-back:hover {
    background: #E2E8F0;
    transform: translateX(-3px);
}

/* Animations */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Queries */
@media (max-width: 1024px) {
    .detail-card {
        grid-template-columns: 260px 1fr;
        gap: 2.5rem;
    }
}

@media (max-width: 768px) {
    .navbar-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .nav-search-container {
        max-width: 100%;
        order: 3;
    }

    .nav-links {
        justify-content: space-between;
        order: 2;
    }

    .carousel-container {
        height: 250px;
    }

    .carousel-content h2 {
        font-size: 1.75rem;
    }

    .carousel-content p {
        font-size: 0.95rem;
        margin-bottom: 1.25rem;
    }

    .carousel-btn {
        padding: 0.6rem 1.25rem;
        font-size: 0.85rem;
    }

    .detail-card {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1.5rem;
    }
    
    .detail-cover-wrapper {
        max-width: 240px;
        margin: 0 auto;
    }
}
