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

:root {
    --primary-color: #0a0a0a;
    --secondary-color: #151515;
    --accent-color: #ff9d2b;
    --text-color: #ffffff;
    --text-secondary: #999999;
    --border-color: #222222;
    --success-color: #4CAF50;
    --warning-color: #FFC107;
    --danger-color: #f44336;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--primary-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--text-color);
    text-decoration: none;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    outline: none;
}

/* Navbar - Plex Style */
.navbar {
    background: var(--primary-color);
    backdrop-filter: blur(10px);
    padding: 1.2rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.navbar-container {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    gap: 2rem;
    flex-wrap: wrap;
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-color);
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.navbar-logo i {
    font-size: 1.8rem;
}

.navbar-menu {
    display: flex;
    gap: 2.5rem;
    flex: 1;
    justify-content: flex-end;
}

.nav-link {
    color: var(--text-secondary);
    transition: var(--transition);
    padding: 0.5rem 0;
    border-radius: 0;
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
    border-bottom: 2px solid transparent;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: var(--transition);
}

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

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

.search-container {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    padding: 0.7rem 1.2rem;
    min-width: 220px;
    transition: var(--transition);
}

.search-container:focus-within {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(255, 157, 43, 0.2);
}

.search-container input {
    background: none;
    border: none;
    color: var(--text-color);
    padding: 0.5rem 0;
    outline: none;
    flex: 1;
    font-size: 0.9rem;
}

.search-container input::placeholder {
    color: var(--text-secondary);
}

.search-container button {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-weight: 600;
}

.search-container button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.4);
}


/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.login-button,
.logout-button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.login-button:hover,
.logout-button:hover {
    background-color: #b8070d;
    transform: scale(1.05);
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Featured Slider - Plex Style */
.featured-slider {
    margin-bottom: 3rem;
    border-radius: 0;
    overflow: hidden;
    height: 450px;
}

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

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

.slider-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slider-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(10, 10, 10, 0.9) 0%, rgba(10, 10, 10, 0.5) 40%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 4rem 3rem;
    color: white;
}

.slider-overlay h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.slider-overlay p {
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    max-width: 500px;
    color: rgba(255, 255, 255, 0.9);
}

.cta-button {
    background: linear-gradient(135deg, var(--accent-color), #ff9068);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    width: fit-content;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.3);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(255, 107, 53, 0.4);
}

/* Categories */
.categories {
    margin-bottom: 3rem;
}

.category-buttons {
    display: flex;
    gap: 1.2rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-behavior: smooth;
}

.category-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    font-weight: 600;
    font-size: 0.9rem;
}

.category-btn:hover {
    border-color: var(--accent-color);
    background: rgba(255, 157, 43, 0.1);
    color: var(--accent-color);
}

.category-btn.active {
    background: linear-gradient(135deg, var(--accent-color), #ff9068);
    border-color: transparent;
    color: white;
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.3);
}

/* Content Grid - Plex Style Carousels */
.content-section {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 700;
    letter-spacing: -0.3px;
    border: none;
    padding: 0;
    display: block;
}

.section-header {
    margin-bottom: 2.5rem;
}

.section-header h1 {
    font-size: 2.8rem;
    color: var(--text-color);
    font-weight: 800;
    letter-spacing: -0.5px;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
}

.content-card {
    background: linear-gradient(135deg, var(--secondary-color) 0%, rgba(21, 21, 21, 0.8) 100%);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.content-card:hover {
    transform: scale(1.08) translateY(-6px);
    border-color: var(--accent-color);
    box-shadow: 0 12px 30px rgba(255, 157, 43, 0.3), inset 0 0 20px rgba(255, 157, 43, 0.1);
}

.card-poster {
    width: 100%;
    height: 240px;
    object-fit: cover;
    background: linear-gradient(135deg, #2a2a3e, #0f0f0f);
    position: relative;
    overflow: hidden;
}

.card-poster::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.5));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.content-card:hover .card-poster::after {
    opacity: 1;
}

.card-content {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.card-year {
    color: var(--text-secondary);
}

.card-rating {
    color: var(--accent-color);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.card-rating::before {
    content: '★';
    font-size: 0.9rem;
}

.card-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Filter Controls */
.filter-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.filter-controls select {
    background-color: #222;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.7rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-controls select:hover {
    border-color: var(--secondary-color);
}

.filter-controls select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 5px rgba(229, 9, 20, 0.3);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.page-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.page-btn:hover {
    background-color: #b8070d;
}

#pageInfo,
#pageInfoTv {
    color: var(--text-secondary);
}

/* Details Page */
.back-button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 4px;
    margin-bottom: 2rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.back-button:hover {
    background-color: #b8070d;
}

.details-container {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.5) 0%, rgba(15, 15, 15, 0.8) 100%);
    border-radius: 16px;
    padding: 3rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.details-header {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.details-poster {
    width: 280px;
    height: 420px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(255, 107, 53, 0.2), 0 0 40px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 107, 53, 0.3);
    transition: var(--transition);
}

