/* Reset and Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --netflix-red: #e50914;
    --netflix-dark-red: #b20710;
    --netflix-bg: #141414;
    --netflix-dark: #000000;
    --netflix-gray: #333333;
    --netflix-light-gray: #757575;
    --netflix-white: #ffffff;
    --netflix-hover: rgba(255, 255, 255, 0.1);
    --netflix-card-hover: rgba(255, 255, 255, 0.05);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Base Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--netflix-bg);
    color: var(--netflix-white);
    overflow-x: hidden;
    line-height: 1.4;
}

html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: linear-gradient(180deg, rgba(20,20,20,0.9) 0%, transparent 100%);
    z-index: 1000;
    transition: all var(--transition-normal);
}

.navbar.scrolled {
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 4%;
    max-width: 1920px;
    margin: 0 auto;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 50px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--netflix-red);
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: all var(--transition-fast);
}

.logo:hover {
    transform: scale(1.05);
}

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

.nav-link {
    color: #e5e5e5;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    padding: 10px 0;
}

.nav-link:hover,
.nav-link.active {
    color: var(--netflix-white);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--netflix-red);
    border-radius: 2px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Search */
.search-container {
    position: relative;
}

.search-input {
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    padding: 10px 40px 10px 15px;
    font-size: 14px;
    outline: none;
    transition: all var(--transition-normal);
    width: 280px;
}

.search-input:focus {
    border-color: var(--netflix-red);
    background: rgba(0, 0, 0, 0.9);
    box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.2);
}

.search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    transition: color var(--transition-normal);
}

.search-btn:hover {
    color: var(--netflix-red);
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    max-height: 300px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
    z-index: 1002;
    margin-top: 5px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.search-suggestions.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.suggestion-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Notifications */
.notifications {
    position: relative;
    cursor: pointer;
}

.notification-btn {
    background: none;
    border: none;
    color: #e5e5e5;
    font-size: 18px;
    cursor: pointer;
    transition: all var(--transition-normal);
    padding: 8px;
    border-radius: 50%;
}

.notification-btn:hover {
    color: var(--netflix-white);
    background: var(--netflix-hover);
}

.notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--netflix-red);
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* User Menu */
.user-menu {
    position: relative;
    cursor: pointer;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all var(--transition-normal);
}

.user-avatar:hover {
    transform: scale(1.1);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    min-width: 220px;
    padding: 15px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
    z-index: 1001;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    margin-top: 10px;
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-info {
    padding: 0 20px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
}

.user-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 5px;
}

.user-plan {
    font-size: 0.85rem;
    color: var(--netflix-light-gray);
}

.dropdown-menu {
    padding: 0 10px;
}

.dropdown-menu a {
    display: block;
    color: #e5e5e5;
    text-decoration: none;
    padding: 10px 10px;
    border-radius: 4px;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
}

.dropdown-menu a:hover {
    background: var(--netflix-hover);
    color: var(--netflix-white);
}

.dropdown-menu hr {
    border: none;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 10px 0;
}

.sign-out {
    color: var(--netflix-red) !important;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background var(--transition-fast);
}

.mobile-menu-btn:hover {
    background: var(--netflix-hover);
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    background-size: cover;
    background-position: center;
    z-index: -2;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        transparent 100%
    );
    z-index: -1;
}

.hero-content {
    padding: 0 4%;
    max-width: 1920px;
    margin: 0 auto;
    width: 100%;
    z-index: 1;
}

.hero-info {
    max-width: 600px;
    animation: fadeInUp 1s ease-out;
}

.hero-category {
    color: var(--netflix-red);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.1;
    background: linear-gradient(135deg, #ffffff 0%, #e5e5e5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 25px;
    color: #e5e5e5;
    max-width: 500px;
}

.hero-meta {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 30px;
    font-size: 1rem;
    color: #ccc;
}

.hero-rating {
    color: #ffd700;
}

.hero-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Buttons */
.btn-primary {
    background: var(--netflix-white);
    color: var(--netflix-dark);
    border: none;
    padding: 15px 30px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: var(--netflix-white);
    border: none;
    padding: 15px 30px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-icon {
    background: rgba(255, 255, 255, 0.1);
    color: var(--netflix-white);
    border: 2px solid rgba(255, 255, 255, 0.3);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--netflix-white);
    transform: scale(1.1);
}

/* Main Content */
.main-content {
    position: relative;
    z-index: 2;
    background: var(--netflix-bg);
    padding-top: 0;
}

/* Content Rows */
.content-row {
    margin-bottom: 50px;
    padding: 0 4%;
}

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

.row-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--netflix-white);
}

