:root {
    --primary: #ff5e8e;       /* Anime pink */
    --secondary: #5d6cff;     /* Anime blue */
    --accent: #ffffff;        /* White for text */
    --dark: #0f0f1a;          /* Deep blue background */
    --darker: #0a0a13;        /* Darker blue */
    --light: #f0f0f5;         /* Light background for cards */
    --gray: #a0a0b0;          /* Gray text */
    --card-bg: #1a1a2e;       /* Card background */
    --header-height: 70px;
    --sidebar-width: 280px;
    --glow: 0 0 15px rgba(255, 94, 142, 0.7);
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, var(--darker) 0%, var(--dark) 100%);
    color: var(--accent);
    font-family: 'Poppins', 'Noto Sans JP', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 26, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loader {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: inline-block;
    border-top: 4px solid var(--primary);
    border-right: 4px solid transparent;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    position: relative;
}

.loader::after {
    content: '';  
    box-sizing: border-box;
    position: absolute;
    left: 0;
    top: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border-bottom: 4px solid var(--secondary);
    border-left: 4px solid transparent;
    animation: rotation 0.5s linear infinite reverse;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Anime-themed background elements */
.anime-bg-element {
    position: absolute;
    z-index: -1;
    opacity: 0.1;
    pointer-events: none;
}

.sakura-1 {
    top: 10%;
    left: 5%;
    font-size: 3rem;
    animation: float 15s infinite linear;
    color: var(--primary);
}

.sakura-2 {
    top: 30%;
    right: 8%;
    font-size: 2.5rem;
    animation: float 18s infinite linear reverse;
    color: var(--primary);
}

.sakura-3 {
    bottom: 20%;
    left: 12%;
    font-size: 2rem;
    animation: float 12s infinite linear;
    color: var(--primary);
}

.sakura-4 {
    bottom: 40%;
    right: 15%;
    font-size: 2.8rem;
    animation: float 16s infinite linear reverse;
    color: var(--primary);
}

@keyframes float {
    0% { transform: translateY(0) rotate(0deg); opacity: 0.1; }
    50% { transform: translateY(-20px) rotate(180deg); opacity: 0.15; }
    100% { transform: translateY(0) rotate(360deg); opacity: 0.1; }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Header Styles */
header {
    background: rgba(15, 15, 26, 0.95);
    backdrop-filter: blur(10px);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(106, 90, 205, 0.3);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    height: var(--header-height);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 24px;
    cursor: pointer;
    margin-right: 15px;
    transition: all 0.3s;
    z-index: 1001;
}

.menu-toggle:hover {
    color: var(--secondary);
}

.logo {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    letter-spacing: -0.5px;
    position: relative;
}

.logo i {
    margin-right: 10px;
    color: var(--primary);
    animation: pulse-logo 2s infinite;
}

@keyframes pulse-logo {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.logo span {
    color: var(--secondary);
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin: 0 18px;
}

.nav-links a {
    color: var(--accent);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px 0;
    opacity: 0.9;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--secondary);
    opacity: 1;
}

.nav-links a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}

/* Enhanced Search Bar */
.search-container {
    position: relative;
    width: 500px;
    max-width: 90%;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.search-box {
    display: flex;
    align-items: center;
    position: relative;
    background: rgba(30, 30, 46, 0.9);
    border: 1px solid rgba(106, 90, 205, 0.4);
    border-radius: 30px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-box.focused {
    border-color: var(--secondary);
    box-shadow: 0 0 15px rgba(93, 108, 255, 0.5);
}

.search-container input {
    background: transparent;
    border: none;
    padding: 12px 20px;
    color: var(--accent);
    width: 100%;
    font-size: 16px;
    outline: none;
}

.search-container input::placeholder {
    color: var(--gray);
}

.search-btn {
    background: rgba(93, 108, 255, 0.3);
    border: none;
    padding: 12px 20px;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: var(--secondary);
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(30, 30, 46, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 0 0 15px 15px;
    padding: 15px;
    margin-top: 5px;
    display: none;
    z-index: 100;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(106, 90, 205, 0.4);
    border-top: none;
    max-height: 300px;
    overflow-y: auto;
}

.search-suggestions.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

.suggestion-item {
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
}

.suggestion-item:hover {
    background: rgba(93, 108, 255, 0.2);
}

.suggestion-item i {
    margin-right: 10px;
    color: var(--primary);
    font-size: 14px;
}

.suggestion-item span {
    font-size: 14px;
}

.suggestion-item .match {
    color: var(--primary);
    font-weight: 600;
}

.search-clear {
    display: none;
    background: transparent;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: 0 10px;
    font-size: 16px;
    transition: all 0.3s;
}

.search-clear.visible {
    display: block;
    opacity: 0.7;
}

.search-clear:hover {
    color: var(--accent);
    opacity: 1;
}

/* Mobile Search Toggle */
.mobile-search-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 20px;
    cursor: pointer;
    margin-left: 15px;
    transition: all 0.3s;
}

.mobile-search-toggle:hover {
    color: var(--secondary);
}

.mobile-search-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: var(--darker);
    z-index: 1001;
    padding: 10px 15px;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.mobile-search-container.active {
    display: flex;
}

.mobile-search-box {
    display: flex;
    align-items: center;
    flex: 1;
    background: rgba(30, 30, 46, 0.9);
    border: 1px solid rgba(106, 90, 205, 0.4);
    border-radius: 30px;
    overflow: hidden;
    padding-right: 10px;
}

.mobile-search-box input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 15px;
    color: var(--accent);
    font-size: 16px;
    outline: none;
}

.mobile-search-close {
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 20px;
    cursor: pointer;
    margin-left: 10px;
}

/* Mobile search suggestions */
.mobile-search-suggestions {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 26, 0.98);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
    display: none;
}

.mobile-search-suggestions.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Sidebar Menu */
.sidebar-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: var(--sidebar-width);
    height: 100vh;
    background: rgba(15, 15, 26, 0.98);
    backdrop-filter: blur(10px);
    z-index: 2000;
    overflow-y: auto;
    transition: left 0.4s ease;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
    border-right: 1px solid rgba(106, 90, 205, 0.3);
}

