/*
Theme Name: VaniScans
Theme URI: https://vaniscans.online/
Author: VaniScans
Description: Ultra-fast, Genesis-inspired lightweight manga theme with ezmanga.org dark aesthetics. Built for high performance on 1GB VPS.
Version: 1.0.0
*/

:root {
    --bg-base: #090d16;
    --bg-surface: #111726;
    --bg-surface-elevated: #182032;
    --bg-surface-hover: #1f2a42;
    --border-color: #232d42;
    --border-light: #2d3a54;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --accent-glow: rgba(139, 92, 246, 0.25);
    --badge-bg: #1e1b4b;
    --badge-text: #c4b5fd;
    --star-gold: #f59e0b;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --container: 1280px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--accent);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 16px;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
    background: rgba(17, 23, 38, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-logo {
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.site-logo span {
    color: var(--accent);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
    list-style: none;
}

.nav-menu a {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
}

.nav-menu a:hover, .nav-menu a.active {
    color: #fff;
}

.header-search {
    position: relative;
    max-width: 300px;
    width: 100%;
}

.header-search input {
    width: 100%;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 14px 8px 36px;
    border-radius: 20px;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.header-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.header-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    fill: var(--text-dim);
    width: 14px;
    height: 14px;
}

/* ==========================================================================
   Main Layout & Grids
   ========================================================================== */

.page-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 28px;
    padding: 28px 0;
}

@media (max-width: 960px) {
    .page-layout {
        grid-template-columns: 1fr;
    }
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--accent);
    border-radius: 2px;
}

/* Manga Cards Grid */
.manga-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

@media (max-width: 640px) {
    .manga-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

.manga-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.manga-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.manga-card-thumb {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: var(--bg-surface-elevated);
}

.manga-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.manga-card:hover .manga-card-thumb img {
    transform: scale(1.05);
}

.badge-rating {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(17, 23, 38, 0.85);
    backdrop-filter: blur(4px);
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--star-gold);
    display: flex;
    align-items: center;
    gap: 3px;
}

.manga-card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.manga-card-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
    margin-bottom: 8px;
    min-height: 2.5em;
}

.manga-card-chapters {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.chapter-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: var(--text-muted);
    transition: background 0.15s, color 0.15s;
}

.chapter-pill:hover {
    background: var(--bg-surface-hover);
    color: var(--accent);
    border-color: var(--accent);
}

.chapter-pill .ch-time {
    font-size: 0.72rem;
    color: var(--text-dim);
}

/* ==========================================================================
   Sidebar Widgets
   ========================================================================== */

.sidebar-widget {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.mini-manga-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mini-manga-item {
    display: flex;
    gap: 12px;
    align-items: center;
}

.mini-manga-item img {
    width: 52px;
    height: 72px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--bg-base);
    flex-shrink: 0;
}

.mini-manga-info {
    flex: 1;
    min-width: 0;
}

.mini-manga-title {
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.mini-manga-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.genre-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.genre-tag {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: all 0.15s ease;
}

.genre-tag:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ==========================================================================
   Single Manga Details Page (ezmanga.org aesthetic)
   ========================================================================== */

.manga-hero-banner {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin: 24px 0;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 28px;
    position: relative;
    overflow: hidden;
}

@media (max-width: 768px) {
    .manga-hero-banner {
        grid-template-columns: 1fr;
        padding: 20px;
    }
}

.manga-hero-poster {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    aspect-ratio: 2/3;
    background: var(--bg-base);
}

.manga-hero-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.manga-hero-details h1 {
    font-size: 1.85rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
    line-height: 1.3;
}

.manga-meta-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 0.85rem;
}

.chip {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: 6px;
    color: var(--text-muted);
}

.chip.status-ongoing {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

.chip.status-completed {
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
}

.chip.rating {
    color: var(--star-gold);
    font-weight: 700;
}

.manga-synopsis {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-top: 14px;
}

/* Chapter List Box */
.chapter-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 32px;
}

.chapter-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
}

.chapter-search-input {
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.88rem;
    width: 220px;
    outline: none;
}

.chapter-search-input:focus {
    border-color: var(--accent);
}

.chapter-list-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 580px;
    overflow-y: auto;
    padding-right: 6px;
}

.chapter-row-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.chapter-row-item:hover {
    background: var(--bg-surface-hover);
    border-color: var(--accent);
    transform: translateX(4px);
}

.chapter-row-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chapter-row-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
}

.chapter-row-date {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* ==========================================================================
   Webtoon Chapter Reader
   ========================================================================== */

.reader-wrapper {
    margin: 0 auto;
}

.reader-toolbar {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.reader-select {
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
}

.btn {
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}

.btn:hover {
    background: var(--accent-hover);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: var(--bg-surface-hover);
    border-color: var(--accent);
}

.reader-container {
    max-width: 840px;
    margin: 0 auto;
    background: #000;
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
}

.reader-container img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ==========================================================================
   Footer & Pagination
   ========================================================================== */

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 32px 0;
}

.pagination a, .pagination span {
    padding: 8px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}

.pagination .current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 36px 0;
    margin-top: 60px;
    background: var(--bg-surface);
    color: var(--text-muted);
    font-size: 0.88rem;
    text-align: center;
}
