/* browse.css - Perbaikan tampilan etalase seperti Shopee */
:root {
    --primary-color: #6c63ff;
    --secondary-color: #4834d4;
    --accent-color: #ff6b6b;
    --dark-color: #333;
    --light-color: #f8f9fa;
}

.browse-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    background-color: #f5f5f5; /* Background abu-abu terang seperti Shopee */
}

.browse-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1.5rem 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 12px;
    color: white;
    position: relative;
    overflow: hidden;
}

.browse-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiPjxkZWZzPjxwYXR0ZXJuIGlkPSJwYXR0ZXJuIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHBhdHRlcm5UcmFuc2Zvcm09InJvdGF0ZSg0NSkiPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0icmdiYSgyNTUsIDI1NSwgMjU1LCAwLjA1KSIvPjwvcGF0dGVybjwvZGVmcz48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJ1cmwoI3BhdHRlcm4pIi8+PC9zdmc+');
    opacity: 0.1;
    z-index: 0;
}

.browse-header-content {
    position: relative;
    z-index: 1;
}

.browse-header h1 {
    font-size: 2rem;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.browse-header p {
    margin: 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Filter Section - Perbaikan tampilan */
.filter-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 80px; /* Menempel di bawah navbar */
    z-index: 100;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-header h2 {
    font-size: 1.5rem;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.search-box input {
    width: 100%;
    padding: 0.6rem 0.8rem 0.6rem 2.5rem;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center; /* Pusatkan tombol filter */
}

.filter-btn {
    padding: 0.6rem 1.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    background: white;
    color: #666;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(108, 99, 255, 0.15);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: var(--primary-color);
    color: white;
}

/* Works Section */
.works-section {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    font-size: 1.5rem;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-options label {
    font-weight: 600;
    color: #666;
}

.sort-options select {
    padding: 0.5rem;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: white;
    font-size: 0.9rem;
}

/* Works Grid - Perubahan utama untuk tampilan etalase */
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* Lebar kartu lebih kecil */
    gap: 1.5rem; /* Jarak antar kartu */
}

/* Work Card - Perubahan untuk tampilan seperti Shopee */
.work-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    z-index: 1; /* Pastikan kartu memiliki z-index yang tepat */
}

.work-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

/* Work Cover - Perubahan proporsi */
.work-cover-container {
    position: relative;
    width: 100%;
    padding-top: 140%; /* Rasio 1:1.4 untuk cover buku */
    background: #f8f9fa;
    overflow: hidden;
}

.work-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.work-card:hover .work-cover {
    transform: scale(1.05);
}

.work-cover-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(0, 0, 0, 0.3);
    font-size: 2.5rem;
    background: #f8f9fa;
}

/* Badges - Perbaikan posisi */
.category {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.work-type {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.work-type.paid {
    background: rgba(255, 193, 7, 0.95);
    color: #000;
}

.work-type.free {
    background: rgba(40, 167, 69, 0.95);
    color: white;
}

/* Work Content - Perubahan tata letak */
.work-content {
    padding: 1rem;
    color: #666;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    position: relative;
    z-index: 2; /* Pastikan konten memiliki z-index yang lebih tinggi */
}

.work-info {
    margin-bottom: 0.8rem;
}

.work-info h3 {
    margin: 0 0 0.4rem 0;
    font-size: 1rem;
    color: var(--dark-color);
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.work-info h3:hover {
    color: var(--primary-color);
}

.work-info span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: #666;
}

.synopsis {
    margin-bottom: 0.8rem;
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    z-index: 2; /* Pastikan sinopsis memiliki z-index yang lebih tinggi */
}

.synopsis-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
}

.synopsis-text:hover {
    color: var(--primary-color);
}

/* Work Meta - Perubahan tampilan */
.work-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    gap: 0.5rem;
    position: relative;
    z-index: 2; /* Pastikan meta memiliki z-index yang lebih tinggi */
}

.work-meta span {
    display: flex;
    align-items: center;
    color: #666;
    font-size: 0.75rem;
}

.work-meta i {
    margin-right: 0.25rem;
    font-size: 0.8rem;
}

.price {
    font-weight: 700;
    color: var(--accent-color);
    font-size: 0.9rem;
}

/* Work Actions - Perubahan tampilan tombol */
.work-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    position: relative;
    z-index: 3; /* Pastikan tombol memiliki z-index tertinggi */
}

.btn-read {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    text-decoration: none;
    flex-grow: 1;
    justify-content: center;
    position: relative;
    z-index: 4; /* Pastikan tombol baca dapat diklik */
}

.btn-read:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 99, 255, 0.25);
}

.like-btn {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #ccc;
    padding: 0.4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    position: relative;
    z-index: 4; /* Pastikan tombol like dapat diklik */
}

.like-btn:hover {
    transform: scale(1.2);
    background: rgba(255, 107, 107, 0.1);
}

.like-btn.liked {
    color: #ff6b6b;
    animation: pulse 0.5s ease;
}

/* Empty State - Perubahan tampilan */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 3.5rem;
    color: #ddd;
    margin-bottom: 1.2rem;
}

.empty-state h3 {
    font-size: 1.4rem;
    color: var(--dark-color);
    margin-bottom: 0.8rem;
}

