:root {
    --primary-color: #6366f1; /* Electric indigo/purple */
    --primary-hover: #4f46e5;
    --primary-gradient: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
    --background: #09090b;
    --surface: rgba(24, 24, 27, 0.6);
    --surface-light: rgba(39, 39, 42, 0.8);
    --surface-glass: rgba(24, 24, 27, 0.4);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.2);
    --success: #10b981;
    --danger: #ef4444;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    background-image: radial-gradient(circle at top right, rgba(99, 102, 241, 0.1), transparent 40%),
                      radial-gradient(circle at bottom left, rgba(236, 72, 153, 0.1), transparent 40%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

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

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: 6px;
    border: 2px solid var(--background);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--surface-light) var(--background);
}

/* Navbar */
.navbar {
    background: rgba(9, 9, 11, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 2rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-container {
    max-width: 1800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-primary);
    cursor: pointer;
    transition: transform 0.3s;
}

.logo i {
    color: var(--primary-color);
    font-size: 1.8rem;
}

.logo strong {
    font-weight: 700;
}

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

.hamburger-btn {
    display: none;
}

@media (max-width: 1200px) {
    .hamburger-btn {
        display: flex;
    }
}

.search-container {
    position: relative;
}

.nav-categories {
    display: flex;
    gap: 0.5rem;
}

.nav-categories a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s;
    position: relative;
}

.nav-categories a:hover {
    color: var(--text-primary);
    background: var(--surface-light);
}

.nav-categories a.active {
    color: var(--text-primary);
    background: var(--surface-light);
}

.nav-categories a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background: var(--primary-color);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    width: 350px;
    transition: all 0.3s;
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-box i {
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

.search-box input {
    background: none;
    border: none;
    color: var(--text-primary);
    outline: none;
    width: 100%;
    font-size: 0.95rem;
}

.icon-btn {
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--surface-light);
    border-color: var(--primary-color);
}

/* Filter Sidebar */
.filter-sidebar {
    position: fixed;
    right: -350px;
    top: 0;
    width: 350px;
    height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--border-color);
    z-index: 1100;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.filter-sidebar.active {
    right: 0;
    box-shadow: -5px 0 25px rgba(0,0,0,0.5);
}

/* Hamburger Sidebar */
.hamburger-sidebar {
    position: fixed;
    left: -350px;
    top: 0;
    width: 350px;
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border-color);
    z-index: 1100;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.hamburger-sidebar.active {
    left: 0;
    box-shadow: 5px 0 25px rgba(0,0,0,0.5);
}

.hamburger-content {
    padding: 1rem;
}

.hamburger-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 1rem;
}

.hamburger-item:hover {
    background: var(--surface-light);
    color: var(--primary-color);
}

.hamburger-item i {
    width: 24px;
    text-align: center;
    font-size: 1.2rem;
}

.hamburger-divider {
    height: 1px;
    background: var(--border-color);
    margin: 1rem 0;
}

/* Search History Dropdown */
.search-history-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.history-item {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid var(--border-color);
}

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

.history-item:hover {
    background: var(--surface-light);
    color: var(--primary-color);
}

.history-item i {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.filter-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: var(--text-primary);
}

.filter-content {
    padding: 1.5rem;
}

.filter-section {
    margin-bottom: 1.5rem;
}

.filter-section label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.filter-section select {
    width: 100%;
    background: var(--background);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-section select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Buttons */
.btn-primary, .btn-secondary {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 0.75rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: var(--surface-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--background);
}

/* Main Content */
.main-content {
    max-width: 1800px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 300px);
}

.content-section {
    margin-bottom: 3rem;
}

/* Recent Section - Only 1 Row */
.recent-section .recent-grid {
    display: flex !important;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 1.5rem;
    padding: 1rem 0;
    scroll-behavior: smooth;
}

.recent-section .recent-grid::-webkit-scrollbar {
    height: 8px;
}

.recent-section .recent-grid::-webkit-scrollbar-track {
    background: var(--surface);
    border-radius: 4px;
}

.recent-section .recent-grid::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.recent-section .recent-grid .video-card {
    flex-shrink: 0;
    width: 200px;
}

