/* Advanced Filters Page Styles */

.filters-main {
    background-color: #0a0a0a;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    color: #ffffff;
    animation: fadeIn 0.5s ease-in-out;
}

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

.filters-container {
    max-width: 1200px; /* Reduce max width for better centering */
    margin: 0 auto;
    padding: 20px 20px 250px 250px; /* Increased left padding */
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Results section should take full width */
.results-section {
    width: 100%;
    max-width: none;
    align-self: stretch;
}

/* Search Header */
.search-header {
    margin-bottom: 30px;
}

.search-bar-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.main-search-input {
    width: 500px;
    height: 45px;
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 0 15px;
    color: #ffffff;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.main-search-input:focus {
    border-color: #4f87ff;
}

.main-search-input::placeholder {
    color: #666;
}

/* Advanced button styles removed */

/* Novel Cards */
.novel-card {
    background-color: #111111;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.novel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(79, 135, 255, 0.2);
    border-color: #4f87ff;
}

.novel-cover {
    position: relative;
    width: 100%;
    height: 200px;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
}

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

.cover-placeholder {
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.featured-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: #ffd700;
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.mature-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: #dc3545;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.novel-content { 
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    color: #ffffff;
    min-width: 0;
    overflow: hidden;
    gap: 0; /* removes flex gap between children */
}

.novel-content > * {
    margin: 0; /* removes default margins from child divs */
}


.novel-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
}

.novel-title a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s;
}

.novel-title a:hover {
    color: #4f87ff;
}

.novel-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    color: #999;
}

.rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

.rating svg {
    color: #ffd700;
}

.novel-synopsis {
    margin-bottom: 15px;
    flex: 1;
}

.synopsis-text {
    color: #ccc;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.novel-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.genre-tag {
    background-color: #1a1a1a;
    color: #4f87ff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    border: 1px solid #333;
}

.novel-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.read-now-btn {
    flex: 1;
    background-color: #4f87ff;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.read-now-btn:hover {
    background-color: #3d6bcc;
}

.bookmark-btn {
    background-color: #1a1a1a;
    color: #ccc;
    border: 1px solid #333;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.bookmark-btn:hover {
    background-color: #333;
    color: #fff;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 30px 0;
    width: 100%;
    grid-column: 1 / -1;
}

.page-btn {
    background-color: #1a1a1a;
    color: #ccc;
    border: 1px solid #333;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.page-btn:hover {
    background-color: #333;
    color: #fff;
}

.page-btn.active {
    background-color: #4f87ff;
    color: white;
    border-color: #4f87ff;
}

.page-ellipsis {
    color: #666;
    padding: 0 5px;
}

/* Error and No Results States */
.no-results,
.error-state {
    text-align: center;
    padding: 60px 20px;
    color: #ccc;
    grid-column: 1 / -1;
}

.no-results svg,
.error-state svg {
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results h3,
.error-state h3 {
    margin: 0 0 10px 0;
    color: #fff;
    font-size: 24px;
}

.no-results p,
.error-state p {
    margin: 0 0 20px 0;
    font-size: 16px;
}

.error-state .btn-primary {
    background-color: #4f87ff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.error-state .btn-primary:hover {
    background-color: #3d6bcc;
}

/* Loading Message */
.loading-message {
    text-align: center;
    padding: 60px 20px;
    color: #ccc;
    font-size: 18px;
    grid-column: 1 / -1;
}

/* Results Grid Layout - Horizontal Cards like Browse Page */
.results-grid {
    display: flex;
    flex-direction: column;
    gap: 1.6vw;
    width: 100%;
    max-width: 1200px;
}

@media (max-width: 600px) {
    .results-grid {
        gap: 12px;
    }
}

@media (max-width: 400px) {
    .results-grid {
        gap: 10px;
    }
}

/* Horizontal Novel Articles - Same as Browse Page */
.browse-novel-article {
    display: flex;
    background: #3c3c3c;
    border-radius: 12px;
    overflow: hidden;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    min-height: 200px;
    width: 100%;
}

.browse-novel-article:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.browse-novel-article .novel-cover {
    width: 140px;
    height: 200px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    line-height: 0;
    font-size: 0;
}

.browse-novel-article .novel-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

.browse-novel-article:hover .novel-cover img {
    transform: scale(1.05);
}

.browse-novel-article .cover-placeholder {
    color: #666;
    text-align: center;
}

.browse-novel-article .novel-content {
    flex: 1;
    padding: 1.5vw 2vw;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #ffffff;
    min-width: 0;
    overflow: hidden;
}

.browse-novel-article .novel-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.8vw;
    color: #ffffff;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    max-width: 100%;
}

.browse-novel-article .novel-meta {
    display: flex;
    align-items: center;
    gap: 1.6vw;
    margin-bottom: 1.2vw;
    font-size: 0.85rem;
    color: #b3b3b3;
    flex-wrap: wrap;
}

.browse-novel-article .rating {
    display: flex;
    align-items: center;
    gap: 0.6vw;
    color: #fbbf24;
    font-weight: 600;
}

.browse-novel-article .rating svg {
    color: #fbbf24;
    width: 16px;
    height: 16px;
    fill: #fbbf24;
}

