/* AnimePortal - Dark Anime Theme */
/* Base Reset & Variables */
:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #f59e0b;
    --accent-hover: #d97706;
    --accent-secondary: #8b5cf6;
    --danger: #ef4444;
    --success: #22c55e;
    --border: #334155;
    --border-light: #475569;
    --shadow: rgba(0,0,0,0.3);
    --radius: 10px;
    --radius-sm: 6px;
    --transition: 0.2s ease;
    --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif;
    --container: 1400px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: center;
    transition: all var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.btn-primary { background: var(--accent); color: var(--bg-primary); }
.btn-primary:hover { background: var(--accent-hover); color: var(--bg-primary); }
.btn-outline { background: transparent; color: var(--text-primary); border: 1px solid var(--border-light); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 8px 16px; font-size: 12px; }
.btn-block { width: 100%; }

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 2px solid var(--accent);
    padding: 16px 20px;
    z-index: 9999;
    box-shadow: 0 -4px 20px var(--shadow);
}
.cookie-inner { max-width: var(--container); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.cookie-inner p { margin: 0; font-size: 14px; color: var(--text-secondary); }
.cookie-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cookie-link { font-size: 13px; color: var(--accent); text-decoration: underline; }

/* Compliance Banner */
.compliance-banner {
    background: linear-gradient(135deg, #7f1d1d, #991b1b);
    border-bottom: 2px solid #dc2626;
    padding: 8px 0;
    text-align: center;
}
.compliance-banner p { margin: 0; font-size: 12px; font-weight: 600; color: #fecaca; letter-spacing: 0.3px; }

/* Header */
.site-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 65px; gap: 20px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text-primary); }
.logo-icon { font-size: 28px; }
.logo-text { font-size: 22px; font-weight: 800; color: var(--accent); }

.nav-list { display: flex; list-style: none; gap: 4px; }
.nav-link {
    display: block;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-tertiary); }

.header-actions { display: flex; align-items: center; gap: 12px; }

/* Language Selector */
.lang-selector { position: relative; }
.lang-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}
.lang-toggle:hover { border-color: var(--accent); }
.lang-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 180px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1001;
    box-shadow: 0 8px 24px var(--shadow);
}
.lang-dropdown.show { display: block; }
.lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: var(--text-secondary);
    font-size: 13px;
    transition: all var(--transition);
}
.lang-option:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.lang-option.active { color: var(--accent); font-weight: 700; }

/* Mobile Menu Toggle */
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.menu-toggle span { display: block; width: 22px; height: 2px; background: var(--text-primary); margin: 5px 0; transition: all var(--transition); border-radius: 2px; }

/* Mobile Nav */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.98);
    z-index: 9998;
    overflow-y: auto;
}
.mobile-nav.show { display: block; }
.mobile-nav-inner { padding: 80px 20px 20px; }
.mobile-nav-list { list-style: none; }
.mobile-nav-list li { border-bottom: 1px solid var(--border); }
.mobile-nav-list a { display: block; padding: 16px 0; color: var(--text-primary); font-size: 18px; font-weight: 600; }
.mobile-nav-list a:hover { color: var(--accent); }
.mobile-lang { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.mobile-lang span { color: var(--text-muted); font-size: 14px; display: block; margin-bottom: 12px; }
.mobile-lang a { display: inline-block; padding: 6px 12px; margin: 4px; background: var(--bg-tertiary); border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 13px; }
.mobile-lang a.active { background: var(--accent); color: var(--bg-primary); }

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1a3e 50%, var(--bg-primary) 100%);
    padding: 60px 0 50px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(245,158,11,0.05) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.hero-title { font-size: 42px; font-weight: 900; color: var(--accent); margin-bottom: 12px; position: relative; }
.hero-subtitle { font-size: 16px; color: var(--text-secondary); max-width: 600px; margin: 0 auto 30px; position: relative; }

/* Search Form */
.search-form { max-width: 650px; margin: 0 auto; position: relative; }
.search-input-group { display: flex; gap: 0; background: var(--bg-secondary); border-radius: var(--radius); overflow: hidden; border: 2px solid var(--border); }
.search-input-group:focus-within { border-color: var(--accent); }
.search-input {
    flex: 1;
    padding: 16px 20px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
}
.search-input::placeholder { color: var(--text-muted); }
.search-btn {
    padding: 16px 32px;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background var(--transition);
}
.search-btn:hover { background: var(--accent-hover); }