.details-poster:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(255, 107, 53, 0.3), 0 0 60px rgba(0, 0, 0, 0.6);
}

.details-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.details-info h1 {
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 800;
    letter-spacing: -0.5px;
}

.rating-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.rating {
    background: linear-gradient(135deg, var(--accent-color), #ff9068);
    color: white;
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.vote-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.release-info {
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.genres {
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.description {
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 2rem;
    max-height: 180px;
    overflow-y: auto;
    font-size: 0.95rem;
}

.action-buttons {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.play-button,
.favorite-button {
    padding: 1rem 2rem;
    border-radius: 10px;
    border: none;
    font-weight: 700;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.7rem;
    cursor: pointer;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.play-button {
    background: linear-gradient(135deg, var(--accent-color), #ff9068);
    color: white;
    flex: 1;
    min-width: 200px;
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.3);
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 107, 53, 0.4);
}

.favorite-button {
    background: rgba(255, 107, 53, 0.15);
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
}

.favorite-button:hover {
    background: rgba(255, 107, 53, 0.25);
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.2);
}
    background-color: #b8070d;
    transform: scale(1.05);
}

.favorite-button {
    background-color: #222;
    color: var(--text-color);
    border: 2px solid var(--secondary-color);
}

.favorite-button:hover {
    background-color: var(--secondary-color);
    color: white;
}

.favorite-button.active {
    background-color: var(--secondary-color);
    color: white;
}

/* Player Section - Premium Design */
.player-section {
    margin-bottom: 3rem;
    padding: 2.5rem;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.6) 0%, rgba(15, 15, 15, 0.8) 100%);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.player-section h2 {
    margin-bottom: 2rem;
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.player-section h2::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, var(--accent-color), #ff9068);
    border-radius: 2px;
}

.source-selector {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.source-selector label {
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
}

.source-selector select {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(255, 144, 104, 0.05));
    color: var(--text-color);
    border: 1px solid var(--accent-color);
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    min-width: 200px;
    font-weight: 500;
    transition: var(--transition);
}

.source-selector select:hover {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15), rgba(255, 144, 104, 0.1));
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.2);
}

.source-selector select:focus {
    outline: none;
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
}

.player-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(135deg, #000000 0%, #1a1a2e 100%);
    box-shadow: 0 0 50px rgba(255, 107, 53, 0.1), inset 0 0 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 107, 53, 0.2);
}

.player-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
}

/* Subtitles Section */
.subtitles-section {
    margin-bottom: 3rem;
    padding: 2rem;
    background-color: #111;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.subtitles-section h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.subtitle-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.subtitle-controls select {
    background-color: #222;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

.download-btn {
    background-color: var(--success-color);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.download-btn:hover {
    opacity: 0.8;
}

.subtitle-display {
    background-color: #222;
    padding: 1rem;
    border-radius: 4px;
    color: var(--text-secondary);
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
}

/* Additional Info */
.additional-info {
    padding: 2rem;
    background-color: #111;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.additional-info h3 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}

.info-item h4 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.info-item p {
    color: var(--text-secondary);
}

/* Footer */
.footer {
    background-color: #0a0a0a;
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem;
    border-top: 2px solid var(--secondary-color);
    margin-top: 3rem;
}

.footer-content p {
    margin: 0.5rem 0;
}

.footer-content strong {
    color: var(--secondary-color);
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .navbar-container {
        flex-direction: column;
        gap: 1rem;
    }

    .navbar-menu {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
    }

    .search-container {
        width: 100%;
        min-width: unset;
    }

    .featured-slider {
        height: 250px;
    }

    .slider-overlay {
        padding: 1.5rem;
    }

    .slider-overlay h2 {
        font-size: 1.5rem;
    }

    .slider-overlay p {
        font-size: 0.9rem;
    }

    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .details-header {
        grid-template-columns: 1fr;
    }

    .details-poster {
        width: 100%;
        height: auto;
    }

    .details-info h1 {
        font-size: 1.8rem;
    }

    .filter-controls {
        flex-direction: column;
    }

    .filter-controls select {
        width: 100%;
    }

    .category-buttons {
        justify-content: flex-start;
    }

    .main-content {
        padding: 1rem;
    }

    .details-container {
        padding: 1rem;
    }

    .player-section,
    .subtitles-section,
    .additional-info {
        padding: 1rem;
    }

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

@media (max-width: 480px) {
    .navbar-logo {
        font-size: 1.2rem;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .section-header h1 {
        font-size: 1.8rem;
    }

    .content-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .card-poster {
        height: 250px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .play-button,
    .favorite-button {
        width: 100%;
        justify-content: center;
    }

    .filter-controls select {
        font-size: 0.9rem;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 1rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

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

::-webkit-scrollbar-track {
    background-color: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background-color: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #b8070d;
}
