@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ===== BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --secondary: #8b5cf6;
    --accent: #ec4899;
    
    --bg-dark: #0a0a1e;
    --bg-card: #1a1a2e;
    --bg-hover: #252538;
    
    --text-white: #ffffff;
    --text-gray: #a1a1aa;
    --text-muted: #71717a;
    
    --border: rgba(255, 255, 255, 0.1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text-white);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ===== NAVBAR ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 30, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 1.75rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-gray);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--text-white);
}

.search-container {
    position: relative;
}

#searchBar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    color: var(--text-white);
    font-size: 0.875rem;
    outline: none;
    width: 180px;
    transition: all 0.3s;
}

#searchBar:focus {
    width: 260px;
    border-color: var(--primary);
}

#searchBar::placeholder {
    color: var(--text-muted);
}

.search-container::before {
    content: '🔍';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 350px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.search-dropdown.active {
    display: block;
}

.search-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.search-item:hover {
    background: var(--bg-hover);
}

.search-item img {
    width: 60px;
    height: 85px;
    object-fit: cover;
    border-radius: 6px;
}

.search-item-info h4 {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.search-item-info p {
    font-size: 0.75rem;
    color: var(--text-gray);
}

/* ===== HERO CAROUSEL ===== */
.hero-section {
    position: relative;
    height: 500px;
    margin-bottom: 3rem;
    overflow: hidden;
    border-radius: 0 0 24px 24px;
}

.hero-carousel {
    display: flex;
    height: 100%;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-slide {
    min-width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.hero-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(10, 10, 30, 0.95) 0%, rgba(10, 10, 30, 0.7) 40%, transparent 80%);
}

.hero-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-dark) 0%, transparent 50%);
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 3rem;
    transform: translateY(-50%);
    max-width: 600px;
    z-index: 2;
}

.hero-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.hero-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.1;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.7);
}

.hero-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.hero-meta span {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 0.4rem 0.8rem;
    border-radius: 16px;
    font-size: 0.875rem;
    border: 1px solid var(--border);
}

.hero-content p {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.75rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.carousel-controls {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 1.5rem;
    transform: translateY(-50%);
    z-index: 3;
}

.carousel-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.carousel-btn:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.carousel-indicators {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 3;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s;
}

.indicator.active {
    width: 28px;
    border-radius: 4px;
    background: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.6);
}

/* ===== CONTENT SECTIONS ===== */
.content-section {
    margin: 3rem 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    position: relative;
    padding-left: 1rem;
}

.section-header h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: var(--primary);
    border-radius: 2px;
}

.view-all {
    color: var(--text-gray);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s;
}

.view-all:hover {
    color: var(--primary);
}

/* ===== ANIME GRID (KEY RESPONSIVE) ===== */
.anime-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.25rem;
}

@media (max-width: 1400px) {
    .anime-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 1200px) {
    .anime-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
    .anime-grid { 
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    .anime-grid { 
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .anime-grid { 
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

/* ===== ANIME CARD ===== */
.anime-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.anime-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.3);
    border-color: var(--primary);
}

.anime-card-image {
    position: relative;
    padding-top: 140%;
    overflow: hidden;
    background: var(--bg-dark);
}

.anime-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.anime-card:hover .anime-card-image img {
    transform: scale(1.1);
}

.episode-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.5);
}

.quality-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    z-index: 2;
}

.anime-card-info {
    padding: 0.875rem;
}

.anime-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
    min-height: 2.3rem;
}

.anime-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-gray);
}

.anime-type {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 3rem 0 1.5rem;
    margin-top: 5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.footer-section p {
    color: var(--text-gray);
    line-height: 1.6;
    font-size: 0.875rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--text-gray);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: var(--primary);
}

.social-links {
    display: flex;
    gap: 0.75rem;
}

.social-links a {
    color: var(--text-gray);
    text-decoration: none;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-gray);
    font-size: 0.875rem;
}

/* ===== LOADING ===== */
.loading {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-gray);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .navbar { padding: 0.75rem 0; }
    .logo { font-size: 1.25rem; }
    .nav-links { gap: 1rem; }
    .nav-links a { font-size: 0.875rem; }
    
    #searchBar { width: 140px; }
    #searchBar:focus { width: 180px; }
    .search-dropdown { width: 280px; }
    
    .hero-section { height: 400px; }
    .hero-content { left: 1.5rem; max-width: calc(100% - 3rem); }
    .hero-content h1 { font-size: 2rem; }
    .hero-buttons { flex-wrap: wrap; }
    
    .section-header h2 { font-size: 1.25rem; }
    .content-section { margin: 2rem 0; }
}

@media (max-width: 480px) {
    .logo { font-size: 1.125rem; }
    .nav-links a:not(:first-child):not(:nth-child(2)) { display: none; }
    
    #searchBar { width: 110px; padding: 0.5rem 0.75rem 0.5rem 2rem; }
    
    .hero-section { height: 350px; }
    .hero-content { left: 1rem; max-width: calc(100% - 2rem); }
    .hero-badge { font-size: 0.65rem; padding: 0.3rem 0.75rem; }
    .hero-content h1 { font-size: 1.5rem; }
    .hero-meta span { font-size: 0.75rem; }
    .hero-content p { font-size: 0.875rem; }
    .btn { font-size: 0.875rem; padding: 0.625rem 1.25rem; }
    
    .carousel-btn { width: 38px; height: 38px; font-size: 1.25rem; }
    .section-header h2 { font-size: 1.125rem; }
    }