/* Section Titles */
.section { padding: 40px 0; }
.section-title { font-size: 28px; font-weight: 800; margin-bottom: 6px; }
.section-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }

/* Anime Cards Grid */
.anime-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.anime-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--transition), border-color var(--transition);
}
.anime-card:hover { transform: translateY(-4px); border-color: var(--border-light); }

.card-image { width: 100%; height: 200px; overflow: hidden; position: relative; background: var(--bg-primary); }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent);
    color: var(--bg-primary);
    font-weight: 800;
    padding: 3px 10px;
    font-size: 12px;
    border-radius: 4px;
}
.card-type-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent-secondary);
    color: white;
    font-weight: 700;
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 4px;
    text-transform: uppercase;
}

.card-body { padding: 16px; }
.card-title { font-size: 16px; font-weight: 700; color: var(--text-primary); line-height: 1.3; margin-bottom: 4px; }
.card-title a { color: inherit; }
.card-title a:hover { color: var(--accent); }
.card-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; font-weight: 600; }
.card-synopsis { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Affiliate Link Stack */
.affiliate-stack { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--border); padding-top: 12px; }
.aff-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    text-align: center;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    transition: opacity var(--transition);
}
.aff-link:hover { opacity: 0.85; color: inherit; }
.aff-amazon { background: #ff9900; color: #111; }
.aff-hlj { background: #0284c7; color: #fff; }
.aff-playasia { background: #db2777; color: #fff; }

/* Card with full detail */
.anime-detail { display: grid; grid-template-columns: 350px 1fr; gap: 30px; background: var(--bg-secondary); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.anime-detail-image { width: 100%; }
.anime-detail-image img { width: 100%; height: auto; display: block; }
.anime-detail-body { padding: 24px; }
.anime-detail-title { font-size: 28px; font-weight: 900; color: var(--accent); margin-bottom: 4px; }
.anime-detail-jp { font-size: 14px; color: var(--text-muted); margin-bottom: 16px; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.info-item { background: var(--bg-primary); padding: 12px; border-radius: var(--radius-sm); }
.info-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; font-weight: 700; margin-bottom: 2px; }
.info-value { font-size: 14px; font-weight: 600; color: var(--text-primary); }

.genres-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.genre-tag { background: var(--accent); color: var(--bg-primary); padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }

.detail-synopsis { font-size: 15px; line-height: 1.7; color: var(--text-secondary); margin-bottom: 20px; }
.detail-affiliate { margin-top: 20px; }
.detail-affiliate h3 { font-size: 18px; margin-bottom: 12px; }

/* Categories Grid */
.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.category-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 16px;
    text-align: center;
    transition: all var(--transition);
    text-decoration: none;
    color: var(--text-primary);
}
.category-card:hover { border-color: var(--accent); transform: translateY(-3px); color: var(--text-primary); }
.category-icon { font-size: 32px; margin-bottom: 8px; }
.category-name { font-size: 15px; font-weight: 700; }

/* Tips Section */
.tips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.tip-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.tip-card h3 { font-size: 18px; color: var(--accent); margin-bottom: 8px; }
.tip-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* Ad Slots */
.ad-slot { text-align: center; margin: 16px 0; }
.ad-slot img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.ad-slot.ad-top { margin-bottom: 0; }
.ad-slot.ad-footer-left,
.ad-slot.ad-footer-right { display: inline-block; width: calc(50% - 10px); margin: 8px 5px; }
.ad-inner { display: inline-block; }
.ad-rotator { position: relative; }
.ad-slide { display: none; }
.ad-slide.active { display: block; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 30px; flex-wrap: wrap; }
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition);
}
.page-link:hover { border-color: var(--accent); color: var(--accent); }
.page-link.active { background: var(--accent); color: var(--bg-primary); border-color: var(--accent); }

/* Error / Alert */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #7f1d1d; border: 1px solid #dc2626; color: #fca5a5; }
.alert-success { background: #14532d; border: 1px solid #22c55e; color: #86efac; }

/* Footer */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 50px 0 0;
    margin-top: 40px;
}
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 30px; padding-bottom: 30px; }
.footer-logo { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.footer-logo .logo-icon { font-size: 24px; }
.footer-logo .logo-text { font-size: 20px; font-weight: 800; color: var(--accent); }
.footer-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 16px; }