.empty-state p {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(108, 99, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(108, 99, 255, 0.4);
}

.btn-primary i {
    margin-right: 0.5rem;
}

/* Animasi */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* PERBAIKAN: Mini Notification Styles - Notifikasi kecil dan elegan */
.mini-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    align-items: center;
    animation: slideInRight 0.3s ease;
    max-width: 300px;
    min-height: 20px;
    font-size: 0.9rem;
    border-left: 4px solid transparent;
}

.mini-notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.mini-notification i {
    font-size: 1rem;
    flex-shrink: 0;
}

.mini-notification span {
    font-size: 0.9rem;
    color: #333;
    flex-grow: 1;
}

/* Notification types */
.mini-notification-success {
    border-left-color: #28a745;
}

.mini-notification-success i {
    color: #28a745;
}

.mini-notification-error {
    border-left-color: #dc3545;
}

.mini-notification-error i {
    color: #dc3545;
}

.mini-notification-info {
    border-left-color: #17a2b8;
}

.mini-notification-info i {
    color: #17a2b8;
}

.mini-notification.fade-out {
    animation: slideOutRight 0.3s ease forwards;
}

/* Notification animations */
@keyframes slideInRight {
    from { 
        transform: translateX(100%);
        opacity: 0;
    }
    to { 
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from { 
        transform: translateX(0);
        opacity: 1;
    }
    to { 
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Notification Container */
#notification-container {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 320px;
    pointer-events: none;
    z-index: 9999;
    padding: 20px;
    box-sizing: border-box;
}

#notification-container .mini-notification {
    pointer-events: auto;
}

/* Responsive untuk notifikasi */
@media (max-width: 768px) {
    .mini-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        padding: 10px 14px;
        font-size: 0.8rem;
    }
    
    .mini-notification span {
        font-size: 0.8rem;
    }
    
    .mini-notification i {
        font-size: 0.9rem;
    }
    
    #notification-container {
        max-width: 100%;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .mini-notification {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    
    .mini-notification span {
        font-size: 0.75rem;
    }
    
    .mini-notification i {
        font-size: 0.85rem;
    }
}
.mini-notification-error {
    border-left-color: #dc3545;
}

.mini-notification-error i {
    color: #dc3545;
}

/* Popup Styles */
.synopsis-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.synopsis-popup-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    animation: popupSlideIn 0.3s ease;
    position: relative;
}

.synopsis-popup-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #6c63ff, #4834d4);
    color: white;
    border-radius: 16px 16px 0 0;
}

.synopsis-popup-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.synopsis-popup-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.synopsis-popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.synopsis-popup-body {
    padding: 25px;
    max-height: calc(85vh - 150px);
    overflow-y: auto;
    line-height: 1.7;
    color: #333;
    font-size: 1.1rem;
    text-align: justify;
}

.synopsis-popup-body::-webkit-scrollbar {
    width: 8px;
}

.synopsis-popup-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.synopsis-popup-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.synopsis-popup-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.synopsis-popup-footer {
    padding: 15px 25px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f8f9fa;
}

.synopsis-popup .btn {
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.synopsis-popup .btn-primary {
    background: linear-gradient(135deg, #6c63ff, #4834d4);
    color: white;
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

.synopsis-popup .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(108, 99, 255, 0.4);
}

.synopsis-popup .btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #ddd;
}

.synopsis-popup .btn-secondary:hover {
    background: #e9ecef;
}

@keyframes popupSlideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}



/* Responsive - Perubahan untuk mobile */
@media (max-width: 992px) {
    .works-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1.2rem;
    }
}

@media (max-width: 768px) {
    .browse-container {
        padding: 1.2rem 0.8rem;
    }
    
    .filter-section {
        position: relative;
        top: 0;
        margin-bottom: 1.5rem;
    }
    
    .works-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .work-info h3 {
        font-size: 0.9rem;
    }
    
    .synopsis-text {
        -webkit-line-clamp: 1;
        line-clamp: 1;
        font-size: 0.75rem;
    }
    
    .work-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
    
    .btn-read {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .like-btn {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    .synopsis-popup-content {
        max-width: 95%;
        margin: 10px;
    }
    
    .synopsis-popup-header h3 {
        font-size: 1.2rem;
    }
    
    .synopsis-popup-body {
        padding: 20px;
        font-size: 1rem;
    }
    
    .synopsis-popup .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .filter-options {
        justify-content: center;
    }
    
    .filter-btn {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }
    
    .works-grid {
        grid-template-columns: repeat(2, 1fr); /* Tetap 2 kolom di layar kecil */
        gap: 0.8rem;
    }
    
    .work-cover-container {
        padding-top: 140%; /* Pertahankan rasio */
    }
    
    .work-content {
        padding: 0.8rem;
    }
    
    .work-info h3 {
        font-size: 0.85rem;
    }
    
    .category, .work-type {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
        top: 0.5rem;
    }
    
    .synopsis-text {
        font-size: 0.7rem;
    }
    
    .btn-read {
        padding: 0.35rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .like-btn {
        width: 26px;
        height: 26px;
        font-size: 0.8rem;
    }
}

/* Animasi tambahan */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.work-card {
    animation: fadeInUp 0.5s ease forwards;
}