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

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #17a2b8;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #1fc4dc, #17a2b8);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #17a2b8 rgba(0, 0, 0, 0.3);
}

html, body {
    background: #000;
    margin: 0;
    padding: 0;
    color: white;
}

body {
    font-family: 'Arial', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

header {
    background: rgba(10, 10, 15, 0.98);
    color: white;
    padding: 1rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    padding: 0;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 1rem;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: center;
    order: 3;
}

.sidebar-toggle img {
    filter: brightness(0) invert(1);
}

.sidebar-toggle:hover img {
    transform: scale(1.1);
}

.logo-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: auto;
}

.logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    text-align: left;
    margin: 0;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0;
    z-index: 10;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    order: 1;
}

.search-preview {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    border-radius: 10px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.search-preview-item {
    display: flex;
    align-items: center;
    padding: 0.8rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.2s;
}

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

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

.search-preview-poster {
    width: 40px;
    height: 60px;
    border-radius: 5px;
    margin-right: 1rem;
    object-fit: cover;
}

.search-preview-info {
    flex: 1;
}

.search-preview-title {
    color: white;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.search-preview-meta {
    color: #ccc;
    font-size: 0.8rem;
}

.search-preview-badge {
    background: #17a2b8;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.search-preview-badge[data-type="movie"] {
    background: #9b59b6;
}

.search-preview-badge[data-type="ova"] {
    background: #ff9500;
}

.search-preview-badge[data-type="series"] {
    background: #0053cc;
}

#searchInput {
    padding: 0.8rem 1rem 0.8rem 2.8rem;
    width: 280px;
    border: 2px solid #17a2b8;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: width 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    transform-origin: right;
    position: relative;
    background: #000000;
    color: white;
}

#searchInput.collapsed {
    width: 0;
    padding: 0.8rem 0;
    opacity: 0;
    transform: scaleX(0);
}

.desktop-search-btn {
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    transition: transform 0.2s;
    position: absolute;
    padding: 1rem;
    left: 0;
    pointer-events: none;
}

.desktop-search-btn:hover {
    transform: scale(1.1);
}

.desktop-search-btn img {
    filter: brightness(0) invert(1);
}

.search-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    -webkit-tap-highlight-color: transparent;
    align-items: center;
    justify-content: center;
}

.search-toggle img {
    filter: brightness(0) invert(1);
}

.search-toggle:hover img {
    transform: scale(1.1);
}

.mobile-search {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: auto;
    background: rgba(10, 10, 15, 0.98);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    z-index: 9999;
    will-change: transform, opacity;
}

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

.mobile-search-header {
    display: flex;
    align-items: center;
    padding: 0.6rem;
    gap: 0.6rem;
    background: #000 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    box-sizing: border-box;
}

.mobile-search input {
    flex: 1;
    padding: 0.5rem 0.8rem 0.5rem 2.5rem;
    border: 2px solid #17a2b8;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    background: rgba(23, 162, 184, 0.1);
    color: white;
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
    transition: all 0.3s ease;
    height: 42px;
}

.mobile-search-icon {
    position: absolute;
    left: 1.7rem;
    filter: brightness(0) invert(1);
    pointer-events: none;
    z-index: 1;
}

.mobile-search input:focus {
    border-color: #17a2b8;
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
    background: rgba(23, 162, 184, 0.1);
}

.mobile-search input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.close-mobile-search {
    background: transparent;
    border: 2px solid rgba(255, 59, 92, 0.8);
    color: rgba(255, 59, 92, 0.9);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
    transition: background 0.2s, border-color 0.2s;
}

.close-mobile-search:hover {
    background: rgba(255, 59, 92, 0.1);
    border-color: rgba(255, 59, 92, 1);
}

.mobile-search-preview {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    border-radius: 10px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1001;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: none;
    margin: 0 0.6rem;
}

.mobile-search-item {
    display: flex;
    align-items: center;
    padding: 0.8rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.2s;
}

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

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

.mobile-search-poster {
    width: 45px;
    height: 65px;
    border-radius: 6px;
    margin-right: 0.8rem;
    object-fit: cover;
}

.mobile-search-info {
    flex: 1;
}

