* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #0a0a12;
    font-family: 'Inter', sans-serif;
    color: #ffffff;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 80px;
}

:root {
    --primary: #e50914;
    --primary-dark: #b00710;
    --bg-base: #0a0a12;
    --bg-surface: #14141e;
    --bg-surface-hover: #1f1f2d;
    --text-muted: #9a9ab0;
    --border-dim: #2a2a36;
}

.skeleton {
    background: linear-gradient(90deg, #1e1e2a 25%, #2a2a36 50%, #1e1e2a 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.top-search-bar {
    display: flex;
    align-items: center;
    max-width: 600px;
    margin: 1rem auto 1.5rem;
    background: #1a1a26;
    border: 1px solid #2a2a36;
    border-radius: 40px;
    padding: 0.4rem 0.4rem 0.4rem 1.2rem;
    width: 90%;
}

.top-search-bar svg {
    width: 20px;
    height: 20px;
    stroke: #a0a0b2;
    margin-right: 8px;
    flex-shrink: 0;
}

.top-search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.7rem 0;
    font-size: 1rem;
    color: white;
    outline: none;
    min-width: 0;
}

.top-search-bar input::placeholder {
    color: #6f6f8a;
}

.search-text-btn {
    background: #e50914;
    border: none;
    color: white;
    font-weight: 700;
    padding: 0.6rem 1.5rem;
    border-radius: 40px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
    margin-left: 8px;
}

.search-text-btn:hover {
    background: #b00710;
}

.logo-container {
    text-align: center;
    margin: 0.5rem 0 0.5rem;
}

.logo {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.hero-section {
    margin: 0 5% 2.5rem;
    border-radius: 24px;
    overflow: hidden;
    background: #1c1c28;
}

.hero-slide {
    background-size: cover !important;
    background-position: center 30% !important;
    padding: 2rem 2rem;
    min-height: 380px;
    display: flex;
    align-items: center;
}

.hero-text {
    max-width: 550px;
}

.hero-badge {
    background: var(--primary);
    padding: 0.3rem 1.1rem;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-block;
    margin-bottom: 1rem;
}

.hero-text h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.8rem;
    text-shadow: 0 5px 20px black;
}

.hero-text p {
    font-size: 1.1rem;
    color: #d2d2e0;
    margin-bottom: 1.8rem;
    max-width: 500px;
}

.btn-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
    border: none;
    padding: 0.8rem 2.2rem;
    border-radius: 40px;
    font-weight: 700;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.section-header {
    margin: 2rem 5% 1rem;
}

.section-header h2 {
    font-size: 1.7rem;
    font-weight: 700;
    color: #ffffff;
}

.movie-row {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem 5% 2rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.movie-row::-webkit-scrollbar {
    height: 5px;
}

.movie-row::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 20px;
}

.movie-card {
    flex: 0 0 auto;
    width: 150px;
    border-radius: 16px;
    background: var(--bg-surface);
    overflow: hidden;
    transition: transform 0.3s ease;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    position: relative;
}

@media (min-width: 480px) {
    .movie-card {
        width: 170px;
    }
}

.movie-card:hover {
    transform: scale(1.03) translateY(-5px);
}

.poster {
    width: 100%;
    aspect-ratio: 2/3;
    background-color: #2a2a36;
    position: relative;
    overflow: hidden;
}

.poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.3s ease;
}

.poster.blur img {
    filter: blur(5px);
}

.poster-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.poster.blur .poster-overlay {
    opacity: 1;
    pointer-events: auto;
}

.overlay-btn {
    background: #e50914;
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 40px;
    font-weight: 700;
    font-size: 0.9rem;
    width: 80%;
    max-width: 130px;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
}

.overlay-btn.secondary {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.overlay-btn:hover {
    background: #b00710;
}
.overlay-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.card-info {
    padding: 0.8rem 0.8rem 1rem;
}

.card-info h4 {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    display: flex;
    gap: 0.8rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.skeleton-poster {
    width: 100%;
    aspect-ratio: 2/3;
    background: #1e1e2a;
}

#detail-view {
    margin: 2rem 5%;
    background: linear-gradient(145deg, #14141e, #0e0e16);
    border-radius: 30px;
    padding: 2rem;
    border: 1px solid rgba(229, 9, 20, 0.2);
}

.nav-back {
    margin-bottom: 2rem;
}

.btn-small {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
}

#anime-info.card {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.detail-poster {
    width: 250px;
    border-radius: 20px;
    overflow: hidden;
    background: #2a2a36;
}

.detail-poster img {
    width: 100%;
    height: auto;
    display: block;
}

.detail-content {
    flex: 1;
}

.detail-content h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.detail-meta {
    display: flex;
    gap: 2rem;
    color: #a0a0b2;
    margin-bottom: 1.5rem;
}

.detail-description {
    color: #c5c5d6;
    line-height: 1.7;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.detail-actions {
    display: flex;
    gap: 1rem;
}

#watch-view {
    margin: 1rem 4% 3rem;
    width: 92%;
}

.video-wrapper {
    width: 100%;
    aspect-ratio: 16/9;
    background: #0a0a12;
    border-radius: 20px;
    overflow: hidden;
    margin: 1rem 0 1.5rem;
    border: 1px solid #2a2a36;
}

.video-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
}

.watch-controls {
    background: linear-gradient(145deg, #14141e, #0e0e16);
    border-radius: 24px;
    padding: 1.5rem;
    border: 1px solid rgba(229, 9, 20, 0.2);
    width: 100%;
    overflow-x: hidden;
}

.video-main-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1.2rem;
    word-break: break-word;
}

.server-section {
    margin-bottom: 1.5rem;
}

.server-label {
    font-weight: 600;
    color: #a0a0b2;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
}

.server-list {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.server-btn {
    background: #2a2a36;
    border: none;
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid #3a3a4a;
    flex: 0 1 auto;
}

.server-btn.active {
    background: #e50914;
    border-color: #e50914;
}

.episode-nav-section {
    margin-top: 1.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 1rem 0 0.8rem;
}

.bar-accent {
    width: 5px;
    height: 24px;
    background: #e50914;
    border-radius: 5px;
}

.episode-nav-controls {
    display: flex;
    gap: 0.8rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.episode-nav-controls button {
    flex: 1 1 auto;
    min-width: 120px;
    white-space: nowrap;
}

.episode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
    gap: 0.6rem;
    margin-top: 1rem;
    width: 100%;
}

.eps-btn {
    background: #2a2a36;
    border: none;
    color: white;
    aspect-ratio: 1/1;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid #3a3a4a;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.eps-btn.active {
    background: #e50914;
    border-color: #e50914;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #12121a;
    border-top: 1px solid #2a2a35;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.6rem 1rem 1.2rem;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #9a9ab0;
    transition: color 0.2s ease;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 500;
}

.nav-item.active {
    color: #e50914;
}

.nav-item svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

.nav-item span {
    font-size: 0.7rem;
    font-weight: 600;
}

.hidden {
    display: none !important;
}

.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #14141e;
    padding: 1rem 2rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
    border: 1px solid #e50914;
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-indicator.active {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #2a2a36;
    border-top-color: #e50914;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.detail-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0 2rem;
}

.genre-tag {
    background: #2a2a36;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #e50914;
    border: 1px solid #3a3a4a;
}

#search-view {
    margin: 2rem 5%;
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
}

@media (min-width: 768px) {
    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }
}

.movie-grid .movie-card {
    width: 100%;
}