.browse-novel-article .author {
    color: #b3b3b3;
    font-size: 0.85rem;
}

.browse-novel-article .novel-synopsis {
    margin-bottom: 1.2vw;
}

.browse-novel-article .synopsis-text {
    color: #ffffff;
    font-size: 0.9rem;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    margin: 0;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    max-width: 100%;
}

.browse-novel-article .novel-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6vw;
    margin-bottom: 1.6vw;
}

.browse-novel-article .genre-tag {
    background: transparent;
    color: #4ade80;
    padding: 0;
    border-radius: 0;
    font-size: 0.875rem;
    font-weight: 400;
    border: none;
}

.browse-novel-article .genre-tag:not(:last-child)::after {
    content: ", ";
    color: #b3b3b3;
}

.browse-novel-article .tag-tag {
    background: transparent;
    color: #4f87ff;
    padding: 0;
    border-radius: 0;
    font-size: 0.875rem;
    font-weight: 400;
    border: none;
}

.browse-novel-article .tag-tag:not(:last-child)::after {
    content: ", ";
    color: #b3b3b3;
}

.browse-novel-article .more-indicator {
    background: transparent;
    color: #888;
    padding: 0;
    border-radius: 0;
    font-size: 0.8rem;
    font-weight: 400;
    border: none;
    font-style: italic;
}

.browse-novel-article .novel-actions {
    display: flex;
    gap: 1.2vw;
    align-items: center;
    margin-bottom: 1.2vw;
}

.browse-novel-article .read-now-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #4ade80;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    flex: 1;
    justify-content: center;
    min-height: 48px;
}

.browse-novel-article .read-now-btn:hover {
    background: #22c55e;
    transform: translateY(-1px);
}

.browse-novel-article .bookmark-btn,
.browse-novel-article .reading-list-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #374151;
    color: #d1d5db;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 48px;
    min-height: 48px;
}

.browse-novel-article .bookmark-btn:hover,
.browse-novel-article .reading-list-btn:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

.browse-novel-article .bookmark-btn.bookmarked {
    background: #fbbf24;
    color: #1a1a1a;
}

.browse-novel-article .bookmark-btn.bookmarked:hover {
    background: #f59e0b;
}

.browse-novel-article .reading-list-btn {
    background: #8b5cf6;
    color: white;
}

.browse-novel-article .reading-list-btn:hover {
    background: #7c3aed;
}

.browse-novel-article .bookmark-btn:disabled,
.browse-novel-article .reading-list-btn:disabled {
    opacity: 0.6;
    transform: none;
    cursor: not-allowed;
}

/* Responsive Design for Horizontal Cards */
@media (max-width: 1024px) {
    .browse-novel-article .novel-cover {
        width: 120px;
        height: 180px;
    }
    
    .browse-novel-article .novel-content {
        padding: 12px 16px;
    }
    
    .browse-novel-article .novel-title {
        font-size: 1.125rem;
    }
}

@media (max-width: 768px) {
    .browse-novel-article {
        flex-direction: column;
        min-height: auto;
    }
    
    .browse-novel-article .novel-cover {
        width: 100%;
        height: 200px;
    }
    
    .browse-novel-article .novel-content {
        padding: 16px;
        min-width: 0;
        overflow: hidden;
    }
    
    .browse-novel-article .novel-title {
        word-wrap: break-word;
        word-break: break-word;
    }
    
    .browse-novel-article .synopsis-text {
        word-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
        overflow-wrap: break-word;
    }
    
    .browse-novel-article .novel-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .browse-novel-article .read-now-btn,
    .browse-novel-article .bookmark-btn,
    .browse-novel-article .reading-list-btn {
        width: 100%;
        justify-content: center;
        max-width: none;
        padding: 12px 16px;
        font-size: 14px;
        min-width: 0;
    }
    
    .browse-novel-article .bookmark-btn,
    .browse-novel-article .reading-list-btn {
        min-width: 48px;
        min-height: 48px;
        padding: 12px;
    }
    
    .browse-novel-article .novel-meta {
        gap: 12px;
        flex-wrap: wrap;
    }
    
    .browse-novel-article .novel-genres {
        margin-bottom: 12px;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .browse-novel-article {
        border-radius: 8px;
        margin-bottom: 12px;
        min-height: auto;
    }
    
    .browse-novel-article .novel-cover {
        height: 180px;
    }
    
    .browse-novel-article .novel-content {
        padding: 12px;
        min-width: 0;
        overflow: hidden;
    }
    
    .browse-novel-article .novel-title {
        font-size: 1rem;
        margin-bottom: 6px;
        word-wrap: break-word;
        word-break: break-word;
    }
    
    .browse-novel-article .novel-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        margin-bottom: 8px;
    }
    
    .browse-novel-article .synopsis-text {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        margin-bottom: 8px;
        word-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
        overflow-wrap: break-word;
    }
    
    .browse-novel-article .novel-genres {
        margin-bottom: 8px;
        flex-wrap: wrap;
    }
    
    .browse-novel-article .genre-tag,
    .browse-novel-article .tag-tag {
        font-size: 0.8rem;
    }
    
    .browse-novel-article .novel-actions {
        gap: 8px;
        margin-bottom: 8px;
        flex-wrap: wrap;
    }
    
    .browse-novel-article .read-now-btn,
    .browse-novel-article .bookmark-btn,
    .browse-novel-article .reading-list-btn {
        padding: 10px 12px;
        font-size: 14px;
        min-width: 0;
        flex: 1;
        min-width: 120px;
    }
    
    .browse-novel-article .bookmark-btn,
    .browse-novel-article .reading-list-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
    }
}