.mobile-search-title {
    color: white;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.mobile-search-meta {
    color: #aaa;
    font-size: 0.8rem;
}

.mobile-search-badge {
    background: #17a2b8;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 600;
}

.mobile-search-badge[data-type="movie"] {
    background: #9b59b6;
}

.mobile-search-badge[data-type="ova"] {
    background: #ff9500;
}

.mobile-search-badge[data-type="series"] {
    background: #0053cc;
}

.sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: rgba(10, 10, 15, 0.98);
    color: white;
    transition: left 0.2s;
    z-index: 200;
    padding: 1rem;
    will-change: left;
    overflow-y: auto;
}

@media (min-width: 769px) {
    .sidebar:not(.active) {
        display: none;
    }
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-top: 1rem;
}

#closeSidebar {
    display: none;
}

.sidebar-content {
    padding: 0;
}

.setting-group {
    margin-bottom: 2rem;
}

.setting-group h4 {
    color: #ccc;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.settings-list {
    list-style: none;
    margin-bottom: 1rem;
}

.settings-list li {
    margin-bottom: 0.5rem;
}

.settings-list a {
    color: white;
    text-decoration: none;
    display: block;
    padding: 0.8rem;
    border-radius: 10px;
    transition: background 0.2s;
}

.settings-list a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
}

.setting-item label {
    color: white;
    font-size: 0.9rem;
}

.setting-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.setting-item select {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 0.3rem 0.5rem;
    border-radius: 5px;
    font-size: 0.8rem;
}

.stats {
    padding: 0;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0.8rem;
    color: white;
    font-size: 0.9rem;
}

.stat-item span:last-child {
    color: #4CAF50;
    font-weight: bold;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    display: none;
}

.overlay.active {
    display: block;
}

main {
    margin-top: 70px;
    padding: 1rem;
    flex: 1;
    background: #000000;
    min-height: calc(100vh - 70px);
    max-width: 100vw;
    overflow-x: hidden;
}

.carousel-section {
    margin-bottom: 2rem;
    margin-top: 0;
}

.carousel-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: white;
}

.carousel-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    overflow: hidden;
    height: 400px;
}

.carousel {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 15px;
    overflow: hidden;
}

.carousel-item {
    min-width: 100%;
    position: relative;
    cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
    .carousel-item {
        transition: transform 0.3s;
    }
}

.carousel-item img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.carousel-bg {
    height: 400px;
}

@media (max-width: 768px) {
    .carousel-container {
        height: 320px;
    }
    
    .carousel-item img,
    .carousel-bg {
        height: 320px !important;
    }
    
    .carousel {
        scroll-snap-type: x mandatory;
        overflow-x: auto;
        scrollbar-width: none;
    }
    
    .carousel::-webkit-scrollbar {
        display: none;
    }
}

.carousel-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.3) 30%, rgba(0,0,0,0.7) 60%, rgba(0,0,0,1) 100%);
    padding: 2rem 2rem 2rem 2rem;
    color: white;
    height: 80%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none;
}

.carousel-btn {
    position: absolute;
    top: 1rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    font-size: 1.5rem;
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    cursor: pointer;
    border-radius: 20%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    font-family: monospace;
}



.carousel-btn.prev {
    right: 55px;
}

.carousel-btn.next {
    right: 1rem;
}

.movies-section {
    max-width: 1200px;
    margin: 0 auto;
}

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

.section-header h2 {
    color: white;
    margin-bottom: 0rem;
}

.controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}

#sortSelect {
    padding: 0.72rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
    min-width: 170px;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="white" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    background-size: 0.8rem;
}

#sortSelect:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

#sortSelect option {
    background: #1e3c72;
    color: white;
    padding: 0.5rem;
}

.view-toggle {
    display: flex;
    gap: 0.2rem;
}

.view-toggle button {
    background: transparent;
    border: none;
    color: white;
    padding: 0.53rem 0.8rem;
    border-radius: 18px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.2s;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-toggle button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.view-toggle button.active {
    background: rgba(255, 255, 255, 0.3);
}

.advanced-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    justify-content: center;
    flex-wrap: nowrap;
}

