/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f0f23;
    color: white;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.play-icon {
    width: 2rem;
    height: 2rem;
    color: #a855f7;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #c084fc;
    background: rgba(168, 85, 247, 0.1);
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    color: #c084fc;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.back-btn:hover {
    background: rgba(168, 85, 247, 0.2);
    color: white;
}

.back-btn svg {
    width: 1rem;
    height: 1rem;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-btn span {
    width: 1.5rem;
    height: 2px;
    background: white;
    transition: all 0.3s ease;
}

.mobile-menu {
    display: none;
    background: rgba(17, 24, 39, 0.98);
    backdrop-filter: blur(8px);
    position: fixed;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99;
    padding: 1rem;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.mobile-menu.active {
    transform: translateY(0);
}

.mobile-nav-link {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.mobile-nav-link:hover {
    color: #c084fc;
    background: rgba(168, 85, 247, 0.1);
}

/* Hero Section */
.hero {
    background: #0f0f23;
    padding: 5rem 0;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 42rem;
    margin: 0 auto;
}

/* Sections */
.anime-section,
.episodes-section {
    padding: 3rem 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: white;
}

/* Anime Grid */
.anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.anime-card {
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid rgba(75, 85, 99, 1);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.anime-card:hover {
    border-color: rgba(75, 85, 99, 0.6);
    transform: translateY(-2px);
}

.anime-image-container {
    position: relative;
    overflow: hidden;
}

.anime-image {
    width: 100%;
    height: 12rem;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.anime-card:hover .anime-image {
    transform: scale(1.05);
}

.anime-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.anime-card:hover .anime-overlay {
    opacity: 1;
}

.play-overlay-icon {
    width: 3rem;
    height: 3rem;
    color: white;
}

.anime-content {
    padding: 1rem;
}

.anime-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.5rem;
    text-transform: capitalize;
}

.anime-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.anime-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
}

.meta-icon {
    width: 1rem;
    height: 1rem;
}

.year-icon {
    color: #a855f7;
}

.rating-icon {
    color: #fbbf24;
}

.anime-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.genre-badge {
    background: rgba(168, 85, 247, 0.3);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.5);
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
}

.episode-badge {
    background: rgba(168, 85, 247, 0.3);
    color: #c084fc;
    border: 1px solid #a855f7;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Page Content */
.page-content {
    padding: 2rem 0;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.page-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.125rem;
}

/* Search */
.search-section {
    margin-bottom: 2rem;
}

.search-container {
    position: relative;
    max-width: 28rem;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: rgba(255, 255, 255, 0.5);
}

.search-input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(75, 85, 99, 1);
    border-radius: 0.5rem;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #a855f7;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: color 0.3s ease;
}

.search-clear:hover {
    color: white;
}

.search-clear svg {
    width: 1rem;
    height: 1rem;
}

/* Filter Section */
.filter-section {
    margin-bottom: 2rem;
}

.filter-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    margin-bottom: 1rem;
}

.alphabet-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid #a855f7;
    background: transparent;
    color: #c084fc;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    min-width: 3rem;
}

.filter-btn:hover:not(:disabled) {
    background: rgba(168, 85, 247, 0.2);
    border-color: #c084fc;
    color: white;
}

.filter-btn.active {
    background: #a855f7;
    color: white;
}

.filter-btn:disabled {
    border-color: rgba(75, 85, 99, 1);
    color: rgba(107, 114, 128, 1);
    cursor: not-allowed;
}

.filter-btn .loading-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid white;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.25rem;
}

/* Results Info */
.results-info {
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Loading States */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    color: white;
}

.spinner {
    width: 4rem;
    height: 4rem;
    border: 4px solid rgba(168, 85, 247, 0.2);
    border-top: 4px solid #a855f7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 0;
}

.search-loading-content {
    text-align: center;
}

.search-spinner {
    position: relative;
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1.5rem;
}

.spinner-ring {
    width: 100%;
    height: 100%;
    border: 4px solid rgba(168, 85, 247, 0.2);
    border-top: 4px solid #a855f7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1.5rem;
    height: 1.5rem;
    color: #a855f7;
    animation: pulse 2s ease-in-out infinite;
}

.search-loading-text h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.5rem;
}

.search-loading-text p {
    color: rgba(255, 255, 255, 0.7);
    animation: pulse 2s ease-in-out infinite;
}

.loading-dots {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.dot {
    width: 0.5rem;
    height: 0.5rem;
    background: #a855f7;
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem 0;
    color: rgba(255, 255, 255, 0.5);
}

.no-results-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
}

