/* Dynamic Components CSS - Extracted from app.js */

/* Genre Navigation Styles */
.genre-navigation {
    margin: 20px 0;
    padding: 1.5rem;
    background: #12121200;
    border-radius: 16px;
    box-shadow: none;
    border: 0px solid var(--border-color);
    transition: all 0.3s ease;
}

.genre-title {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
    color: var(--header-color);
    font-weight: 600;
    position: relative;
    padding-bottom: 0.75rem;
}

.genre-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
}

.genre-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.genre-pill {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-radius: 24px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    letter-spacing: 0.01em;
}

.genre-pill:hover {
    background: rgba(var(--primary-rgb), 0.18);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: rgba(var(--primary-rgb), 0.25);
}

.genre-pill:active {
    transform: translateY(-1px);
}

.genre-count {
    margin-left: 10px;
    background: rgba(var(--primary-rgb), 0.2);
    border-radius: 16px;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
}

.genre-pill.selected {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.35);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.genre-pill.selected .genre-count {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

/* Genre View Styles */
.genre-view {
    padding: 1.5rem;
}

.genre-view-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 12px;
}

.genre-view-title {
    font-size: 1.5rem;
    color: white;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.genre-count-large {
    margin-left: auto;
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.9rem;
}

.back-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(0,0,0,0.4);
    border-radius: 999px;
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-button:hover {
    background: rgba(0,0,0,0.6);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

.back-icon::before {
    content: "←";
    margin-right: 4px;
}

.audiobooks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.book-card {
    background: var(--card-background);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.15);
}

.book-card-cover {
    height: 160px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.card-badge {
    position: absolute;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
}

.audio-badge {
    top: 10px;
    left: 10px;
    background: var(--accent-color);
}

.duration-badge {
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
}

.book-card-details {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-card-title {
    margin: 0 0 8px 0;
    font-size: 0.95rem;
    color: var(--text-color);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-card-author {
    margin: 0;
    font-size: 0.85rem;
    color: var(--secondary-text);
    font-weight: 500;
}

/* Genre Grid Styles */
.genre-books-grid-card {
    background: var(--card-background);
    border-radius: 0px;
    padding: 1.5rem;
    margin-bottom: 1.2rem;
    box-shadow: none;
    border: 0px solid var(--border-color);
    transition: all 0.3s ease;
}

.genre-grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.genre-grid-title-area {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.genre-grid-title {
    font-size: 1.5rem;
    margin: 0;
    color: var(--header-color);
}

.genre-count-badge {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Horizontal scrolling container */
.books-grid-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.books-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 10px 0;
    gap: 16px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.books-grid::-webkit-scrollbar {
    display: none;
}

/* Scroll buttons */
.scroll-button {
    position: absolute;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-background);
    color: var(--primary-color);
    border: 1px solid rgba(var(--primary-rgb), 0.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.9;
}

.scroll-button:hover {
    background: rgba(var(--primary-rgb), 0.1);
    transform: scale(1.1);
    opacity: 1;
}

.scroll-button.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
}

.scroll-left {
    left: -10px;
}

.scroll-right {
    right: -10px;
}

.arrow-left-icon, .arrow-right-icon {
    font-size: 1.2rem;
    font-weight: 700;
}

.book-grid-item {
    flex: 0 0 180px;
    background: rgba(var(--card-background-rgb), 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.book-grid-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.1);
}

.book-grid-cover {
    height: 120px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.book-grid-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.75);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.book-grid-details {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-grid-title {
    margin: 0 0 6px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.book-grid-author {
    margin: 0;
    font-size: 0.8rem;
    color: var(--secondary-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Search Results Styles */
.search-results-card {
    margin: 20px 0;
    padding: 1.5rem;
    background: var(--card-background);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.search-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 12px;
}

.search-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-title {
    font-size: 1.5rem;
    color: var(--header-color);
    margin: 0;
    font-weight: 600;
}

.results-count {
    color: var(--secondary-text);
    font-size: 0.9rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 1.5rem;
}

.pagination-button {
    padding: 8px 16px;
    background: rgba(var(--primary-rgb), 0.1);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 999px;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination-button:hover:not([disabled]) {
    background: rgba(var(--primary-rgb), 0.2);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.pagination-button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-indicator {
    color: var(--secondary-text);
    font-size: 0.9rem;
}

.prev-icon::before {
    content: "←";
}

.next-icon::before {
    content: "→";
}

.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.no-results h3 {
    margin: 1rem 0 0.5rem;
    color: var(--header-color);
}

.no-results p {
    color: var(--secondary-text);
    margin-bottom: 1.5rem;
}

.search-icon {
    display: inline-block;
    width: 60px;
    height: 60px;
    background-color: rgba(var(--primary-rgb), 0.1);
    border-radius: 50%;
    position: relative;
}

.search-icon::before {
    content: "🔍";
    font-size: 2rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

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

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

/* Mobile Responsive Styles */
@media (min-width: 1024px) {
    .genre-list {
        gap: 14px;
    }
    
    .genre-pill {
        padding: 13px 22px;
        font-size: 1rem;
    }
    
    .genre-count {
        padding: 4px 13px;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .genre-navigation {
        padding: 1.25rem;
    }
    
    .genre-pill {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    .audiobooks-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }
    
    .genre-view {
        padding: 1rem;
    }
    
    .genre-view-header {
        margin-bottom: 1rem;
    }
    
    .genre-view-title {
        font-size: 1.25rem;
    }
    
    .genre-books-grid-card {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .genre-grid-title {
        font-size: 1.25rem;
    }
    
    .book-grid-item {
        flex: 0 0 140px;
    }
    
    .book-grid-cover {
        height: 100px;
    }
    
    .scroll-button {
        width: 36px;
        height: 36px;
    }
    
    .arrow-left-icon, .arrow-right-icon {
        font-size: 1rem;
    }
    
    .search-results-card {
        padding: 1rem;
    }
    
    .search-title {
        font-size: 1.25rem;
    }
    
    .pagination-button {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}