.advanced-filters select {
    padding: 0.72rem 1.5rem 0.72rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
    min-width: 120px;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="white" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    background-size: 0.8rem;
    max-height: 200px;
    overflow-y: auto;
}

.advanced-filters select:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.advanced-filters select option {
    background: #1e3c72;
    color: white;
    padding: 0.5rem;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-tab {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.72rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s, border-color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.filter-tab:hover {
    background: rgba(255, 255, 255, 0.2);
}

.filter-tab.active {
    background: #17a2b8;
    color: white;
    border-color: #17a2b8;
}

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

.movie-grid.list-view {
    grid-template-columns: 1fr;
}

.movie-grid.list-view .movie-card {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 15px;
    position: relative;
}

.movie-grid.list-view .movie-poster {
    width: 100px;
    height: 150px;
    margin-right: 1rem;
    flex-shrink: 0;
}

.movie-grid.list-view .movie-poster::after {
    display: none;
}

.movie-grid.list-view .movie-title {
    position: static;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    text-shadow: none;
}

.movie-grid.list-view .movie-year {
    position: static;
    font-size: 0.9rem;
    color: #ccc;
    text-shadow: none;
}

.movie-grid.list-view .movie-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.movie-grid.list-view .movie-actions {
    position: absolute;
    top: 0.95rem;
    right: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.movie-grid.list-view .badges-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    flex-direction: column;
}

.movie-grid.list-view .movie-rating {
    position: static;
    background: rgba(0, 0, 0, 0.8);
    color: #ffd700;
    padding: 0.14rem 0.4rem;
    border-radius: 15px;
    font-size: 0.8rem;
    order: 1;
}

.movie-grid.list-view .type-badge {
    position: absolute;
    left: 130px;
    top: 1rem;
    padding: 0.3rem 0.6rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 2;
}

.movie-grid.list-view .status-indicator {
    position: static;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    order: 3;
}

.movie-card {
    position: relative;
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
    .movie-card {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .movie-card:hover {
        transform: translateY(-10px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }
}

.movie-poster {
    width: 100%;
    height: 370px;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.movie-poster::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.4) 40%, rgba(0,0,0,0.85) 100%);
    pointer-events: none;
    z-index: 1;
}

.movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.movie-title {
    position: absolute;
    bottom: 28px;
    left: 10px;
    right: 10px;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    margin: 0;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.9);
    font-weight: bold;
    line-height: 1.2;
    z-index: 2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-year {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    color: #ddd;
    font-size: clamp(0.75rem, 2vw, 0.85rem);
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.9);
    z-index: 2;
}

.favorite-btn {
    position: absolute;
    top: 37px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    border: none;
    color: #ccc;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.8rem;
    cursor: pointer;
    z-index: 5;
    display: none;
    align-items: center;
    justify-content: center;
}

.favorite-btn.active {
    color: #e74c3c;
}

.movie-rating {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #ffd700;
    padding: 0.15rem 0.4rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

.view-count {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.quality-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255, 107, 107, 0.9);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 2;
}

.type-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(23, 162, 184, 0.9);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: bold;
}

.type-badge[data-type="movie"],
.movie-grid.list-view .type-badge[data-type="movie"] {
    background: rgba(155, 89, 182, 0.9);
}

.type-badge[data-type="ova"],
.movie-grid.list-view .type-badge[data-type="ova"] {
    background: rgba(255, 149, 0, 0.9);
}

.type-badge[data-type="series"],
.movie-grid.list-view .type-badge[data-type="series"] {
    background: #0053cc;
}

.status-indicator {
    position: absolute;
    top: 40px;
    right: 10px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.status-indicator.ongoing {
    background: #4CAF50;
}

.status-indicator.completed {
    background: #e74c3c;
}

.movie-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #ff6b6b;
    border-radius: 2px;
}

.movie-card .movie-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.3);
}

.movie-card .progress-bar {
    background: #4CAF50;
}

.loading-spinner {
    text-align: center;
    padding: 3rem;
    color: rgba(255, 255, 255, 0.8);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(255, 255, 255, 0.6);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

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

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
}