.recent-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-history {
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    width: 250px;
    transition: all 0.3s;
}

.search-history:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.section-header h2 i {
    color: var(--primary-color);
}

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

.text-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.text-btn:hover {
    color: var(--primary-color);
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    animation: fadeIn 0.5s ease;
}

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

.video-card {
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.video-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(99, 102, 241, 0.2);
    border-color: var(--border-hover);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
}

.thumbnail-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
}

.thumbnail-placeholder i {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    opacity: 0.3;
}

.sender-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 4px 15px rgba(0,0,0,0.6);
    letter-spacing: -0.5px;
    z-index: 1;
}

/* Fades out when a real thumbnail frame is revealed */
.thumb-overlay-logo {
    transition: opacity 0.4s ease;
    opacity: 1;
}

.duration-badge {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.video-card-content {
    padding: 1rem;
}

.video-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.channel-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.video-date {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.video-card-description {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

.more-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.85rem;
    margin-left: 0.25rem;
    padding: 0;
    text-decoration: underline;
    transition: opacity 0.2s;
}

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

.more-btn-modal {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.95rem;
    margin-left: 0.5rem;
    padding: 0;
    text-decoration: underline;
    transition: opacity 0.2s;
}

.more-btn-modal:hover {
    opacity: 0.8;
}

/* Recent Grid Compact (only 1 row on home) */
.recent-grid-compact {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    overflow: hidden;
}

@media (max-width: 1400px) {
    .recent-grid-compact {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .recent-grid-compact {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--surface-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state p {
    margin-top: 1rem;
    color: var(--text-secondary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 0;
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-secondary);
    opacity: 0.5;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
}

/* Load More */
.load-more-container {
    text-align: center;
    margin-top: 2rem;
}

/* Footer */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

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

.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-section p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

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

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

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

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.social-links a:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.disclaimer {
    font-size: 0.85rem;
    line-height: 1.6;
}

.footer-bottom {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Video Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
}

.modal.active {
    display: block;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    max-width: 1200px;
    margin: 2rem auto;
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.8);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
}

.modal-close:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.video-player-container {
    background: black;
    position: relative;
}

.video-player-container video {
    width: 100%;
    max-height: 70vh;
    display: block;
}

.video-details {
    padding: 2rem;
}

.video-meta h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.video-info-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.video-info-row span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.video-details #videoDescription {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.video-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-btn {
    padding: 0.75rem 1.5rem;
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.action-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.quality-selector-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.quality-selector-container label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.quality-selector {
    background: var(--background);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.quality-selector:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Info Modal */
.info-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 2100;
    align-items: center;
    justify-content: center;
}

.info-modal.active {
    display: flex;
}

.info-modal-content {
    background: var(--surface);
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 16px;
    padding: 2rem;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

.info-modal-content h2 {
    margin-bottom: 1rem;
}

.info-modal-content p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

/* Live TV Styles */
.live-channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.live-channel-card {
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.live-channel-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.2);
}

.live-channel-thumbnail {
    position: relative;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.live-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    color: white;
}

.live-badge .fa-circle {
    color: #ef4444;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.live-channel-info {
    padding: 1rem;
}

.live-channel-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

/* Local Videos Styles */
.local-folders-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.local-folder-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--surface);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.local-folder-card i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.local-folder-card span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.remove-folder-btn {
    background: var(--danger);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-folder-btn:hover {
    background: #dc2626;
}

.local-video-thumbnail {
    background: linear-gradient(135deg, #374151, #4b5563);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Settings Styles */
.settings-container {
    max-width: 800px;
    margin: 0 auto;
}

.settings-section {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.settings-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.setting-item {
    margin-bottom: 1.5rem;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label span {
    font-size: 1rem;
}

.setting-description {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.setting-select {
    width: 100%;
    padding: 0.75rem;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    margin-top: 0.5rem;
    cursor: pointer;
}

.setting-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.setting-input {
    width: 100%;
    padding: 0.75rem;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s;
}

.setting-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.tmdb-key-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
    width: 100%;
}

.btn-primary-inline {
    padding: 0.75rem 1.5rem;
    background: var(--primary-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary-inline:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.setting-item label:not(.checkbox-label) {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Filter Section Updates */
.filter-section .checkbox-label {
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .nav-categories {
        display: none;
    }
    
    .search-box {
        width: 250px;
    }
    
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .live-channels-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-container {
        padding: 0 1rem;
    }
}

/* Collapsible Local Folders */
.local-folder-section {
    margin-bottom: 2rem;
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.folder-header {
    padding: 1rem 1.5rem;
    background: var(--background);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.folder-header:hover {
    background: var(--surface);
}

.folder-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.folder-icon {
    font-size: 1.25rem;
    color: var(--primary-color);
    transition: transform 0.2s;
}

.folder-path {
    font-weight: 500;
    font-size: 1rem;
}

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

.folder-actions {
    display: flex;
    gap: 0.5rem;
}

.folder-action-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.folder-action-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.folder-videos {
    padding: 1.5rem;
}

.video-grid-local {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .video-grid-local {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
}

/* Folder Card Styles */
.folder-card {
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.folder-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    border-color: var(--primary-color);
}

.folder-card-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: linear-gradient(135deg, var(--surface-dark), var(--surface));
    display: flex;
    align-items: center;
    justify-content: center;
}

.folder-card-thumbnail i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    color: var(--primary-color);
    opacity: 0.6;
}

.folder-card-content {
    padding: 1rem;
}

.folder-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.folder-card-path {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.7;
    font-size: 0.8rem;
}

/* Back Button */
.btn-back {
    padding: 0.75rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-back:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateX(-4px);
}

/* Series Info Container */
.series-info-container {
    background: var(--surface);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    display: flex;
    gap: 2rem;
}

.series-info-poster {
    flex-shrink: 0;
    width: 200px;
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.series-info-poster i {
    font-size: 4rem;
    color: var(--text-secondary);
    opacity: 0.3;
}

.series-info-details {
    flex: 1;
}

.series-info-details h3 {
    font-size: 1.8rem;
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.series-info-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.series-info-meta span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.series-info-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 1rem;
}

/* Series Card for grid view */
.series-card {
    background: var(--surface-glass);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.series-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(99, 102, 241, 0.2);
    border-color: var(--border-hover);
}

.series-card-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background-size: cover;
    background-position: center;
    background-color: var(--surface-dark);
    overflow: hidden;
}

.series-card-content {
    padding: 1rem;
}

.series-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.series-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .series-info-container {
        flex-direction: column;
    }
    
    .series-info-poster {
        width: 100%;
        height: 400px;
    }
}

/* Mobile Optimizations (Screens <= 576px) */
@media (max-width: 576px) {
    .navbar {
        padding: 0 0.75rem;
    }
    
    .nav-container {
        height: 60px;
    }
    
    .nav-left {
        gap: 0.75rem;
    }
    
    .logo span {
        display: none; /* Hide logo text, only show icon on very small screens */
    }
    
    .logo i {
        font-size: 1.6rem;
    }
    
    .search-box {
        width: 160px;
        padding: 0.4rem 0.6rem;
    }
    
    .search-box input {
        font-size: 0.85rem;
    }
    
    .main-content {
        padding: 1rem 0.75rem;
    }
    
    /* Fullscreen Modals on Mobile */
    .modal-content {
        margin: 0;
        max-width: 100%;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }
    
    .video-player-container video {
        max-height: 40vh;
    }
    
    .video-details {
        padding: 1.25rem;
        flex: 1;
        overflow-y: auto;
    }
    
    .video-meta h2 {
        font-size: 1.3rem;
    }
    
    .video-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Smaller cards on mobile */
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.75rem;
    }
    
    /* Settings Form Row adjustments */
    .tmdb-key-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-primary-inline {
        width: 100%;
        justify-content: center;
    }
    
    /* Make Hamburger menu a bit narrower on mobile */
    .hamburger-sidebar {
        width: 260px;
    }
    
    /* Episode cards layout inside series details modal */
    .episodes-grid {
        grid-template-columns: 1fr !important;
    }
}

