:root {
    /* AniList Dark Theme Colors */
    --bg-base: #0b1622;
    --bg-surface: #151f2e;
    --bg-surface-hover: #1f2b3e;
    
    --text-primary: #9fadbd;
    --text-strong: #e4e7ec;
    --text-muted: #748899;
    
    --accent: #3db4f2;
    --accent-hover: #1c92d2;
    --score-green: #68d639;
    --score-yellow: #f2d13b;
    --score-red: #e85d75;
    
    --font-overpass: 'Overpass', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-roboto: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
    
    --shadow: 0 14px 30px rgba(0, 0, 0, 0.15), 0 4px 4px rgba(0, 0, 0, 0.05);
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-roboto);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    background-color: var(--bg-surface);
    height: 68px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
    margin-right: 40px;
}

.nav-links {
    display: flex;
    gap: 30px;
    flex: 1;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-family: var(--font-overpass);
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-strong);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-icon {
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
}

.search-icon:hover {
    color: var(--text-strong);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Filters */
.filters-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 50px;
}

.filter-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-width: 150px;
}

.filter-wrap label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-overpass);
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease;
}

.search-box:focus-within {
    box-shadow: 0 0 0 2px rgba(255,255,255,0.1);
}

.search-box svg {
    color: var(--text-muted);
    margin-right: 10px;
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-strong);
    font-family: var(--font-roboto);
    outline: none;
    width: 100%;
    font-size: 13px;
}

.filter-wrap select {
    background: var(--bg-surface);
    color: var(--text-strong);
    border: none;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    font-family: var(--font-roboto);
    font-size: 13px;
    outline: none;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    appearance: none;
}

/* Horizontal Sections */
.horizontal-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-title {
    font-family: var(--font-overpass);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-strong);
    letter-spacing: 0.5px;
}

.view-all {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    font-family: var(--font-overpass);
}

.view-all:hover {
    color: var(--accent);
}

.row-wrap {
    margin: 0 -20px;
    padding: 0 20px;
}

.anime-row {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    padding-bottom: 20px;
    scrollbar-width: none;
}

.anime-row::-webkit-scrollbar {
    display: none;
}

/* Cards */
.anime-card {
    min-width: 185px;
    max-width: 185px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
    position: relative;
}

.poster-wrap {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background-color: var(--bg-surface);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

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

.title {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

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

/* Search Results Grid */
.grid-wrap {
    margin-bottom: 50px;
}

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

/* Hover Tooltip */
.hover-tooltip {
    position: fixed;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    width: 320px;
    box-shadow: var(--shadow);
    z-index: 1000;
    display: none;
    pointer-events: none;
    font-size: 13px;
    color: var(--text-primary);
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.hover-tooltip.active {
    display: block;
    transform: translateY(0);
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.tooltip-episode {
    color: var(--text-strong);
    font-weight: 500;
}

.tooltip-studio {
    color: var(--accent);
    font-weight: 600;
}

.tooltip-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.tt-format {
    background: var(--text-muted);
    color: var(--bg-surface);
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 11px;
}

.tooltip-score {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 15px;
    font-weight: 700;
    font-size: 14px;
}

.tooltip-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tooltip-genres span {
    background: var(--accent);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 11px;
    font-family: var(--font-overpass);
}

/* Loader */
.loader {
    width: 100%;
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    font-weight: 600;
}

/* Details Modal */
.details-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 22, 34, 0.95);
    z-index: 2000;
    display: none;
    flex-direction: column;
    padding: 40px;
    overflow-y: auto;
}

.details-modal.active {
    display: flex;
}

.details-header {
    display: flex;
    justify-content: flex-end;
    max-width: 1000px;
    width: 100%;
    margin: 0 auto 20px auto;
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-strong);
    cursor: pointer;
    padding: 10px;
}

.btn-close-modal:hover {
    color: var(--accent);
}

.details-content {
    display: flex;
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    gap: 40px;
}

.details-poster {
    flex-shrink: 0;
    width: 250px;
}

.details-poster img {
    width: 100%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
}

.details-info {
    flex: 1;
}

.details-info h1 {
    font-family: var(--font-overpass);
    color: var(--text-strong);
    font-size: 32px;
    margin-bottom: 5px;
}

.details-info h2 {
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 25px;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    background: var(--bg-surface);
    padding: 20px;
    border-radius: var(--radius-md);
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.meta-value {
    color: var(--text-strong);
    font-weight: 600;
    font-size: 16px;
}

.description-box {
    line-height: 1.7;
    color: var(--text-primary);
}

.description-box i {
    color: var(--text-muted);
}
