/* === AnimeTio Premium Design System === */
:root {
    --bg-main: #0b0c15;
    --bg-secondary: #151621;
    --bg-card: #1f212e;
    --accent: #6c5ce7;
    --accent-hover: #5649c0;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --highlight: #00cec9;
    --gradient-hero: linear-gradient(135deg, #6c5ce7 0%, #00cec9 100%);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --radius-md: 12px;
    --shadow-card: 0 10px 20px rgba(0, 0, 0, 0.3);
}

body.light-mode {
    --bg-main: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode header,
body.light-mode footer {
    background: #0b0c15 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #ffffff !important;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
}

body.light-mode header .search-bar,
body.light-mode footer .search-bar {
    background: #1f212e !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.light-mode header input,
body.light-mode footer input {
    color: #ffffff !important;
}

body.light-mode .user-dropdown .dropdown-content {
    background: #1f212e !important;
    color: #b0b0b0 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.light-mode .user-dropdown .dropdown-content a {
    color: #b0b0b0 !important;
}

body.light-mode .user-dropdown .dropdown-content a:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

body.light-mode .light-mode-ignore {
    color: #fff !important;
}

body.light-mode .episode-card {
    border: 1px solid rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s ease;
}

/* === Layout & Containers === */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: rgba(11, 12, 21, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem 0;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.search-bar {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    display: flex;
    align-items: center;
    width: 400px;
    transition: 0.3s;
}

.search-bar input {
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    outline: none;
    margin-left: 10px;
}

.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(108, 92, 231, 0.3);
}

/* === Hero Section === */
.hero {
    position: relative;
    height: 60vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    background: url('https://w.wallhaven.cc/full/wq/wallhaven-wqve6r.jpg') center/cover no-repeat;
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--bg-main) 0%, rgba(11, 12, 21, 0.6) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

.badge {
    background: var(--accent);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 1rem;
    display: inline-block;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.btn {
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.4);
}

/* === Sections === */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin: 3rem 0 1.5rem;
    border-left: 4px solid var(--accent);
    padding-left: 1rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
}

/* === Grid Layouts === */
.grid-episodes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.episode-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    transition: 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.episode-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-card);
    border-color: var(--accent);
}

.thumb-wrapper {
    display: block;
    position: relative;
    padding-top: 56.25%;
    /* 16:9 */
    overflow: hidden;
}

.ep-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
    z-index: 2;
}

.thumb-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}

.episode-card:hover img {
    transform: scale(1.1);
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: rgba(108, 92, 231, 0.9);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.3s;
}

.episode-card:hover .play-icon {
    transform: translate(-50%, -50%) scale(1);
}

.card-info {
    padding: 1rem;
}

.anime-title {
    font-weight: 700;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.episode-number {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* === ANIME GRID - FIXED SIZE CARDS === */
.grid-animes {
    display: grid !important;
    gap: 20px !important;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
}

@media (min-width: 1000px) {
    .grid-animes {
        grid-template-columns: repeat(6, 1fr) !important;
    }
}

/* FORCE EXACT 2:3 RATIO ON ALL ANIME CARDS */
.anime-card {
    display: block;
}

.anime-card a.poster-wrapper,
.anime-card>a {
    display: block !important;
    width: 100% !important;
    height: 0 !important;
    padding-top: 150% !important;
    /* 2:3 ratio */
    position: relative !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    background: #1a1a2e;
}

.anime-card img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    transition: transform 0.3s ease;
}

.anime-card:hover img {
    transform: scale(1.05);
}

.card-title {
    margin-top: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.card-type-badge {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 4px;
}