/* ========== CRITICAL CSS - ABOVE THE FOLD ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

:root {
    --primary-bg: #0a0a0f;
    --secondary-bg: #11111a;
    --accent-gold: #FFD700;
    --accent-red: #FF4757;
    --accent-blue: #1e90ff;
    --accent-purple: #9b59b6;
    --accent-gradient: linear-gradient(135deg, #FFD700, #FF8C00, #FF4757);
    --text-primary: #ffffff;
    --text-secondary: #b0b0c0;
    --card-bg: rgba(25, 25, 35, 0.9);
    --border-color: rgba(255, 215, 0, 0.2);
    --glow-effect: 0 0 20px rgba(255, 215, 0, 0.3);
}

body {
    background: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========== HEADER ========== */
.header {
    background: rgba(10, 10, 15, 0.95);
    padding: 15px 25px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.logo-container {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.site-title {
    font-size: 22px;
    font-weight: 900;
    color: #FFD700;
    letter-spacing: -0.5px;
    text-decoration: none;
}

/* ========== TRENDING SECTION ========== */
.trending-section {
    padding: 20px 25px 10px;
    max-width: 1400px;
    margin: 0 auto;
}

.section-title-compact {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
    display: block;
    text-decoration: none;
    border-bottom: none;
}

.trending-scroll-container {
    position: relative;
    overflow: hidden;
}

.trending-scroll-wrapper {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 5px 0 15px;
    scroll-behavior: smooth;
}

.trending-item-compact {
    flex: 0 0 auto;
    width: 180px;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    text-decoration: none;
    color: inherit;
    display: block;
}

.trending-item-compact:hover {
    border-color: var(--accent-gold);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.trending-cover {
    width: 100%;
    height: 100px;
    position: relative;
    overflow: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.trending-rank {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    background: var(--accent-gradient);
    color: var(--primary-bg);
    font-weight: 800;
    font-size: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.trending-info {
    padding: 10px;
}

.trending-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
    text-decoration: none;
}

.trending-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.trending-views {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 600;
}

.trending-time {
    font-size: 9px;
    color: var(--accent-gold);
    padding: 2px 6px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 10px;
}

/* ========== FEATURED SLIDER ========== */
.featured-compact {
    max-width: 1400px;
    margin: 15px auto 25px;
    padding: 0 25px;
}

.featured-slider-compact {
    height: 180px;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.featured-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.8s ease;
    display: flex;
    align-items: flex-end;
    padding: 20px;
    text-decoration: none !important;
    color: inherit;
}

.featured-slide.active {
    opacity: 1;
}

.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 30%, rgba(10, 10, 15, 0.95) 100%);
}

.slide-content-compact {
    position: relative;
    z-index: 2;
    max-width: 500px;
}

.slide-badge {
    display: inline-block;
    padding: 5px 12px;
    background: var(--accent-gradient);
    color: var(--primary-bg);
    font-weight: 800;
    border-radius: 15px;
    font-size: 10px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none !important;
}

.slide-title-compact {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 5px;
    color: white;
    text-decoration: none !important;
    display: block;
}

/* ========== NEW RELEASES ========== */
.content-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 25px 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 25px 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.section-link {
    color: var(--accent-gold);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.section-link:hover {
    gap: 8px;
}

.manga-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 18px;
    margin-bottom: 30px;
}

.manga-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    height: 260px;
    text-decoration: none;
    color: inherit;
    display: block;
}

.manga-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-gold);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.manga-cover {
    width: 100%;
    height: 140px;
    position: relative;
    overflow: hidden;
}

.card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 3;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 3px;
}

.badge-new {
    background: #1e90ff;
    color: white;
}

.manga-info {
    padding: 12px;
}

.manga-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 5px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.manga-chapter {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chapter-number {
    color: var(--accent-gold);
    font-weight: 700;
}

.manga-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.manga-rating {
    color: var(--accent-gold);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 2px;
}

.manga-views {
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
}

.genre-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.genre-tag {
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
}

.action { background: rgba(255, 71, 87, 0.15); color: #FF4757; }
.fantasy { background: rgba(30, 144, 255, 0.15); color: #1e90ff; }
.mystery { background: rgba(106, 90, 205, 0.15); color: #6a5acd; }
.comedy { background: rgba(46, 204, 113, 0.15); color: #2ecc71; }
.drama { background: rgba(230, 126, 34, 0.15); color: #e67e22; }
.adventure { background: rgba(241, 196, 15, 0.15); color: #f1c40f; }

/* ========== PAGINATION ========== */
.main-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 30px auto 20px;
    padding: 15px 20px;
    max-width: 800px;
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 120px;
    cursor: pointer;
}

.nav-btn:hover:not(.disabled) {
    background: rgba(255, 215, 0, 0.15);
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.2);
}

.nav-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.page-indicator {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    min-width: 100px;
    text-align: center;
    padding: 8px 15px;
    background: rgba(255, 215, 0, 0.05);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.page-indicator .current {
    color: var(--accent-gold);
    font-weight: 700;
    font-size: 16px;
}

.page-indicator .total {
    color: var(--text-secondary);
    font-weight: 600;
}

/* ========== FOOTER ========== */
.footer {
    background: var(--secondary-bg);
    margin-top: 20px;
    padding: 30px 25px 20px;
    border-top: 1px solid var(--border-color);
}

.footer-brand {
    text-align: center;
    margin-bottom: 30px;
}

.footer-logo {
    font-size: 22px;
    font-weight: 900;
    color: #FFD700;
    margin-bottom: 10px;
    display: block;
    text-decoration: none;
}

.footer-tagline {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.social-link {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-gold);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--accent-gold);
    color: var(--primary-bg);
    transform: translateY(-3px);
}

.quick-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.quick-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
    transition: color 0.3s ease;
}

.quick-link:hover {
    color: var(--accent-gold);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 11px;
}

.scroll-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-bg);
    text-decoration: none;
    font-size: 14px;
    box-shadow: 0 3px 15px rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 12px 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    .site-title {
        font-size: 20px;
    }
    
    .trending-item-compact { width: 150px; }
    .featured-slider-compact { height: 150px; }
    .manga-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
    .slide-title-compact { font-size: 14px; }
    
    .main-pagination {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 15px;
        max-width: 90%;
    }
    
    .nav-btn {
        min-width: 45%;
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .page-indicator {
        order: -1;
        width: 100%;
        margin-bottom: 10px;
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .manga-grid { grid-template-columns: repeat(2, 1fr); }
    .trending-item-compact { width: 130px; }
    .nav-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 40%;
    }
}