.modal-content {
    position: relative;
    margin: 5% auto;
    padding: 2rem;
    width: 90%;
    max-width: 900px;
    background: rgba(30, 60, 114, 0.95);
    border-radius: 15px;
    text-align: center;
}

.modal-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1rem 0;
    font-size: 0.9rem;
    color: #ccc;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: white;
}

.close:hover {
    color: #ff6b6b;
}

#videoContainer {
    margin: 0rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

#videoContainer iframe {
    width: 100%;
    max-width: 890px;
    max-height: 800px;
    border-radius: 10px;
}

#modalDescription {
    margin-top: 1rem;
    line-height: 1.6;
    color: #ddd;
    text-align: left;
    max-height: calc(1.6em * 4);
    overflow-y: auto;
}

.rating-section {
    margin: 1.5rem 0;
    text-align: center;
}

.star-rating {
    font-size: 2rem;
    margin-top: 0.5rem;
}

.star {
    color: #666;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    padding: 0.2rem;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.star:hover,
.star.active {
    color: #ffd700;
}

.movie-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    /* margin-top: 2rem; */
}

.action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s, transform 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 44px;
}

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

.action-btn#favoriteBtn.active {
    background: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.action-btn#watchLaterBtn.active {
    background: rgba(255, 215, 0, 0.3);
    color: #ffd700;
}

.movie-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: #ccc;
    margin-bottom: 0.3rem;
}

/* --- ESTILOS FOOTER --- */
footer {
    background: rgba(0, 0, 0, 0.95);
    padding: 1.5rem 1rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-social {
    display: flex;
    gap: 2rem;
}

.footer-social a {
    color: #ccc;
    text-decoration: none;
    font-size: 1.8rem; /* Tamaño de los iconos */
    transition: color 0.3s, transform 0.3s;
}

.footer-social a:hover {
    color: #fff;
    transform: translateY(-3px);
}

.footer-bottom {
    color: #ccc;
    font-size: 0.9rem;
}

.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    z-index: 1001;
    transform: translateX(400px);
    transition: transform 0.2s;
}

.notification.show {
    transform: translateX(0);
}

/* Tablets */
@media (max-width: 1024px) {
    main {
        margin-top: 70px;
        padding: 1.5rem;
    }
    
    .movie-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1.5rem;
    }
    
}

/* Mobile Large */
@media (max-width: 1024px) {
    .filter-tabs {
        display: none;
    }
    
    #mobileFilterSelect {
        display: block !important;
        padding: 0.53rem 2rem 0.53rem 1rem;
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 20px;
        background: rgba(255, 255, 255, 0.1);
        color: white;
        font-size: 0.9rem;
        cursor: pointer;
        transition: background-color 0.2s;
        min-width: 100px;
        outline: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="white" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
        background-repeat: no-repeat;
        background-position: right 0.8rem center;
        background-size: 0.8rem;
    }
    
    #mobileFilterSelect:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }
    
    #mobileFilterSelect option {
        background: #1e3c72;
        color: white;
    }
    
    .controls {
        justify-content: space-between;
        background: transparent;
        padding: 0;
        border: none;
    }
}