/* Touch-friendly improvements for mobile cards */
@media (pointer: coarse) {
    .mobile-novel-card {
        min-height: 280px;
    }
    
    .mobile-read-btn,
    .mobile-bookmark-btn,
    .mobile-reading-list-btn {
        min-height: 44px; /* iOS recommended touch target */
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .mobile-novel-card,
    .mobile-novel-card:active,
    .mobile-novel-cover img,
    .mobile-novel-card:hover .mobile-novel-cover img,
    .mobile-read-btn:hover,
    .mobile-bookmark-btn:hover {
        transition: none;
        transform: none;
    }
}

@media (max-width: 480px) {
    .novel-card {
        padding: 15px;
    }
    
    .novel-cover {
        height: 150px;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
    
    .page-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}
.filters-layout {
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: flex-start;
    width: 100%;
}

.main-filters {
    width: 100%;
    display: flex;
    justify-content: center;
}

.advanced-filters {
    background-color: #111111;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid #222;
    width: 100%;
    max-width: 1000px;
}

/* Side Selection Panels */
.side-selection-panels {
    width: 250px;
    position: static;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Genre and Events Wrapper with Shared Panels */
.genre-events-wrapper {
    margin: 30px 0 0;
    background-color: #111111;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #222;
    width: 100%;
    max-width: 1200px;
}

.genre-events-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap; /* Allow wrapping when content is too wide */
}

/* Ensure proper spacing when content wraps */
.genre-events-container > * {
    margin-bottom: 20px;
}

.genre-events-container > *:last-child {
    margin-bottom: 0;
}

.tags-sections-container {
    flex: 1;
    width: 100%;
    max-width: none;
    min-width: 0; /* Allow shrinking */
}

/* Individual Genre Section Wrappers within the container */
.tags-sections-container .genre-section-wrapper {
    background-color: #0f0f0f;
    border: 1px solid #222;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.tags-sections-container .genre-section-wrapper:last-child {
    margin-bottom: 0;
}

/* Shared Selection Panels on the Right */
.shared-selection-panels {
    width: 250px;
    min-width: 250px; /* Ensure minimum width when wrapping */
    flex-shrink: 0;
    position: relative; /* Change to relative positioning for natural flow */
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: calc(100vh - 300px);
    z-index: 10;
    align-self: flex-start; /* Prevent stretching */
}

/* Mobile Selection Panel - Hidden by default */
.mobile-selection-panel {
    display: none;
}

/* Including and Excluding Sections - Compact Version */
.selection-section {
    background-color: #0f0f0f;
    border: 1px solid #333; /* More visible border */
    border-radius: 8px;
    padding: 12px;
    min-height: 120px; /* Ensure minimum height */
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); /* Add shadow for better visibility */
}

.selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.selection-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.selection-count {
    background-color: #1a1a1a;
    color: #888;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.selection-content {
    min-height: 60px; /* Increase minimum height */
    max-height: 200px;
    overflow-y: auto;
    flex: 1; /* Take remaining space */
}

.selection-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 50px; /* Ensure consistent minimum height */
}

.empty-state {
    width: 100%;
    text-align: center;
    padding: 15px 10px;
    color: #666;
}

.empty-state small {
    font-size: 11px;
    color: #555;
}

.selection-item {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 4px 8px;
    color: #ccc;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s;
}

.selection-item.including {
    border-color: #4f87ff;
    background-color: rgba(79, 135, 255, 0.1);
    color: #4f87ff;
}