.sidebar-menu.active {
    left: 0;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from { left: -100%; }
    to { left: 0; }
}

.sidebar-header {
    padding: 25px 20px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(106, 90, 205, 0.3);
}

.sidebar-logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    margin-left: 10px;
    margin-bottom: 10px;
}

.sidebar-logo i {
    margin-right: 10px;
    color: var(--primary);
    flex-shrink: 0;
}

.close-menu {
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s;
}

.close-menu:hover {
    color: var(--secondary);
    transform: rotate(90deg);
}

.sidebar-nav {
    padding: 20px;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 10px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--accent);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    font-weight: 500;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background: rgba(93, 108, 255, 0.2);
    color: var(--secondary);
}

.sidebar-nav i {
    margin-right: 15px;
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    margin-top: 30px;
    border-top: 1px solid rgba(106, 90, 205, 0.3);
}

.sidebar-footer p {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 15px;
}

.sidebar-footer .nav-btn {
    width: 100%;
    justify-content: center;
    margin-top: 15px;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Anime Detail Hero Section */
.anime-hero {
    padding: 40px 0;
    position: relative;
    overflow: hidden;
}

.hero-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(15, 15, 26, 0.8), rgba(15, 15, 26, 0.9)), url('https://images.unsplash.com/photo-1633328562356-52f1539be58d?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1200&q=80');
    background-size: cover;
    background-position: center;
    z-index: -1;
}

.hero-content {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.anime-poster {
    flex-shrink: 0;
    width: 280px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 94, 142, 0.3);
    transition: all 0.4s ease;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.anime-poster:hover {
    transform: translateY(-10px) rotateY(5deg);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(255, 94, 142, 0.7);
}

.anime-poster img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.anime-poster:hover img {
    transform: scale(1.05);
}

.anime-info {
    flex: 1;
}

.anime-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--accent);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.8s ease-out;
}

.anime-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--gray);
}

.meta-item i {
    color: var(--primary);
}

.rating-badge {
    background: rgba(255, 215, 0, 0.2);
    color: gold;
    padding: 4px 10px;
    border-radius: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.anime-tags {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.anime-tag {
    background: rgba(93, 108, 255, 0.2);
    color: var(--secondary);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(93, 108, 255, 0.3);
    transition: all 0.3s ease;
}

.anime-tag:hover {
    background: var(--secondary);
    color: white;
    transform: translateY(-2px);
}

.anime-description {
    margin-bottom: 30px;
    line-height: 1.8;
    color: var(--gray);
    max-width: 800px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.watch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 25px;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(93, 108, 255, 0.5);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.watch-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    z-index: -1;
    transition: opacity 0.5s;
    opacity: 0;
    border-radius: 50px;
    animation: gradientShift 3s infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.watch-btn:hover::before {
    opacity: 1;
}

.watch-btn i {
    margin-right: 10px;
}

.watch-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(93, 108, 255, 0.7);
}

.save-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 25px;
    border-radius: 50px;
    background: rgba(30, 30, 46, 0.7);
    color: var(--accent);
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(106, 90, 205, 0.3);
    cursor: pointer;
}

.save-btn i {
    margin-right: 10px;
}

.save-btn:hover {
    background: rgba(93, 108, 255, 0.2);
    border-color: var(--secondary);
}

.save-btn.saved {
    background: rgba(93, 108, 255, 0.2);
    border-color: var(--secondary);
    color: var(--secondary);
}

/* Episode Section */
.episodes-section {
    padding: 40px 0;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-title h2 {
    font-size: 28px;
    font-weight: 700;
    position: relative;
    display: inline-block;
    color: var(--accent);
}

.section-title h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 50px;
    height: 3px;
    background: var(--secondary);
    border-radius: 3px;
}

.view-all {
    color: var(--accent);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    opacity: 0.8;
}

.view-all:hover {
    color: var(--secondary);
    opacity: 1;
}

.view-all i {
    margin-left: 5px;
    font-size: 12px;
}

.episode-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 20px;
    border-radius: 20px;
    background: rgba(30, 30, 46, 0.5);
    color: var(--accent);
    border: 1px solid rgba(106, 90, 205, 0.2);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn.active, .filter-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: var(--glow);
}

