/* ================================
   MangaBuddy - Clone of batoto.website
   Pure HTML/CSS only
   ================================ */

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

:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-card-hover: #1e2a4a;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: #818cf8;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #2d3a5f;
    --success: #10b981;
    --warning: #f59e0b;
    --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

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

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ================================
   HEADER
   ================================ */
.header {
    background-color: rgba(15, 15, 26, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    flex-shrink: 0;
}

.logo:hover {
    color: var(--accent-light);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 900;
    color: #fff;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

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

.nav a {
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.nav a:hover,
.nav a.active {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

.search-box {
    flex: 1;
    max-width: 360px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 9px 16px 9px 38px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease;
}

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

.search-box::before {
    content: "🔍";
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    opacity: 0.6;
}

/* ================================
   HERO SECTION
   ================================ */
.hero {
    padding: 80px 0 60px;
    text-align: center;
    background: radial-gradient(ellipse at top, rgba(99, 102, 241, 0.15), transparent 70%);
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 32px;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--gradient);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 48px;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-light);
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ================================
   SECTIONS
   ================================ */
.section {
    padding: 60px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

/* ================================
   MANGA GRID
   ================================ */
.manga-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.manga-card {
    display: block;
    background-color: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border);
    color: inherit;
    text-decoration: none;
}

.manga-card:hover { color: inherit; }

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

.manga-cover {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: linear-gradient(135deg, #2d3a5f, #1a1a2e);
}

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

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

.manga-rating {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: #fbbf24;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.manga-views {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(99, 102, 241, 0.9);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.manga-info {
    padding: 14px;
}

.manga-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    min-height: 2.6em;
}

.manga-title a {
    color: inherit;
}

.manga-title a:hover {
    color: var(--accent-light);
}

.manga-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tag {
    font-size: 0.7rem;
    padding: 3px 8px;
    background: var(--bg-secondary);
    color: var(--text-muted);
    border-radius: 4px;
    border: 1px solid var(--border);
}

.view-all-wrap {
    text-align: center;
    margin-top: 40px;
}

/* ================================
   GENRE GRID
   ================================ */
.genre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.genre-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 18px 14px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.genre-card:hover {
    background: var(--gradient);
    color: #fff;
    transform: translateY(-2px);
    border-color: transparent;
}

.genre-emoji {
    font-size: 1.5rem;
    margin-right: 6px;
}

/* ================================
   CTA SECTION
   ================================ */
.cta {
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: 16px;
    margin: 60px 0;
    border: 1px solid var(--border);
}

.cta h2 {
    font-size: 2.25rem;
    margin-bottom: 16px;
}

.cta p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 28px;
    font-size: 1.05rem;
}

/* ================================
   FOOTER
   ================================ */
.footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 60px 0 24px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.footer-col p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col ul a {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-col ul a:hover {
    color: var(--accent-light);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-bottom p {
    margin-bottom: 6px;
}

/* ================================
   ABOUT / CONTENT PAGES
   ================================ */
.page-header {
    padding: 60px 0 30px;
    text-align: center;
    background: radial-gradient(ellipse at top, rgba(99, 102, 241, 0.1), transparent 70%);
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.content {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

.content-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
}

.content-block h2 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    color: var(--accent-light);
}

.content-block h3 {
    font-size: 1.15rem;
    margin: 20px 0 10px;
    color: var(--text-primary);
}

.content-block p,
.content-block li {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.content-block ul {
    padding-left: 24px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.feature-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.feature-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.feature-item p {
    margin: 0;
    font-size: 0.9rem;
}

.notice {
    background: rgba(245, 158, 11, 0.1);
    border-left: 4px solid var(--warning);
    padding: 16px 20px;
    border-radius: 8px;
    margin: 20px 0;
    color: var(--text-secondary);
}

.notice strong {
    color: var(--warning);
}

.legal-list a {
    display: block;
    padding: 8px 0;
    color: var(--accent-light);
}

/* ================================
   BREADCRUMB
   ================================ */
.breadcrumb {
    padding: 16px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--text-muted);
}

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

.breadcrumb span {
    margin: 0 8px;
    opacity: 0.5;
}

/* ================================
   MANGA DETAIL PAGE
   ================================ */
.manga-detail {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    padding: 40px 0;
}

.detail-cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.detail-info h1 {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.detail-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.detail-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0;
}

.detail-tags .tag {
    font-size: 0.85rem;
    padding: 6px 12px;
}

.detail-description {
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 24px 0;
}

.detail-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

/* ================================
   FILTERS (Browse Page)
   ================================ */
.filters {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

.filter-group select {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}

.filter-group select:focus {
    border-color: var(--accent);
}

/* ================================
   PAGINATION
   ================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 40px;
    text-align: center;
}

.pagination a:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

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

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .manga-detail {
        grid-template-columns: 1fr;
    }

    .detail-cover {
        max-width: 280px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
    }

    .search-box {
        order: 3;
        max-width: 100%;
        flex-basis: 100%;
    }

    .nav {
        gap: 4px;
    }

    .nav a {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .hero {
        padding: 50px 0 40px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-stats {
        gap: 24px;
    }

    .section {
        padding: 40px 0;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .cta h2 {
        font-size: 1.5rem;
    }

    .manga-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 14px;
    }

    .genre-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}

@media (max-width: 500px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .manga-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