@media (max-width: 768px) {
    header {
        padding: 1rem 1rem 0.5rem 1rem;
    }
    
    .mobile-search-header {
        padding: 1rem 1rem 0.5rem 1rem;
    }
    
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
    }
    
    header h1 {
        font-size: 1.5rem;
        margin: 0;
        margin-left: 0.5rem;
    }
    
    #searchInput {
        display: none;
    }
    
    .desktop-search-btn {
        display: none;
    }
    
    .search-toggle {
        display: flex;
    }
    
    .navbar-actions {
        gap: 0.7rem;
    }
    
    main {
        margin-top: 52px;
        padding: 1rem 1rem 1rem 1rem;
    }
    
    .sidebar {
        width: 280px;
        left: -280px;
    }
    
    .carousel-section {
        margin-bottom: 0.5rem;
    }
    
    .carousel-section h2 {
        font-size: 1.5rem;
    }
    
    .carousel-item img {
        height: 160px;
    }
    
    .carousel-info {
        bottom: -2px;
    }
    
    .movie-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 1rem;
    }
    
    .movie-poster {
        height: 240px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 0.8rem;
        align-items: stretch;
        margin-bottom: 0.5rem;
    }
    
    .controls {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
        gap: 0.5rem;
        background: transparent;
        padding: 0;
        border: none;
    }
    
    #mobileFilterSelect {
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: white;
        padding: 0.53rem 1rem;
        border-radius: 20px;
        cursor: pointer;
        font-size: 0.8rem;
        outline: none;
        min-width: 100px;
        background: rgba(255, 255, 255, 0.1);
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="white" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
        background-repeat: no-repeat;
        background-position: right 0.8rem center;
        background-size: 0.8rem;
    }
    
    #mobileFilterSelect option {
        background: #1e3c72;
        color: white;
    }
    
    #sortSelect {
        flex: 1;
        min-width: 120px;
        padding: 0.53rem 1rem;
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 20px;
        background: rgba(255, 255, 255, 0.1);
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="white" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
        background-repeat: no-repeat;
        background-position: right 0.8rem center;
        background-size: 0.8rem;
        
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 1.5rem;
    }
    
    .modal-info {
        flex-wrap: wrap;
        gap: 1rem;
        font-size: 0.8rem;
    }
    
    #videoContainer iframe {
        height: 200px;
        width: 100%;
    }
    
    .movie-actions {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .action-btn {
        width: 100%;
        padding: 1rem;
    }
    
    .carousel-info {
        padding: 1rem;
    }
    
    .carousel-info h3 {
        font-size: 1.2rem;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .carousel-info p {
        font-size: 0.8rem;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .carousel-btn {
        font-size: 1.3rem;
        width: 35px;
        height: 35px;
        min-width: 35px;
        min-height: 35px;
    }
    
    .carousel-btn.prev {
        right: 45px;
    }
    
    .carousel-btn.next {
        right: 0.5rem;
    }
    
    .star-rating {
        font-size: 1.5rem;
    }

    .advanced-filters {
        gap: 0.5rem;
        flex-wrap: nowrap;
        margin-bottom: 1rem;
    }
    
    .advanced-filters select {
        min-width: 80px;
        font-size: 0.8rem;
        padding: 0.53rem 1.8rem 0.53rem 1rem;
        background-position: right 0.6rem center;
        background-size: 0.7rem;
    }
    
    .filter-tabs {
        gap: 0.3rem;
    }
    
    .filter-tab {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    
    .movie-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .empty-state {
        padding: 2rem 1rem;
    }
    
    .empty-icon {
        font-size: 3rem;
    }
}

/* Mobile Medium */
@media (max-width: 480px) {
    header {
        padding: 0.6rem 0.8rem 0.6rem 0.8rem;
    }
    
    .mobile-search-header {
        padding: 0.5rem 0.8rem 0.5rem 0.8rem;
    }
    
    .header-content {
        gap: 0.5rem;
    }
    
    header h1 {
        font-size: 1.5rem;
        margin: 0 0.2rem;
    }
    
    .sidebar-toggle,
    .search-toggle {
        font-size: 1.3rem;
        padding: 0.4rem;
    }
    
    .sidebar {
        width: 60vw;
        left: -60vw;
    }
    
    #closeSidebar {
        display: none;
    }
    
    main {
        margin-top: 50px;
        padding: 0.6rem;
    }
    
    .carousel-section {
        margin-bottom: 1.5rem;
    }
    
    .carousel-section h2 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    .movie-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .movie-poster {
        height: 240px;
    }
    
    .controls {
        flex-direction: row;
        /* gap: 0.3rem; */
        align-items: center;
        justify-content: space-between;
        width: 100%;
        margin: 0;
        background: transparent;
        padding: 0;
        border: none;
    }
    
    #sortSelect {
        min-width: 100px;
        font-size: 0.8rem;
    }
    
    .view-toggle button {
        min-width: 35px;
        min-height: 35px;
        font-size: 1rem;
    }
    .favorite-btn {
        position: absolute;
        top: 33px;
        right: 10px;
    }
    .status-indicator {
        top: 40px;
        right: 10px;
        width: 9px;
        height: 9px;
    }
    .type-badge {
        padding: 0.2rem 0.5rem;
    }    
    
    .modal-content {
        width: 98%;
        margin: 2% auto;
        padding: 1rem;
    }
    
    .modal-info {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    #videoContainer iframe {
        height: 180px;
    }
    
    .carousel-btn {
        font-size: 1.1rem;
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
    }
    
    .carousel-btn.prev {
        right: 40px;
    }
    
    .carousel-btn.next {
        right: 0.3rem;
    }
    
    .carousel {
        touch-action: pan-y;
    }
    
    .star-rating {
        font-size: 1.3rem;
    }
}

/* Mobile Small */
@media (max-width: 360px) {
    header {
        padding: 0.5rem;
    }
    
    .mobile-search-header {
        padding: 0.5rem;
    }
    
    header h1 {
        font-size: 1.3rem;
        margin: 0 0.3rem;
    }
    
    .sidebar-toggle,
    .search-toggle {
        font-size: 1.2rem;
        padding: 0.3rem;
    }
    
    .mobile-search {
        padding: 0rem;
    }
    
    .mobile-search input {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    
    main {
        padding: 0.5rem;
    }
    
    .section-header {
        margin-bottom: 0.8rem;
    }
    
    .controls {
        flex-direction: row;
        gap: 0.3rem;
        align-items: center;
        justify-content: space-between;
        background: transparent;
        padding: 0;
        border: none;
    }
    
    #mobileFilterSelect,
    #sortSelect {
        flex: 1;
        min-width: 0;
        font-size: 0.7rem;
        padding: 0.5rem 0.8rem;
    }
    
    .advanced-filters {
        gap: 0.3rem;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .advanced-filters select {
        min-width: 70px;
        font-size: 0.7rem;
        padding: 0.4rem 1.5rem 0.4rem 0.8rem;
    }
    
    .movie-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }
    
    .movie-poster {
        height: 220px;
    }
    
    .modal-content {
        padding: 0.8rem;
    }
    
    #videoContainer iframe {
        height: 160px;
    }
    
    .action-btn {
        font-size: 0.8rem;
        padding: 0.8rem;
    }
    
    .carousel-info {
        padding: 0.8rem;
    }
    
    .carousel-info h3 {
        font-size: 1rem;
    }
    
    .carousel-info p {
        font-size: 0.8rem;
    }
}