/* Episode Cards - Improved and Smaller */
.episode-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.episode-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(106, 90, 205, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transform-style: preserve-3d;
    perspective: 1000px;
    animation: fadeIn 0.6s ease-out;
    animation-fill-mode: backwards;
}

.episode-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 15px rgba(255, 94, 142, 0.3);
}

.episode-header {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(106, 90, 205, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 30, 46, 0.3);
}

.episode-number {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
}

.episode-date {
    font-size: 11px;
    color: var(--gray);
}

.episode-content {
    padding: 15px;
}

.episode-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--accent);
    line-height: 1.4;
}

.quality-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.quality-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(30, 30, 46, 0.7);
    border-radius: 6px;
    border: 1px solid rgba(106, 90, 205, 0.2);
    transition: all 0.3s ease;
}

.quality-option:hover {
    background: rgba(93, 108, 255, 0.2);
    border-color: var(--secondary);
}

.quality-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quality-label {
    font-weight: 600;
    color: var(--accent);
    font-size: 13px;
}

.quality-size {
    font-size: 11px;
    color: var(--gray);
}

.download-links {
    display: flex;
    gap: 6px;
}

.download-link {
    padding: 4px 8px;
    background: rgba(93, 108, 255, 0.2);
    color: var(--secondary);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    border: 1px solid rgba(93, 108, 255, 0.3);
}

.download-link:hover {
    background: var(--secondary);
    color: white;
}

.watch-online {
    display: block;
    text-align: center;
    padding: 8px;
    background: rgba(255, 94, 142, 0.2);
    color: var(--primary);
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    margin-top: 8px;
    transition: all 0.3s;
    border: 1px solid rgba(255, 94, 142, 0.3);
    font-size: 13px;
}

.watch-online:hover {
    background: var(--primary);
    color: white;
}

/* Related Anime */
.related-section {
    padding: 40px 0;
}

.related-scroll {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 10px 5px 25px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) #222;
}

.related-card {
    min-width: 150px;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(106, 90, 205, 0.2);
}

.related-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.related-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.related-card h3 {
    padding: 10px;
    font-size: 14px;
    text-align: center;
    color: var(--accent);
}

/* Genre Filter */
.genre-filter {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 15px 0 30px;
    margin-bottom: 30px;
    scrollbar-width: none;
}

.genre-filter::-webkit-scrollbar {
    display: none;
}

.genre-btn {
    padding: 8px 20px;
    border-radius: 20px;
    background: rgba(30, 30, 46, 0.5);
    color: var(--accent);
    border: 1px solid rgba(106, 90, 205, 0.2);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    opacity: 0.8;
    display: flex;
    align-items: center;
}

.genre-btn i {
    margin-right: 8px;
    font-size: 16px;
    flex-shrink: 0;
}

.genre-btn:hover, .genre-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    opacity: 1;
    box-shadow: var(--glow);
}

/* Featured Scroll Section */
.featured-section {
    padding: 20px 0 10px;
    position: relative;
    margin-top: 10px;
    overflow: hidden;
}

.featured-scroll {
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) #222;
    padding: 10px 5px 25px;
    gap: 20px;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
}

.featured-scroll::-webkit-scrollbar {
    height: 6px;
}

.featured-scroll::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 3px;
}

.featured-scroll::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

/* Auto-scroll controls */
.scroll-controls {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 15px;
}

.scroll-btn {
    background: rgba(30, 30, 46, 0.7);
    border: 1px solid rgba(106, 90, 205, 0.3);
    color: var(--accent);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.scroll-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: var(--glow);
}