.social-icons { display: flex; gap: 8px; }
.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    font-size: 16px;
    transition: all var(--transition);
}
.social-icon:hover { background: var(--accent); transform: translateY(-2px); }

.footer-col h4 { font-size: 16px; font-weight: 700; margin-bottom: 16px; color: var(--text-primary); }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: var(--text-secondary); font-size: 14px; }
.footer-links a:hover { color: var(--accent); }

.donate-text { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.donate-buttons { display: flex; flex-direction: column; gap: 8px; }
.btn-donate { display: block; padding: 10px 16px; text-align: center; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; transition: all var(--transition); }
.btn-paypal { background: #0070ba; color: #fff; }
.btn-paypal:hover { background: #005ea6; color: #fff; }
.btn-coffee { background: #ffdd00; color: #000; }
.btn-coffee:hover { background: #e6c700; color: #000; }

.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 20px 0;
    text-align: center;
}
.footer-notices { margin-bottom: 12px; }
.footer-notices p { font-size: 12px; color: var(--text-muted); margin: 4px 0; }
.copyright { font-size: 13px; color: var(--text-secondary); }

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    z-index: 999;
    display: none;
    transition: all var(--transition);
    box-shadow: 0 4px 12px var(--shadow);
}
.back-to-top:hover { transform: translateY(-3px); box-shadow: 0 6px 20px var(--shadow); }
.back-to-top.show { display: flex; align-items: center; justify-content: center; }

/* Social Share Bar */
.social-share-bar {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 8px;
    z-index: 998;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}
.share-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; font-weight: 700; writing-mode: vertical-lr; margin-bottom: 4px; }
.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    transition: transform var(--transition);
    text-decoration: none;
}
.share-btn:hover { transform: scale(1.15); }
.share-fb:hover { background: #1877f2; }
.share-tw:hover { background: #1da1f2; }
.share-wa:hover { background: #25d366; }
.share-tg:hover { background: #0088cc; }
.share-pt:hover { background: #e60023; }

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}
.filter-bar select, .filter-bar input {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
}
.filter-bar select:focus, .filter-bar input:focus { border-color: var(--accent); }

/* Static Pages */
.static-page { max-width: 800px; margin: 0 auto; }
.static-page h1 { font-size: 32px; font-weight: 900; color: var(--accent); margin-bottom: 8px; }
.static-page .last-updated { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
.static-page h2 { font-size: 22px; font-weight: 700; margin: 28px 0 12px; color: var(--text-primary); }
.static-page p { font-size: 15px; line-height: 1.7; color: var(--text-secondary); margin-bottom: 12px; }

/* Contact Form */
.contact-form { max-width: 600px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--text-primary); }
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: border-color var(--transition);
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent); }
.form-group textarea { min-height: 120px; resize: vertical; }

/* Loading Spinner */
.loading { text-align: center; padding: 40px; }
.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 404 Page */
.page-404 { text-align: center; padding: 80px 20px; }
.page-404 h1 { font-size: 80px; font-weight: 900; color: var(--accent); }
.page-404 p { font-size: 18px; color: var(--text-secondary); margin-bottom: 24px; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* Donate Button in Header */
.btn-donate-header {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
}
.btn-donate-header:hover { transform: scale(1.05); color: #fff; }

/* Top Share Toggle */
.top-share-icons { position: relative; }
.share-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.share-toggle:hover { border-color: var(--accent); }

/* Footer Social Share Row */
.footer-social-share {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}
.footer-social-share .share-label { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.footer-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 16px;
    transition: transform var(--transition);
    text-decoration: none;
}
.footer-share-btn:hover { transform: scale(1.15); }
.footer-share-btn.fb:hover { background: #1877f2; }
.footer-share-btn.tw:hover { background: #1da1f2; }
.footer-share-btn.wa:hover { background: #25d366; }
.footer-share-btn.tg:hover { background: #0088cc; }
.footer-share-btn.pt:hover { background: #e60023; }

/* Mobile Donate */
.mobile-donate {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mobile-donate .btn { text-align: center; }

/* reCAPTCHA */
.g-recaptcha { margin-bottom: 12px; }
.g-recaptcha > div { max-width: 100%; }

/* Advertise Page Ad Positions */
.ad-positions-info h2 { font-size: 22px; margin-bottom: 16px; }