/* Touch improvements */
@media (hover: none) and (pointer: coarse) {
    .movie-card:hover {
        transform: none;
        box-shadow: none;
    }
    
    .movie-card:active {
        transform: none;
    }
    
    .action-btn:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .action-btn:active {
        background: rgba(255, 255, 255, 0.3);
    }
    
    .star:hover {
        color: #666;
    }
    
    .star:active {
        color: #ffd700;
    }
}
.filters-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.filters-row .filter-tabs {
    margin-bottom: 0;
}

.filters-row .advanced-filters {
    margin-bottom: 0;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.pagination button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
    min-width: 40px;
}

.pagination button:hover:not(:disabled):not(.active) {
    background: rgba(255, 255, 255, 0.2);
}

.pagination button.active {
    background: #17a2b8;
    color: white;
    border-color: #17a2b8;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .dots {
    color: #333;
    padding: 0 0.5rem;
}

@media (max-width: 768px) {
    .filters-row {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .filters-row .filter-tabs {
        width: 100%;
        justify-content: center;
    }
    
    .filters-row .advanced-filters {
        width: 100%;
    }
    
    .pagination {
        gap: 0.3rem;
    }
    
    .pagination button {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
        min-width: 35px;
    }
}

.recent-added-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
    cursor: pointer;
}

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

.recent-thumb {
    width: 50px;
    height: 70px;
    border-radius: 5px;
    object-fit: cover;
    flex-shrink: 0;
}

.recent-info {
    flex: 1;
}

.recent-title {
    color: white;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.recent-date {
    color: #999;
    font-size: 0.75rem;
}
@media (min-width: 769px) {
    .carousel-info h3 {
        font-size: 1.6rem !important;
    }
}


/* Estilos para tarjetas relacionadas */
.related-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.related-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.8rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: 0.3s;
}

.related-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    border-color: #17a2b8;
}