/* Footer */
footer {
    background: rgba(10, 10, 19, 0.95);
    padding: 40px 0 20px;
    margin-top: 60px;
    border-top: 1px solid rgba(106, 90, 205, 0.3);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.footer-logo i {
    margin-right: 10px;
    color: var(--primary);
}

.footer-logo span {
    color: var(--secondary);
}

.footer-about p {
    color: var(--gray);
    line-height: 1.6;
    margin-bottom: 20px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(30, 30, 46, 0.7);
    color: var(--accent);
    transition: all 0.3s;
    text-decoration: none;
}

.social-link:hover {
    background: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--glow);
}

.footer-heading {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--accent);
    position: relative;
    padding-bottom: 10px;
}

.footer-heading::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 2px;
    background: var(--secondary);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--gray);
    text-decoration: none;
    transition: all 0.3s;
    display: flex;
    align-items: center;
}

.footer-links a i {
    margin-right: 10px;
    font-size: 14px;
    color: var(--primary);
}

.footer-links a:hover {
    color: var(--secondary);
    transform: translateX(5px);
}

.footer-newsletter p {
    color: var(--gray);
    margin-bottom: 20px;
    line-height: 1.6;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.newsletter-form input {
    padding: 12px 15px;
    border-radius: 6px;
    background: rgba(30, 30, 46, 0.7);
    border: 1px solid rgba(106, 90, 205, 0.3);
    color: var(--accent);
    outline: none;
}

.newsletter-form input:focus {
    border-color: var(--secondary);
}

.newsletter-form input::placeholder {
    color: var(--gray);
}

.newsletter-form button {
    padding: 12px 15px;
    border-radius: 6px;
    background: var(--gradient);
    color: white;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.newsletter-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(93, 108, 255, 0.5);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(106, 90, 205, 0.2);
}

.footer-bottom p {
    color: var(--gray);
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .hero-content {
        gap: 30px;
    }
    
    .anime-poster {
        width: 240px;
    }
    
    .search-container {
        width: 400px;
    }
}

@media (max-width: 992px) {
    .header-content {
        padding: 0 15px;
    }
    
    .nav-links {
        display: none;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .hero-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .anime-poster {
        width: 280px;
        margin-bottom: 30px;
    }
    
    .anime-meta, .anime-tags, .action-buttons {
        justify-content: center;
    }
    
    .search-container {
        width: 300px;
    }
    
    .mobile-search-toggle {
        display: block;
    }
    
    .desktop-search {
        display: none;
    }
    
    .episode-cards {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .anime-title {
        font-size: 28px;
    }
    
    .anime-poster {
        width: 240px;
    }
    
    .search-container {
        width: 100%;
        max-width: 100%;
    }
    
    .section-title h2 {
        font-size: 24px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .featured-scroll {
        scroll-snap-type: none;
    }
}

@media (max-width: 576px) {
    .anime-title {
        font-size: 24px;
    }
    
    .anime-poster {
        width: 200px;
    }
    
    .watch-btn, .save-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .episode-cards {
        grid-template-columns: 1fr;
    }
    
    .genre-filter {
        padding-bottom: 20px;
    }
    
    .scroll-controls {
        display: none;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

/* Utility Classes */
.text-gradient {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 16px;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 8px 25px rgba(93, 108, 255, 0.5);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(93, 108, 255, 0.7);
}

.btn-secondary {
    background: rgba(30, 30, 46, 0.7);
    color: var(--accent);
    border: 1px solid rgba(106, 90, 205, 0.3);
}

.btn-secondary:hover {
    background: rgba(93, 108, 255, 0.2);
    border-color: var(--secondary);
}

.mt-20 {
    margin-top: 20px;
}

.mt-30 {
    margin-top: 30px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-30 {
    margin-bottom: 30px;
}

.text-center {
    text-align: center;
}

.text-sm {
    font-size: 14px;
}

.opacity-80 {
    opacity: 0.8;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(30, 30, 46, 0.95);
    backdrop-filter: blur(10px);
    color: var(--accent);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 350px;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid var(--primary);
}

.toast i {
    color: var(--primary);
    font-size: 18px;
}

.toast.success {
    border-left-color: #4ade80;
}

.toast.success i {
    color: #4ade80;
}

.toast.error {
    border-left-color: #f87171;
}

.toast.error i {
    color: #f87171;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 999;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(30, 30, 46, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(106, 90, 205, 0.3);
    transition: all 0.3s;
}

.dark-mode-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.dark-mode-toggle i {
    font-size: 20px;
    color: var(--accent);
}

/* Scroll to Top Button */
.scroll-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(30, 30, 46, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(106, 90, 205, 0.3);
    transition: all 0.3s;
    opacity: 0;
    visibility: hidden;
}

.scroll-top.active {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.scroll-top i {
    font-size: 20px;
    color: var(--accent);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}