/* CSS tùy chỉnh cho trang web truyện */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
}

/* Smooth transitions */
* {
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dark ::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Story card hover effects */
.story-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.story-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.dark .story-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

/* Banner carousel */
.banner-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.banner-slide {
    display: none;
    animation: fadeIn 0.5s;
}

.banner-slide.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Category badge */
.category-badge {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border-radius: 12px;
    font-size: 0.75rem;
    margin-right: 4px;
}

.dark .category-badge {
    background: rgba(37, 99, 235, 0.2);
}

/* Status badge */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-ongoing {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary-color);
}

.status-completed {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.status-paused {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

/* Dropdown menu */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
    z-index: 50;
    margin-top: 8px;
}

.dark .dropdown-menu {
    background: #1e293b;
    border-color: #334155;
}

.dropdown:hover .dropdown-menu,
.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mobile menu */
.mobile-menu {
    display: none;
}

@media (max-width: 768px) {
    .mobile-menu {
        display: block;
    }
    
    .desktop-menu {
        display: none;
    }
}

/* Reading controls */
.reading-controls {
    position: sticky;
    top: 70px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    z-index: 30;
    margin-bottom: 20px;
}

.dark .reading-controls {
    background: #1e293b;
    border-color: #334155;
}

/* Chapter list grid */
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Text selection for reading */
.reading-content {
    user-select: text;
    -webkit-user-select: text;
}

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
}

/* Custom button styles */
.btn-primary {
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* Sidebar */
.sidebar {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.dark .sidebar {
    background: #1e293b;
}

/* Responsive improvements */
@media (max-width: 1024px) {
    .sidebar {
        max-height: none;
    }
}

/* Chapter content styling */
#chapterContent {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !important;
    line-height: 2;
    font-size: 1.125rem;
    color: #1e293b !important;
    background-color: white !important;
    padding: 20px;
    border-radius: 8px;
    min-height: 200px;
}

.dark #chapterContent {
    color: #e2e8f0 !important;
    background-color: #1e293b !important;
}

/* Banner gradient */
.banner-carousel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Story card image overlay on hover */
.story-card img {
    transition: transform 0.3s ease;
}

.story-card:hover img {
    transform: scale(1.05);
}

