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

:root {
    --primary-color: #e50914;
    --secondary-color: #ff6b6b;
    --dark-bg: #141414;
    --darker-bg: #0a0a0a;
    --card-bg: #1f1f1f;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --hover-color: #2a2a2a;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

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

.logo h1 {
    font-size: 28px;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-list {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-1);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border-radius: 25px;
    padding: 8px 15px;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    background: var(--hover-color);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.search-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
    width: 200px;
    padding: 5px;
}

.search-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
}

/* Hero Slider */
.hero-section {
    margin-top: 70px;
    position: relative;
    height: 600px;
    overflow: hidden;
}

.slider-container {
    position: relative;
    height: 100%;
}

.slider {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
}

.slide {
    min-width: 100%;
    height: 100%;
    position: relative;
    background-size: cover;
    background-position: center;
}

.slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.8) 0%, transparent 50%, rgba(0,0,0,0.8) 100%),
                linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 50%);
}

.slide-content {
    position: absolute;
    bottom: 80px;
    left: 60px;
    max-width: 600px;
    z-index: 10;
}

.slide-badge {
    display: inline-block;
    background: var(--gradient-1);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 15px;
}

.slide-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 2px 2px 20px rgba(0,0,0,0.8);
}

.slide-description {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 25px;
    line-height: 1.6;
    text-shadow: 1px 1px 10px rgba(0,0,0,0.8);
}

.slide-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    font-size: 14px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.slide-btn {
    background: var(--gradient-1);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.slide-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 30px;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
}

.slider-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.slider-btn.prev {
    left: 20px;
}

.slider-btn.next {
    right: 20px;
}

.slider-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 100;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    width: 30px;
    border-radius: 5px;
    background: white;
}

/* Sections */
.categories-section,
.anime-section,
.genres-section {
    padding: 60px 0;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 30px;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.view-all {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

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

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.category-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-card:hover::before {
    opacity: 0.1;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.category-card h3 {
    position: relative;
    z-index: 1;
    font-size: 20px;
    margin-bottom: 10px;
}

.category-card p {
    position: relative;
    z-index: 1;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Anime Grid */
.anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
}

.anime-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.anime-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

.anime-card-image {
    width: 100%;
    height: 320px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.anime-card-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    z-index: 10;
}

.anime-card-year {
    background: rgba(255, 107, 107, 0.9);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.anime-card-episodes {
    background: rgba(0, 0, 0, 0.8);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.anime-card-content {
    padding: 15px;
}

.anime-card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    min-height: 42px;
}

.anime-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.anime-card-badge {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.anime-card:hover .anime-card-badge {
    background: var(--gradient-1);
    color: white;
}

/* Genres Grid */
.genres-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.genre-tag {
    background: var(--card-bg);
    padding: 15px 25px;
    border-radius: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 2px solid transparent;
}

.genre-tag:hover {
    background: var(--hover-color);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-3px);
}

/* Footer */
.footer {
    background: var(--darker-bg);
    padding: 60px 0 20px;
    margin-top: 80px;
}

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

.footer-section h3 {
    font-size: 24px;
    margin-bottom: 15px;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-section h3 span {
    color: var(--primary-color);
}

.footer-section h4 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--text-primary);
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    background: var(--card-bg);
    padding: 10px 20px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--gradient-1);
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-more {
    text-align: center;
    padding: 40px 0;
}

.loading-more .spinner {
    margin: 0 auto 15px;
}

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

/* Responsive */
@media (max-width: 968px) {
    .header-content {
        flex-wrap: wrap;
        gap: 15px;
    }

    .nav-list {
        gap: 15px;
    }

    .slide-content {
        left: 30px;
        right: 30px;
    }

    .slide-title {
        font-size: 32px;
    }

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

@media (max-width: 640px) {
    .nav {
        width: 100%;
        order: 3;
    }

    .nav-list {
        width: 100%;
        justify-content: space-around;
    }

    .slide-title {
        font-size: 24px;
    }

    .slide-description {
        font-size: 14px;
    }

    .anime-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}