.selection-item.excluding {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.selection-item .remove-btn {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 2px;
    transition: background-color 0.3s;
    margin-left: 8px;
}

.selection-item .remove-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.selection-item .item-name {
    flex: 1;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.selection-item .item-type {
    font-size: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #999;
    padding: 2px 6px;
    border-radius: 3px;
    margin: 0 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Section styling variations */
.including-section {
    border-left: 3px solid #4f87ff;
}

.excluding-section {
    border-left: 3px solid #dc3545;
}

/* Filter Row */
.filter-row {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-label {
    color: #ccc;
    font-size: 14px;
    font-weight: 500;
}

.filter-select {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 10px 15px;
    color: #ffffff;
    font-size: 14px;
    min-width: 120px;
    outline: none;
    cursor: pointer;
}

.filter-select:focus {
    border-color: #4f87ff;
}

/* Category Tags */
.category-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.category-tag {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.category-tag.original {
    background-color: #28a745;
    color: white;
}

.category-tag.translation {
    background-color: #007bff;
    color: white;
}

.category-tag.adaptation {
    background-color: #fd7e14;
    color: white;
}

.category-tag.fan-fiction {
    background-color: #6f42c1;
    color: white;
}

.category-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.category-tag.active {
    box-shadow: 0 0 0 2px #4f87ff;
    transform: scale(1.05);
}

/* Filter Sections Grid */
.filter-sections {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

/* Status and Platform select styling */
.status-select,
.platform-select {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 10px 15px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    width: 100%;
}

.status-select:focus,
.platform-select:focus {
    border-color: #4f87ff;
}

.filter-section {
    background-color: #0f0f0f;
    border: 1px solid #222;
    border-radius: 8px;
    padding: 15px;
}

.section-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.filter-input-container {
    position: relative;
}

.filter-input {
    width: 100%;
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 10px 15px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.filter-input:focus {
    border-color: #4f87ff;
}

.filter-input::placeholder {
    color: #666;
}

/* Tags Section */
.tags-section {
    background-color: #0f0f0f;
    border: 1px solid #222;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    width: 100%;
    box-sizing: border-box;
}

.tags-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Tags Search Bar */
.tags-search {
    margin-bottom: 20px;
}

.tags-search-input {
    width: 100%;
    height: 40px;
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 0 12px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.tags-search-input:focus {
    border-color: #4a9eff;
}

.tags-search-input::placeholder {
    color: #888;
}

.tag-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tag-count {
    color: #888;
    font-size: 14px;
}

.tag-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #ccc;
}

.tag-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 40px;
    height: 20px;
    background-color: #333;
    border-radius: 10px;
    position: relative;
    transition: background-color 0.3s;
}

.toggle-slider::after {
    content: '';
    width: 16px;
    height: 16px;
    background-color: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.tag-toggle input[type="checkbox"]:checked + .toggle-slider {
    background-color: #4f87ff;
}

.tag-toggle input[type="checkbox"]:checked + .toggle-slider::after {
    transform: translateX(20px);
}

/* Tags Grid */
.tags-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
    width: 100%;
    max-height: 400px; /* Fixed height for scrollable container */
    overflow-y: auto; /* Enable vertical scrolling */
    padding-right: 10px; /* Space for scrollbar */
    border: 1px solid #333; /* Subtle border */
    border-radius: 8px; /* Rounded corners */
    background-color: #0f0f0f; /* Slightly different background */
    padding: 20px 20px 20px 20px; /* Add padding around content */
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3); /* Inner shadow for depth */
}

/* Custom scrollbar styling */
.tags-grid::-webkit-scrollbar {
    width: 8px;
}

.tags-grid::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

.tags-grid::-webkit-scrollbar-thumb {
    background: #4f87ff;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.tags-grid::-webkit-scrollbar-thumb:hover {
    background: #3d6bcc;
}

/* Firefox scrollbar */
.tags-grid {
    scrollbar-width: thin;
    scrollbar-color: #4f87ff #1a1a1a;
}

.tags-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tag-item {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 8px 12px;
    color: #ccc;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.tag-item:hover {
    background-color: #222;
    border-color: #4f87ff;
    color: #ffffff;
}

.tag-item.selected {
    background-color: #4f87ff;
    border-color: #4f87ff;
    color: #ffffff;
    position: relative;
}

.tag-item.selected::after {
    content: '✓';
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    font-weight: bold;
}

.tag-item.excluded {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #ffffff;
    position: relative;
}

.tag-item.excluded::after {
    content: '✕';
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    font-weight: bold;
}

.genre-count {
    font-size: 11px;
    color: #888;
    margin-left: 4px;
    font-weight: normal;
}

/* Including and Excluding Sections */
.selection-section {
    background-color: #0f0f0f;
    border: 1px solid #222;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.selection-count {
    color: #888;
    font-size: 14px;
}

.selection-content {
    min-height: 60px;
}

.selection-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
}

.empty-state {
    width: 100%;
    text-align: center;
    padding: 20px;
    color: #666;
}

.empty-state p {
    margin: 0 0 5px 0;
    font-size: 14px;
}

.empty-state small {
    font-size: 12px;
    color: #555;
}

.selection-item {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 6px 12px;
    color: #ccc;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.selection-item.including {
    border-color: #4f87ff;
    background-color: rgba(79, 135, 255, 0.1);
    color: #4f87ff;
}

.selection-item.excluding {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.selection-item .remove-btn {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 12px;
    padding: 2px;
    border-radius: 2px;
    transition: background-color 0.3s;
}

.selection-item .remove-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.selection-item .item-type {
    font-size: 10px;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Section styling variations */
.including-section {
    border-left: 3px solid #4f87ff;
}

.excluding-section {
    border-left: 3px solid #dc3545;
}

.tag-controls-bottom {
    display: flex;
    justify-content: flex-end;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.btn-search,
.btn-reset {
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn-search {
    background-color: #4f87ff;
    color: white;
}

.btn-search:hover {
    background-color: #3d6bcc;
    transform: translateY(-1px);
}

.btn-reset {
    background-color: #333;
    color: #ccc;
}

.btn-reset:hover {
    background-color: #444;
    color: #fff;
}

/* Results Section */
.results-section {
    background-color: #111111;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #222;
    margin: 30px 0 0;
    width: 100%;
    max-width: 1200px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-title {
    color: #ffffff;
    font-size: 24px;
    font-weight: 600;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sort-label {
    color: #ccc;
    font-size: 14px;
}

.sort-select {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 8px 12px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    cursor: pointer;
}

.sort-select:focus {
    border-color: #4f87ff;
}

.view-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-text {
    color: #ccc;
    font-size: 14px;
}

.view-btn {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 6px 10px;
    color: #ccc;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.view-btn:hover {
    background-color: #222;
    border-color: #4f87ff;
    color: #fff;
}

.view-btn.active {
    background-color: #4f87ff;
    border-color: #4f87ff;
    color: #ffffff;
}

/* Results Grid - Browse Style */
.results-grid {
    display: flex;
    flex-direction: column;
    gap: 1.6vw;
    padding: 2vw 0;
    min-height: 200px;
}

.loading-message {
    color: #666;
    font-size: 16px;
    font-style: italic;
    text-align: center;
    margin: 40px 0;
}

/* Horizontal novel article layout - copied from browse.css */
.browse-novel-article {
    display: flex;
    background: #3c3c3c;
    border-radius: 12px;
    overflow: hidden;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    min-height: 200px;
    width: 100%;
}

.browse-novel-article:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.browse-novel-article .novel-cover {
    width: 140px;
    height: 200px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    line-height: 0;
    font-size: 0;
}

.browse-novel-article .novel-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

.browse-novel-article:hover .novel-cover img {
    transform: scale(1.05);
}

.browse-novel-article .cover-placeholder {
    color: #666;
    text-align: center;
}

.browse-novel-article .novel-content {
    flex: 1;
    padding: 1.5vw 2vw;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #ffffff;
    min-width: 0;
    overflow: hidden;
}

.browse-novel-article .novel-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.8vw;
    color: #ffffff;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    max-width: 100%;
}

.browse-novel-article .novel-meta {
    display: flex;
    align-items: center;
    gap: 1.6vw;
    margin-bottom: 1.2vw;
    font-size: 0.85rem;
    color: #b3b3b3;
    flex-wrap: wrap;
}

.browse-novel-article .rating {
    display: flex;
    align-items: center;
    gap: 0.6vw;
    color: #fbbf24;
    font-weight: 600;
}

.browse-novel-article .rating svg {
    color: #fbbf24;
    width: 16px;
    height: 16px;
    fill: #fbbf24;
}

.browse-novel-article .author {
    color: #b3b3b3;
    font-size: 0.85rem;
}

.browse-novel-article .status-badge {
    padding: 0;
    border-radius: 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: none;
    border: none;
    color: #b3b3b3;
}

.browse-novel-article .novel-synopsis {
    margin-bottom: 1.2vw;
}

.browse-novel-article .synopsis-text {
    color: #ffffff;
    font-size: 0.9rem;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    margin: 0;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    max-width: 100%;
}

.browse-novel-article .novel-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6vw;
    margin-bottom: 1.6vw;
}

.browse-novel-article .genre-tag {
    background: transparent;
    color: #b3b3b3;
    padding: 0;
    border-radius: 0;
    font-size: 0.875rem;
    font-weight: 400;
    border: none;
}

.browse-novel-article .genre-tag:not(:last-child)::after {
    content: ", ";
    color: #b3b3b3;
}

.browse-novel-article .tag-tag {
    background: transparent;
    color: #8b5cf6;
    padding: 0;
    border-radius: 0;
    font-size: 0.875rem;
    font-weight: 400;
    border: none;
}

.browse-novel-article .tag-tag:not(:last-child)::after {
    content: ", ";
    color: #8b5cf6;
}

.browse-novel-article .more-indicator {
    color: #888;
    font-size: 0.8rem;
    font-style: italic;
}

.browse-novel-article .novel-actions {
    display: flex;
    gap: 1.2vw;
    align-items: center;
    margin-bottom: 1.2vw;
}

.browse-novel-article .read-now-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #4ade80;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    flex: 1;
    justify-content: center;
    min-height: 48px;
}

.browse-novel-article .read-now-btn:hover {
    background: #22c55e;
    transform: translateY(-1px);
}

.browse-novel-article .bookmark-btn,
.browse-novel-article .reading-list-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #374151;
    color: #d1d5db;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 48px;
    min-height: 48px;
}

.browse-novel-article .bookmark-btn:hover,
.browse-novel-article .reading-list-btn:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

.browse-novel-article .bookmark-btn.bookmarked {
    background: #fbbf24;
    color: #1a1a1a;
}

.browse-novel-article .bookmark-btn.bookmarked:hover {
    background: #f59e0b;
}

.browse-novel-article .reading-list-btn {
    background: #8b5cf6;
    color: white;
}

.browse-novel-article .reading-list-btn:hover {
    background: #7c3aed;
}

.browse-novel-article .bookmark-btn:disabled,
.browse-novel-article .reading-list-btn:disabled {
    opacity: 0.6;
    transform: none;
    cursor: not-allowed;
}

/* No Results State */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.no-results svg {
    margin-bottom: 20px;
    color: #666;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #fff;
}

.no-results p {
    font-size: 1rem;
    color: #888;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 60px 20px;
    color: #dc3545;
}

.error-state svg {
    margin-bottom: 20px;
    color: #dc3545;
}

.error-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #dc3545;
}

.error-state p {
    font-size: 1rem;
    color: #888;
    margin-bottom: 20px;
}

.error-state .btn-primary {
    background: #4f87ff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.error-state .btn-primary:hover {
    background: #3d6bcc;
    transform: translateY(-1px);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    padding: 20px 0;
}

.page-btn {
    background: #374151;
    color: #d1d5db;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.page-btn:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

.page-btn.current {
    background: #4f87ff;
    color: white;
}

.page-ellipsis {
    color: #888;
    padding: 0 8px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .filter-sections {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tags-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .side-selection-panels {
        width: 220px;
    }
    
    .genre-section-container .side-selection-panels {
        width: 220px;
    }
}

/* Mobile responsive adjustments */
@media (max-width: 1200px) {
    .shared-selection-panels {
        position: relative; /* Fall back to relative positioning on smaller screens */
        right: auto;
        top: auto;
        margin-top: 20px;
    }
    
    .tags-sections-container {
        margin-right: 0; /* Remove margin on smaller screens */
    }
    
    .genre-events-container {
        flex-direction: column; /* Stack vertically on smaller screens */
    }
    

}

@media (max-width: 768px) {
    .filters-container {
        padding: 15px;
        padding-bottom: 20px; /* Reduced since panels are no longer fixed */
    }
    
    .filters-layout {
        flex-direction: column;
    }
    
    /* Mobile layout for genre-events container */
    .genre-events-container {
        flex-direction: column;
    }
    
    /* Make genre and event sections wider on mobile */
    .genre-events-wrapper {
        margin: 20px -15px; /* Extend to screen edges */
        border-radius: 0;
    }
    
    .tags-sections-container .genre-section-wrapper {
        margin: 0 0 20px 0;
        border-radius: 0;
        padding: 20px 15px;
    }
    
    .tags-section {
        max-height: 400px; /* Limit height */
        overflow-y: auto; /* Make scrollable */
    }
    
    .tags-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        max-height: 300px;
        overflow-y: auto;
        padding: 15px 15px 15px 15px; /* Adjust padding for mobile */
        padding-right: 20px; /* Extra space for scrollbar on mobile */
    }
    
    /* Custom scrollbar for mobile */
    .tags-grid::-webkit-scrollbar {
        width: 6px;
    }
    
    .tags-grid::-webkit-scrollbar-track {
        background: #1a1a1a;
        border-radius: 3px;
    }
    
    .tags-grid::-webkit-scrollbar-thumb {
        background: #444;
        border-radius: 3px;
    }
    
    .tags-grid::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
    
    /* Improve tag items on mobile */
    .tag-item {
        padding: 12px 15px;
        margin-bottom: 8px;
        font-size: 16px; /* Larger touch targets */
    }
    
    .tags-sections-container {
        margin-right: 0; /* Remove margin on smaller screens */
    }
    
    /* Hide shared selection panels on mobile */
    .shared-selection-panels {
        display: none;
    }
    
    /* Show mobile unified selection panel below the genre/events sections */
    .mobile-selection-panel {
        position: static !important;
        background-color: #111111;
        border: 1px solid #222;
        border-radius: 8px;
        padding: 15px;
        margin: 20px -15px;
        display: flex !important;
        flex-direction: column;
        gap: 15px;
        z-index: auto;
        max-height: none;
        overflow: visible;
    }
    
    .mobile-selection-panel .selection-section {
        flex: none;
        min-width: auto;
        margin-bottom: 15px;
    }
    
    .mobile-selection-panel .selection-section:last-child {
        margin-bottom: 0;
    }
    
    .selection-section {
        flex: 1;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-sections {
        grid-template-columns: 1fr;
    }
    
    .tags-grid {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sort-controls {
        justify-content: space-between;
    }
    
    .main-search-input {
        width: 100%;
        max-width: 400px;
    }
    
    .search-bar-container {
        flex-direction: column;
        gap: 10px;
    }
    
    /* Mobile responsive for browse novel articles */
    .browse-novel-article {
        flex-direction: column;
        min-height: auto;
    }
    
    .browse-novel-article .novel-cover {
        width: 100%;
        height: 200px;
    }
    
    .browse-novel-article .novel-content {
        padding: 16px;
        min-width: 0;
        overflow: hidden;
    }
    
    .browse-novel-article .novel-title {
        word-wrap: break-word;
        word-break: break-word;
    }
    
    .browse-novel-article .synopsis-text {
        word-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
        overflow-wrap: break-word;
    }
    
    .browse-novel-article .novel-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .browse-novel-article .read-now-btn,
    .browse-novel-article .bookmark-btn,
    .browse-novel-article .reading-list-btn {
        width: 100%;
        justify-content: center;
        max-width: none;
        padding: 12px 16px;
        font-size: 14px;
        min-width: 0;
    }
    
    .browse-novel-article .bookmark-btn,
    .browse-novel-article .reading-list-btn {
        min-width: 48px;
        min-height: 48px;
        padding: 12px;
    }
    
    .browse-novel-article .novel-meta {
        gap: 12px;
        flex-wrap: wrap;
    }
    
    .browse-novel-article .novel-genres {
        margin-bottom: 12px;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .advanced-filters,
    .results-section {
        padding: 15px;
    }
    
    .category-tags {
        justify-content: center;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-search,
    .btn-reset {
        width: 100%;
    }
    
    /* Mobile phone styles for browse novel articles */
    .browse-novel-article {
        border-radius: 8px;
        margin-bottom: 12px;
        min-height: auto;
    }
    
    .browse-novel-article .novel-cover {
        height: 180px;
    }
    
    .browse-novel-article .novel-content {
        padding: 12px;
        min-width: 0;
        overflow: hidden;
    }
    
    .browse-novel-article .novel-title {
        font-size: 1rem;
        margin-bottom: 6px;
        word-wrap: break-word;
        word-break: break-word;
    }
    
    .browse-novel-article .novel-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        margin-bottom: 8px;
    }
    
    .browse-novel-article .synopsis-text {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        margin-bottom: 8px;
        word-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
        overflow-wrap: break-word;
    }
    
    .browse-novel-article .novel-genres {
        margin-bottom: 8px;
        flex-wrap: wrap;
    }
    
    .browse-novel-article .genre-tag,
    .browse-novel-article .tag-tag {
        font-size: 0.8rem;
    }
    
    .browse-novel-article .novel-actions {
        gap: 8px;
        margin-bottom: 8px;
        flex-wrap: wrap;
    }
    
    .browse-novel-article .read-now-btn,
    .browse-novel-article .bookmark-btn,
    .browse-novel-article .reading-list-btn {
        padding: 10px 12px;
        font-size: 14px;
        min-width: 0;
        flex: 1;
        min-width: 120px;
    }
    
    .browse-novel-article .bookmark-btn,
    .browse-novel-article .reading-list-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
    
    .page-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}



/* Touch-friendly improvements for mobile */
@media (max-width: 768px) {
    .browse-novel-article .read-now-btn,
    .browse-novel-article .bookmark-btn,
    .browse-novel-article .reading-list-btn {
        min-height: 44px; /* iOS recommended touch target size */
    }
}

/* Landscape orientation for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .browse-novel-article {
        flex-direction: row;
        min-height: 120px;
    }
    
    .browse-novel-article .novel-cover {
        width: 100px;
        height: 120px;
    }
    
    .browse-novel-article .novel-content {
        padding: 12px;
        min-width: 0;
        overflow: hidden;
    }
    
    .browse-novel-article .novel-title {
        font-size: 0.95rem;
        -webkit-line-clamp: 1;
        line-clamp: 1;
        word-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
        overflow-wrap: break-word;
    }
    
    .browse-novel-article .synopsis-text {
        -webkit-line-clamp: 2;
        line-clamp: 2;
        margin-bottom: 6px;
        word-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
        overflow-wrap: break-word;
    }
    
    .browse-novel-article .novel-actions {
        flex-direction: row;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .browse-novel-article .read-now-btn,
    .browse-novel-article .bookmark-btn,
    .browse-novel-article .reading-list-btn {
        width: auto;
        padding: 6px 10px;
        font-size: 12px;
        min-width: 0;
        flex: 1;
        min-width: 80px;
    }
    
    .browse-novel-article .bookmark-btn,
    .browse-novel-article .reading-list-btn {
        min-width: 44px;
        padding: 6px;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .browse-novel-article,
    .browse-novel-article:hover,
    .browse-novel-article .novel-cover img,
    .browse-novel-article:hover .novel-cover img,
    .browse-novel-article .read-now-btn:hover,
    .browse-novel-article .bookmark-btn:hover,
    .browse-novel-article .reading-list-btn:hover {
        transition: none;
        transform: none;
    }
}

/* Focus states for accessibility */
.browse-novel-article:focus-within {
    outline: 2px solid #4ade80;
    outline-offset: 2px;
}

.browse-novel-article .read-now-btn:focus,
.browse-novel-article .bookmark-btn:focus,
.browse-novel-article .reading-list-btn:focus {
    outline: 2px solid #4ade80;
    outline-offset: 2px;
}

/* Enhanced Filter Sections */
.filter-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    align-items: start;
}

.filter-section {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.filter-section:hover {
    border-color: #4f87ff;
    box-shadow: 0 4px 20px rgba(79, 135, 255, 0.1);
}

.filter-section .section-title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-input-container {
    position: relative;
}

.filter-input {
    width: 100%;
    height: 40px;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 0 12px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.filter-input:focus {
    border-color: #4f87ff;
    box-shadow: 0 0 0 2px rgba(79, 135, 255, 0.2);
}

.filter-input::placeholder {
    color: #666;
}

/* Filter Suggestions */
.filter-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.filter-suggestions.show {
    display: block;
}

.suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #333;
    transition: background-color 0.2s;
}

.suggestion-item:hover {
    background-color: #4f87ff;
    color: white;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Filter Checkboxes */
.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #ffffff;
    transition: color 0.2s;
}

.checkbox-label:hover {
    color: #4f87ff;
}

.filter-checkbox {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    background-color: #2a2a2a;
    border: 2px solid #444;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s;
}

.filter-checkbox:checked + .checkmark {
    background-color: #4f87ff;
    border-color: #4f87ff;
}

.filter-checkbox:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Enhanced Tag Styling */
.tag-item {
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tag-item:hover {
    border-color: #4f87ff;
    background-color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 135, 255, 0.2);
}

.tag-item.selected {
    background-color: #4f87ff;
    border-color: #4f87ff;
    color: white;
}

.tag-item.excluded {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.tag-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tag-name {
    font-weight: 500;
    font-size: 14px;
}

.tag-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    opacity: 0.8;
}

.genre-count {
    color: #888;
}



/* Enhanced Selection Sections */
.selection-section {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.selection-count {
    background-color: #4f87ff;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.selection-grid {
    display: grid;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.selection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    transition: all 0.2s;
}

.selection-item.including {
    border-left: 4px solid #4f87ff;
}

.selection-item.excluding {
    border-left: 4px solid #dc3545;
}

.selection-item:hover {
    background-color: #333;
}

.item-name {
    font-weight: 500;
    color: #ffffff;
}

.item-type {
    background-color: #555;
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    text-transform: uppercase;
}

.remove-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 16px;
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    transition: all 0.2s;
}

.remove-btn:hover {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

/* Enhanced Results Section */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background-color: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #333;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sort-label {
    font-size: 14px;
    color: #888;
}

.view-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.view-text {
    font-size: 14px;
    color: #888;
}

.view-btn {
    background-color: #2a2a2a;
    border: 1px solid #444;
    color: #888;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.view-btn:hover {
    border-color: #4f87ff;
    color: #4f87ff;
}

.view-btn.active {
    background-color: #4f87ff;
    border-color: #4f87ff;
    color: white;
}

/* Loading and Error States */
.loading-message {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 16px;
}

.error-state {
    text-align: center;
    padding: 40px;
    color: #dc3545;
}

.error-state svg {
    margin-bottom: 20px;
    color: #dc3545;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filter-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .filter-section {
        padding: 15px;
    }
    
    .results-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .sort-controls {
        justify-content: space-between;
    }
    
    .tag-meta {
        flex-direction: column;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .filters-container {
        padding: 15px;
    }
    
    .main-search-input {
        width: 100%;
        max-width: 300px;
    }
    
    .filter-sections {
        gap: 15px;
    }
    
    .tag-item {
        padding: 10px;
    }
    
    .selection-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Genre Search Bar Styles */
.genre-search-container {
    margin: 15px 0;
    padding: 0 5px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 0 12px;
    transition: border-color 0.3s ease;
}

.search-input-wrapper:focus-within {
    border-color: #4f87ff;
    box-shadow: 0 0 0 2px rgba(79, 135, 255, 0.1);
}

.genre-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 14px;
    padding: 12px 0;
    width: 100%;
}

.genre-search-input::placeholder {
    color: #666;
}

.clear-search-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: 8px;
    flex-shrink: 0;
}

.clear-search-btn:hover {
    background-color: #333;
    color: #ffffff;
}

.clear-search-btn:active {
    transform: scale(0.95);
}

/* Hide/show genres based on search */
.tag-item.hidden {
    display: none !important;
}

/* Search results indicator */
.search-results-info {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
    padding: 0 5px;
}

.search-results-info .highlight {
    color: #4f87ff;
    font-weight: 500;
}

/* Collection Modal Styles */
.collection-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in-out;
}

.collection-modal-content {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.collection-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #333;
}

.collection-modal-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 18px;
}

.close-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background-color: #333;
    color: #ffffff;
}

.collection-modal-body {
    padding: 20px;
}

.collection-modal-body p {
    margin: 0 0 20px 0;
    color: #ccc;
    font-size: 14px;
}

.collections-list {
    margin-bottom: 20px;
}

.collection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #222;
    border: 1px solid #333;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.collection-item:hover {
    background-color: #333;
    border-color: #4f87ff;
}

.collection-item:last-child {
    margin-bottom: 0;
}

.collection-name {
    font-weight: 500;
    color: #ffffff;
}

.collection-count {
    font-size: 12px;
    color: #666;
    background-color: #1a1a1a;
    padding: 4px 8px;
    border-radius: 4px;
}

.collection-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-secondary {
    background-color: #333;
    border: 1px solid #555;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background-color: #444;
    border-color: #666;
}

/* Bookmark button styles */
.bookmark-btn {
    background-color: #333;
    border: 1px solid #555;
    color: #ffffff;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bookmark-btn:hover {
    background-color: #444;
    border-color: #666;
}

.bookmark-btn.bookmarked {
    background-color: #4f87ff;
    border-color: #4f87ff;
    color: #ffffff;
}

.bookmark-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Reading list button styles */
.reading-list-btn {
    background-color: #333;
    border: 1px solid #555;
    color: #ffffff;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reading-list-btn:hover {
    background-color: #444;
    border-color: #666;
}

.reading-list-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
