/* Modern Theme - Inter Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-color: #0d0d12;
    --card-bg: #18181b;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --accent: #ef4444;
    /* Red accent */
    --accent-hover: #dc2626;
    --overlay: rgba(0, 0, 0, 0.7);
    --border: rgba(255, 255, 255, 0.1);
    --glass: rgba(255, 255, 255, 0.05);
}

body.light-mode {
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border: rgba(0, 0, 0, 0.1);
    --glass: rgba(0, 0, 0, 0.05);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Header */
header {
    background: var(--bg-color);
    /* Solid or blurred */
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-box {
    display: flex;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    align-items: center;
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
    font-size: 0.9rem;
}

.search-box button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: var(--glass);
}

/* Theme Toggle Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}

.theme-switch {
    display: inline-block;
    height: 26px;
    position: relative;
    width: 50px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #374151;
    /* Dark gray default */
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
    border: 1px solid var(--border);
}

.slider:before {
    background-color: #fff;
    bottom: 3px;
    content: "";
    height: 18px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 18px;
    border-radius: 50%;
}

/* Sun/Moon icons inside slider (optional but nice) */
.slider-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #fbbf24;
    transition: opacity 0.3s;
}

.sun-icon {
    left: 6px;
    opacity: 0;
}

.moon-icon {
    right: 6px;
    opacity: 1;
}

input:checked+.slider {
    background-color: var(--accent);
}

input:checked+.slider:before {
    transform: translateX(22px);
}

input:checked+.slider .moon-icon {
    opacity: 0;
}

input:checked+.slider .sun-icon {
    opacity: 1;
    left: 6px;
    color: #fff;
}

/* Adjust visibility */



/* Hero Section */
.hero {
    position: relative;
    height: 60vh;
    min-height: 400px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    /* Text at bottom */
    margin-bottom: 2rem;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-color) 0%, rgba(0, 0, 0, 0.6) 100%);
}

.hero-content {
    position: relative;
    z-index: 10;
    padding-bottom: 3rem;
    width: 100%;
}

.hero-title {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    /* Ensure title is visible on any background */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    color: white;
    /* Always white on hero image */
}

.hero-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #e5e7eb;
    /* Light text for dark overlay */
    margin-bottom: 1rem;
}

.hero-desc {
    max-width: 600px;
    color: #d1d5db;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}


/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 600;
    transition: transform 0.2s, background 0.2s;
    border: none;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}


/* Categories */
.category-list {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    /* Hide scrollbar */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.category-list::-webkit-scrollbar {
    display: none;
}

.cat-btn {
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 9999px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.cat-btn:hover,
.cat-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}


/* Grid layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 0.75rem;
    border-left: 4px solid var(--accent);
}

.view-all {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}


/* Anime Card */
.anime-card {
    background: var(--card-bg);
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.poster-wrapper {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
}

.poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.anime-card:hover .poster-img {
    transform: scale(1.1);
}

/* Play btn always visible on mobile, hover on desktop handled by media query but keeping simple for now */
.play-btn {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    transition: all 0.3s;
}

/* On hover show play button */
.anime-card:hover .play-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Dark overlay on hover */
.overlay {
    background: rgba(0, 0, 0, 0.4);
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.3s;
}

.anime-card:hover .overlay {
    opacity: 1;
}

.badge,
.ep-badge {
    position: absolute;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.badge {
    top: 5px;
    right: 5px;
    background: #3b82f6;
    color: white;
}

.ep-badge {
    bottom: 5px;
    left: 5px;
    background: #eab308;
    color: black;
}

.card-info {
    padding: 0.75rem;
    flex-grow: 1;
}

.card-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-primary);
}

.anime-card:hover .card-title {
    color: var(--accent);
}


/* Footer */
footer {
    border-top: 1px solid var(--border);
    margin-top: 4rem;
    padding: 3rem 0;
    background: var(--card-bg);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-links h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-links ul li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: color 0.2s;
}

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

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

/* Utilities */
.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-5 {
    margin-bottom: 2rem;
}

.text-center {
    text-align: center;
}

.text-secondary {
    color: var(--text-secondary);
}

.mt-2 {
    margin-top: 0.5rem;
}


/* Responsive */
@media (max-width: 768px) {
    .anime-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columns on mobile */
    }

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

    .play-btn {
        opacity: 1;
        /* Always visible on mobile */
        background: rgba(0, 0, 0, 0.5);
        /* Subtle background */
        border: 1px solid white;
    }

    .overlay {
        opacity: 0;
        /* No full overlay on mobile default state */
    }
}