.see-all {
    color: var(--netflix-light-gray);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition-normal);
}

.see-all:hover {
    color: var(--netflix-white);
}

/* Carousel */
.row-content {
    position: relative;
}

.carousel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 10px;
}

.carousel::-webkit-scrollbar {
    display: none;
}

.carousel-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--netflix-light-gray);
    font-size: 1.1rem;
}

/* Anime Card */
.anime-card {
    position: relative;
    background: var(--netflix-gray);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-normal);
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

.anime-card:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.anime-card-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: all var(--transition-normal);
}

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

.anime-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 60%,
        rgba(0, 0, 0, 0.8) 100%
    );
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.anime-card:hover .anime-card-overlay {
    opacity: 1;
}

.anime-card-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.anime-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.anime-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--netflix-light-gray);
    margin-bottom: 10px;
}

.anime-card-year {
    font-weight: 500;
}

.anime-card-rating {
    color: #ffd700;
    font-weight: 600;
}

.anime-card-description {
    font-size: 0.85rem;
    color: #ccc;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 15px;
}

.anime-card-actions {
    display: flex;
    gap: 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-normal);
}

.anime-card:hover .anime-card-actions {
    opacity: 1;
    transform: translateY(0);
}

.card-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex: 1;
    text-align: center;
}

.card-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--netflix-white);
}

.card-btn.primary {
    background: var(--netflix-red);
    border-color: var(--netflix-red);
}

.card-btn.primary:hover {
    background: var(--netflix-dark-red);
}

/* Footer */
.footer {
    background: var(--netflix-dark);
    padding: 50px 4% 30px;
    margin-top: 100px;
}

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

.footer-section h3,
.footer-section h4 {
    margin-bottom: 20px;
    color: var(--netflix-white);
}

.footer-section h3 {
    font-size: 1.5rem;
    color: var(--netflix-red);
}

.footer-section h4 {
    font-size: 1.1rem;
}

.footer-section p {
    color: var(--netflix-light-gray);
    line-height: 1.6;
    margin-bottom: 20px;
}

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

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

.footer-section ul li a {
    color: var(--netflix-light-gray);
    text-decoration: none;
    transition: color var(--transition-normal);
}

.footer-section ul li a:hover {
    color: var(--netflix-white);
}

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

.social-link {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: var(--netflix-gray);
    color: white;
    text-align: center;
    line-height: 40px;
    border-radius: 50%;
    text-decoration: none;
    transition: all var(--transition-normal);
    font-size: 1.2rem;
}

.social-link:hover {
    background: var(--netflix-red);
    transform: translateY(-3px);
}

.footer-bottom {
    max-width: 1200px;
    margin: 30px auto 0;
    padding-top: 30px;
    border-top: 1px solid var(--netflix-gray);
    text-align: center;
    color: var(--netflix-light-gray);
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .carousel {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .search-input {
        width: 200px;
    }

    .nav-container {
        padding: 0 20px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    .content-row {
        padding: 0 20px;
        margin-bottom: 30px;
    }

    .carousel {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .anime-card {
        min-height: 250px;
    }

    .anime-card-image {
        height: 180px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .carousel {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .search-input {
        width: 150px;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.skeleton {
    background: linear-gradient(90deg, #333 25%, #444 50%, #333 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Error States */
.error-message {
    text-align: center;
    padding: 40px;
    color: var(--netflix-light-gray);
}

.error-icon {
    font-size: 3rem;
    color: var(--netflix-red);
    margin-bottom: 20px;
}

.retry-btn {
    background: var(--netflix-red);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background var(--transition-normal);
}

.retry-btn:hover {
    background: var(--netflix-dark-red);
}