.no-results h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.clear-filters-btn {
    background: #a855f7;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 1rem;
    transition: background 0.3s ease;
}

.clear-filters-btn:hover {
    background: #9333ea;
}

/* Anime Page */
.anime-page {
    background: linear-gradient(135deg, #1e293b, #581c87, #1e293b);
    min-height: 100vh;
}

.anime-info {
    padding: 3rem 0;
}

.anime-details {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    align-items: start;
}

.anime-cover {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    overflow: hidden;
}

.anime-cover img {
    width: 100%;
    height: 24rem;
    object-fit: cover;
}

.anime-info-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.anime-title-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    text-transform: capitalize;
    margin-bottom: 1rem;
}

.anime-meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.anime-meta-info .meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.anime-meta-info .meta-icon {
    width: 1rem;
    height: 1rem;
}

.time-icon {
    color: #10b981;
}

.anime-genres-section {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.anime-genre-badge {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.anime-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.125rem;
    line-height: 1.7;
}

.play-button {
    background: #a855f7;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.3s ease;
    text-decoration: none;
    width: fit-content;
}

.play-button:hover {
    background: #9333ea;
}

.play-button svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Episodes */
.season-section {
    margin-bottom: 3rem;
}

.season-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1.5rem;
}

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.episode-card {
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid rgba(75, 85, 99, 1);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.episode-card:hover {
    border-color: #a855f7;
}

.episode-image-container {
    position: relative;
    height: 8rem;
    background: rgba(51, 65, 85, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.episode-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.episode-card:hover .episode-overlay {
    opacity: 1;
}

.episode-duration {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
}

.episode-info {
    padding: 1rem;
}

.episode-title {
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.episode-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    line-height: 1.4;
}

/* Watch Page */
.watch-page {
    background: black;
    min-height: 100vh;
}

.watch-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
}

.watch-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.episode-info {
    text-align: right;
    color: white;
}

.episode-info h1 {
    font-size: 1.125rem;
    font-weight: 600;
    text-transform: capitalize;
}

.episode-info p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.video-container {
    position: relative;
    width: 100%;
    height: 100vh;
    background: black;
}

.video-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: black;
    z-index: 10;
}

.video-loading-content {
    text-align: center;
    color: white;
}

.loading-episode-info {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.5rem;
}

.video-player {
    width: 100%;
    height: 100%;
    border: none;
}

.episode-navigation {
    background: #1e293b;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.navigation-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 0;
}

.nav-button-container {
    flex: 1;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid #a855f7;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.nav-button:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: #c084fc;
}

.nav-button svg {
    width: 1rem;
    height: 1rem;
}

.next-button {
    margin-left: auto;
}

.current-episode {
    text-align: center;
    color: white;
}

.current-episode h3 {
    font-weight: 600;
}

.current-episode p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

.episode-list-section {
    background: #1e293b;
    padding: 2rem 0;
}

.episode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.episode-grid-card {
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid rgba(75, 85, 99, 1);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.episode-grid-card:hover {
    border-color: #a855f7;
}

.episode-grid-card.current {
    border-color: #c084fc;
    background: rgba(168, 85, 247, 0.3);
}

.episode-grid-header {
    padding: 0.5rem;
    text-align: center;
}

.episode-grid-title {
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
}

.episode-grid-content {
    padding: 0 0.5rem 0.5rem;
}

.episode-grid-thumbnail {
    aspect-ratio: 16/9;
    background: rgba(51, 65, 85, 1);
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.episode-grid-duration {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    text-align: center;
}

/* Footer */
.footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(8px);
    margin-top: 5rem;
}

.footer-content {
    text-align: center;
    padding: 2rem 0;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.footer-logo .play-icon {
    width: 1.5rem;
    height: 1.5rem;
    color: #a855f7;
}

.footer-logo span {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.footer p {
    color: rgba(255, 255, 255, 0.6);
}

/* Animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-up {
    animation: slideUp 0.6s ease-out forwards;
    opacity: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .mobile-menu {
        display: block;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .anime-details {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .anime-title-section h1 {
        font-size: 2rem;
    }
    
    .navigation-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-button-container {
        width: 100%;
    }
    
    .nav-button {
        width: 100%;
        justify-content: center;
    }
    
    .next-button {
        margin-left: 0;
    }
    
    .alphabet-filter {
        justify-content: center;
    }
    
    .page-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .anime-grid {
        grid-template-columns: 1fr;
    }
    
    .episodes-grid {
        grid-template-columns: 1fr;
    }
    
    .episode-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .hero {
        padding: 3rem 0;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
}

.episode-thumb {
    object-fit: cover;
    width: 100%;
    height: 100%;
}