/* Variables CSS para facilitar el manejo de temas */
:root {
    --primary-color: #673ab7; /* Deep Purple */
    --primary-dark: #512da8;
    --primary-light: #9575cd;
    --accent-color: #ff4081; /* Pink accent */
    --text-color-light: #ffffff;
    --text-color-dark: #212121;
    --background-light: #f5f5f5;
    --background-dark: #212121; /* Dark grey for body */
    --card-background-light: #ffffff;
    --card-background-dark: #323232; /* Darker grey for cards */
    --border-color-light: #e0e0e0;
    --border-color-dark: #424242;
    --shadow-color-light: rgba(0, 0, 0, 0.2);
    --shadow-color-dark: rgba(0, 0, 0, 0.5);
    --login-card-dark: #2c2c2c; /* Slightly different for login to stand out in dark mode */
}

/* Modo Oscuro */
body.dark-mode {
    background-color: var(--background-dark);
    color: var(--text-color-light);
}

body.dark-mode header nav,
body.dark-mode footer.page-footer {
    background-color: var(--background-dark) !important;
}

body.dark-mode .card.movie-card,
body.dark-mode .modal,
body.dark-mode .player-container,
body.dark-mode .search-container {
    background-color: var(--card-background-dark);
    color: var(--text-color-light);
    box-shadow: 0 4px 10px var(--shadow-color-dark);
}

body.dark-mode .login-card {
    background-color: var(--login-card-dark);
    box-shadow: 0 8px 25px var(--shadow-color-dark);
}

body.dark-mode .card-title,
body.dark-mode .card-content span,
body.dark-mode .card-reveal span,
body.dark-mode .section-title,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode p {
    color: var(--text-color-light) !important;
}

body.dark-mode .input-field label {
    color: rgba(255, 255, 255, 0.7) !important;
}

body.dark-mode .input-field input:not([type]):focus + label,
body.dark-mode .input-field input[type=text]:not(.browser-default):focus:not([readonly]) + label,
body.dark-mode .input-field input[type=password]:not(.browser-default):focus:not([readonly]) + label,
body.dark-mode .input-field input[type=email]:not(.browser-default):focus:not([readonly]) + label,
body.dark-mode .input-field input[type=url]:not(.browser-default):focus:not([readonly]) + label,
body.dark-mode .input-field input[type=time]:not(.browser-default):focus:not([readonly]) + label,
body.dark-mode .input-field input[type=date]:not(.browser-default):focus:not([readonly]) + label,
body.dark-mode .input-field input[type=datetime-local]:not(.browser-default):focus:not([readonly]) + label,
body.dark-mode .input-field input[type=tel]:not(.browser-default):focus:not([readonly]) + label,
body.dark-mode .input-field input[type=number]:not(.browser-default):focus:not([readonly]) + label,
body.dark-mode .input-field input[type=search]:not(.browser-default):focus:not([readonly]) + label,
body.dark-mode .input-field textarea.materialize-textarea:focus:not([readonly]) + label {
    color: var(--primary-light) !important;
}

body.dark-mode .input-field input:not([type]):focus,
body.dark-mode .input-field input[type=text]:not(.browser-default):focus:not([readonly]),
body.dark-mode .input-field input[type=password]:not(.browser-default):focus:not([readonly]),
body.dark-mode .input-field input[type=email]:not(.browser-default):focus:not([readonly]),
body.dark-mode .input-field input[type=url]:not(.browser-default):focus:not([readonly]),
body.dark-mode .input-field input[type=time]:not(.browser-default):focus:not([readonly]),
body.dark-mode .input-field input[type=date]:not(.browser-default):focus:not([readonly]),
body.dark-mode .input-field input[type=datetime-local]:not(.browser-default):focus:not([readonly]),
body.dark-mode .input-field input[type=tel]:not(.browser-default):focus:not([readonly]),
body.dark-mode .input-field input[type=number]:not(.browser-default):focus:not([readonly]),
body.dark-mode .input-field input[type=search]:not(.browser-default):focus:not([readonly]),
body.dark-mode .input-field textarea.materialize-textarea:focus:not([readonly]) {
    border-bottom: 1px solid var(--primary-light) !important;
    box-shadow: 0 1px 0 0 var(--primary-light) !important;
}

body.dark-mode .input-field .prefix {
    color: rgba(255, 255, 255, 0.7) !important;
}

body.dark-mode .tabs .tab a {
    color: rgba(255, 255, 255, 0.7) !important;
}
body.dark-mode .tabs .tab a:hover, body.dark-mode .tabs .tab a.active {
    color: var(--text-color-light) !important;
}
body.dark-mode .tabs .indicator {
    background-color: var(--accent-color) !important;
}

body.dark-mode .modal-footer {
    background-color: var(--card-background-dark);
    border-top: 1px solid var(--border-color-dark);
}

/* General Styles */
body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-light);
    color: var(--text-color-dark);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Custom Scrollbar (Webkit) */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-light);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 4px;
}

body.dark-mode ::-webkit-scrollbar-track {
    background: var(--background-dark);
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: var(--primary-dark);
}

main {
    padding: 20px 0;
    min-height: calc(100vh - 114px); /* header + footer height */
}

/* Preloader Styles */
.preloader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a237e 0%, #4a148c 100%);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.preloader-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.preloader-content {
    text-align: center;
    color: white;
    padding: 2rem;
    transform: translateY(0);
    opacity: 1;
    transition: all 0.5s ease-out;
}

.preloader-overlay.hidden .preloader-content {
    transform: translateY(-20px);
    opacity: 0;
}

.preloader-icon-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
}

.preloader-icon {
    font-size: 48px !important;
    color: white;
    animation: pulse 2s infinite;
}

.preloader-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: ripple 2s infinite;
}

.preloader-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.preloader-text {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.preloader-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.preloader-bar {
    width: 30%;
    height: 100%;
    background: white;
    animation: progress 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes ripple {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

@keyframes progress {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

/* Login Section */
.login-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom right, #673ab7, #311b92); /* Deep Purple Gradient */
    background-size: cover;
    background-position: center;
    filter: blur(5px);
    z-index: -1;
    transition: all 0.5s ease;
}

.login-card {
    margin-top: 10vh;
    border-radius: 15px;
    overflow: hidden; /* For card-image */
    transition: all 0.3s ease;
    background-color: var(--card-background-light);
    box-shadow: 0 8px 25px var(--shadow-color-light);
}

.login-card .card-content {
    padding: 30px;
}

.login-card .card-title {
    font-size: 2.2em;
    font-weight: 600;
    margin-bottom: 25px;
    color: var(--primary-dark);
}

.login-card .input-field label {
    color: var(--primary-color);
}

.login-card .input-field input:focus + label {
    color: var(--primary-dark) !important;
}

.login-card .input-field input:focus {
    border-bottom: 1px solid var(--primary-dark) !important;
    box-shadow: 0 1px 0 0 var(--primary-dark) !important;
}

.login-card .btn {
    margin-top: 20px;
    height: 50px;
    line-height: 50px;
    font-size: 1.1em;
    border-radius: 8px;
    background-color: var(--primary-color);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.login-card .btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.login-card .progress {
    margin-top: 20px;
}

.login-card .error-message {
    margin-top: 15px;
    font-weight: 500;
}

/* Header & Navigation */
nav {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease;
}

nav .brand-logo {
    font-weight: 700;
    font-size: 1.8em;
    display: flex;
    align-items: center;
}

nav .brand-logo i {
    margin-right: 8px;
    font-size: 1.2em;
}

nav ul a {
    transition: color 0.3s ease;
}

nav ul a:hover {
    color: var(--accent-color) !important;
}

/* Sidenav (for mobile) */
.sidenav {
    background-color: var(--card-background-light);
}
body.dark-mode .sidenav {
    background-color: var(--card-background-dark);
}
.sidenav li > a {
    color: var(--text-color-dark);
}
body.dark-mode .sidenav li > a {
    color: var(--text-color-light);
}

/* Search Bar */
.search-container {
    position: relative;
    margin-top: 30px;
    margin-bottom: 30px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 0 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

body.dark-mode .search-container {
    background-color: rgba(0, 0, 0, 0.3);
}

.search-container input[type="search"] {
    color: var(--text-color-light);
    border-bottom: none !important;
    box-shadow: none !important;
    padding-left: 50px !important; /* Make space for icon */
    height: 45px !important;
    margin-bottom: 0 !important;
}

.search-container input[type="search"]::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-container .label-icon {
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
}

.search-container .search-clear-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5em;
    display: none;
}

.search-container.focused {
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
body.dark-mode .search-container.focused {
    background-color: rgba(0, 0, 0, 0.5);
}


/* Content Sections */
.section-title {
    color: var(--text-color-light);
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    font-size: 2.2em;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

.section-title i {
    margin-right: 10px;
    font-size: 1.2em;
}

/* Media Cards */
.movie-card {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--card-background-light);
}

.movie-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.movie-card .card-image img {
    height: 250px; /* Aumentar altura para layout de una columna */
    object-fit: cover;
    transition: transform 0.3s ease;
}

.movie-card:hover .card-image img {
    transform: scale(1.05);
}

.movie-card .card-content {
    padding: 15px;
    position: relative;
    z-index: 1;
    background-color: var(--card-background-light); /* Ensure background for text */
}

body.dark-mode .movie-card .card-content {
    background-color: var(--card-background-dark);
}


.movie-card .card-title {
    font-size: 1.2em; /* Aumentar tamaño de fuente */
    font-weight: 600;
    line-height: 1.3; /* Mejorar espaciado de línea */
    min-height: 40px;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    overflow-wrap: break-word; /* Evita que las palabras se rompan */
    display: -webkit-box;
    /* stylelint-disable-next-line property-no-vendor-prefix */
    -webkit-line-clamp: 3; /* Permitir hasta 3 líneas */
    line-clamp: 3;
    -webkit-box-orient: vertical;
    color: var(--text-color-dark);
    position: relative;
    padding-right: 40px; /* Espacio para el botón de descripción */
}

.movie-card .card-title i {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 2;
}

.movie-card .card-title i:hover {
    color: var(--primary-dark);
}

body.dark-mode .movie-card .card-title {
    color: var(--text-color-light) !important;
}

.movie-card .card-action {
    border-top: none;
    padding-top: 0;
}

.movie-card .play-btn {
    width: 100%;
    margin-top: 10px;
    border-radius: 8px;
    background-color: var(--primary-color);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.movie-card .play-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.movie-card .card-reveal {
    background-color: var(--card-background-light);
    border-radius: 0 0 12px 12px;
    padding: 20px;
}
body.dark-mode .movie-card .card-reveal {
    background-color: var(--card-background-dark);
}


.movie-card .card-reveal .card-title {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: var(--text-color-dark);
}
body.dark-mode .movie-card .card-reveal .card-title {
    color: var(--text-color-light);
}

.movie-card .card-reveal p {
    color: #616161;
    font-size: 0.95em;
    line-height: 1.5;
    margin-bottom: 15px;
}
body.dark-mode .movie-card .card-reveal p {
    color: #bdbdbd;
}


/* Slick Carousel Styles */
#featuredCarousel,
#featuredMoviesCarousel,
#featuredSeriesCarousel,
#featuredTVCarousel,
#featuredAudioCarousel {
    margin-bottom: 40px;
    padding: 20px 0; /* Add padding for dots and arrows */
    overflow: hidden; /* Ensure slick doesn't overflow */
}

#featuredCarousel .carousel-item,
#featuredMoviesCarousel .carousel-item,
#featuredSeriesCarousel .carousel-item,
#featuredTVCarousel .carousel-item,
#featuredAudioCarousel .carousel-item {
    text-align: center;
    position: relative;
    height: 300px; /* Fixed height for carousel items */
    margin: 0 10px; /* Spacing between slides */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

#featuredCarousel .carousel-item:hover,
#featuredMoviesCarousel .carousel-item:hover,
#featuredSeriesCarousel .carousel-item:hover,
#featuredTVCarousel .carousel-item:hover,
#featuredAudioCarousel .carousel-item:hover {
    transform: translateY(-5px);
}


#featuredCarousel .carousel-item img,
#featuredMoviesCarousel .carousel-item img,
#featuredSeriesCarousel .carousel-item img,
#featuredTVCarousel .carousel-item img,
#featuredAudioCarousel .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    display: block; /* Asegurar que la imagen se muestre como bloque */
    min-height: 200px; /* Altura mínima para evitar colapso */
    background-color: #f0f0f0; /* Color de fondo mientras carga */
}

/* Estilos para imágenes que están cargando */
#featuredCarousel .carousel-item img[src="assets/default-poster.jpg"],
#featuredMoviesCarousel .carousel-item img[src="assets/default-poster.jpg"],
#featuredSeriesCarousel .carousel-item img[src="assets/default-poster.jpg"],
#featuredTVCarousel .carousel-item img[src="assets/default-poster.jpg"],
#featuredAudioCarousel .carousel-item img[src="assets/default-poster.jpg"] {
    background-color: #e0e0e0;
    opacity: 0.7;
}

#featuredCarousel .carousel-caption,
#featuredMoviesCarousel .carousel-caption,
#featuredSeriesCarousel .carousel-caption,
#featuredTVCarousel .carousel-caption,
#featuredAudioCarousel .carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: var(--text-color-light);
    padding: 20px 10px 10px;
    border-radius: 0 0 12px 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    transform: translateY(100%);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#featuredCarousel .carousel-item:hover .carousel-caption,
#featuredMoviesCarousel .carousel-item:hover .carousel-caption,
#featuredSeriesCarousel .carousel-item:hover .carousel-caption,
#featuredTVCarousel .carousel-item:hover .carousel-caption,
#featuredAudioCarousel .carousel-item:hover .carousel-caption {
    opacity: 1;
    transform: translateY(0);
}

#featuredCarousel .carousel-caption h5,
#featuredMoviesCarousel .carousel-caption h5,
#featuredSeriesCarousel .carousel-caption h5,
#featuredTVCarousel .carousel-caption h5,
#featuredAudioCarousel .carousel-caption h5 {
    font-size: 1.4em;
    margin-bottom: 10px;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    /* stylelint-disable-next-line property-no-vendor-prefix */
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
    max-height: 2.6em;
    color: var(--text-color-light); /* Override Materialize */
}

/* Estilos específicos para el botón "Ver ahora" en carruseles */
#featuredCarousel .carousel-caption .play-btn,
#featuredMoviesCarousel .carousel-caption .play-btn,
#featuredSeriesCarousel .carousel-caption .play-btn,
#featuredTVCarousel .carousel-caption .play-btn,
#featuredAudioCarousel .carousel-caption .play-btn {
    width: 100%;
    margin-top: 10px;
    border-radius: 8px;
    background-color: var(--primary-color);
    transition: background-color 0.3s ease, transform 0.2s ease;
    position: relative;
    z-index: 2;
}

#featuredCarousel .carousel-caption .play-btn:hover,
#featuredMoviesCarousel .carousel-caption .play-btn:hover,
#featuredSeriesCarousel .carousel-caption .play-btn:hover,
#featuredTVCarousel .carousel-caption .play-btn:hover,
#featuredAudioCarousel .carousel-caption .play-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

#featuredCarousel .slick-prev,
#featuredMoviesCarousel .slick-prev,
#featuredSeriesCarousel .slick-prev,
#featuredTVCarousel .slick-prev,
#featuredAudioCarousel .slick-prev,
#featuredCarousel .slick-next,
#featuredMoviesCarousel .slick-next,
#featuredSeriesCarousel .slick-next,
#featuredTVCarousel .slick-next,
#featuredAudioCarousel .slick-next {
    width: 40px;
    height: 40px;
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

#featuredCarousel .slick-prev:hover,
#featuredMoviesCarousel .slick-prev:hover,
#featuredSeriesCarousel .slick-prev:hover,
#featuredTVCarousel .slick-prev:hover,
#featuredAudioCarousel .slick-prev:hover,
#featuredCarousel .slick-next:hover,
#featuredMoviesCarousel .slick-next:hover,
#featuredSeriesCarousel .slick-next:hover,
#featuredTVCarousel .slick-next:hover,
#featuredAudioCarousel .slick-next:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

#featuredCarousel .slick-prev:before,
#featuredMoviesCarousel .slick-prev:before,
#featuredSeriesCarousel .slick-prev:before,
#featuredTVCarousel .slick-prev:before,
#featuredAudioCarousel .slick-prev:before,
#featuredCarousel .slick-next:before,
#featuredMoviesCarousel .slick-next:before,
#featuredSeriesCarousel .slick-next:before,
#featuredTVCarousel .slick-next:before,
#featuredAudioCarousel .slick-next:before {
    font-family: 'Material Icons'; /* Use Material Icons for arrows */
    font-size: 24px;
    line-height: 1;
    color: white;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#featuredCarousel .slick-prev:before,
#featuredMoviesCarousel .slick-prev:before,
#featuredSeriesCarousel .slick-prev:before,
#featuredTVCarousel .slick-prev:before,
#featuredAudioCarousel .slick-prev:before {
    content: 'chevron_left';
}

#featuredCarousel .slick-next:before,
#featuredMoviesCarousel .slick-next:before,
#featuredSeriesCarousel .slick-next:before,
#featuredTVCarousel .slick-next:before,
#featuredAudioCarousel .slick-next:before {
    content: 'chevron_right';
}

#featuredCarousel .slick-dots li button:before,
#featuredMoviesCarousel .slick-dots li button:before,
#featuredSeriesCarousel .slick-dots li button:before,
#featuredTVCarousel .slick-dots li button:before,
#featuredAudioCarousel .slick-dots li button:before {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

#featuredCarousel .slick-dots li.slick-active button:before,
#featuredMoviesCarousel .slick-dots li.slick-active button:before,
#featuredSeriesCarousel .slick-dots li.slick-active button:before,
#featuredTVCarousel .slick-dots li.slick-active button:before,
#featuredAudioCarousel .slick-dots li.slick-active button:before {
    color: var(--accent-color);
}


/* Tabs */
.tabs {
    margin-bottom: 20px;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.3); /* Slightly transparent background for tabs */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

body.dark-mode .tabs {
    background-color: rgba(0, 0, 0, 0.4);
}

.tabs .tab a {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 600;
    transition: color 0.3s ease;
}

.tabs .tab a:hover {
    color: var(--text-color-light) !important;
    background-color: rgba(255, 255, 255, 0.05);
}

.tabs .tab a.active {
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--text-color-light) !important;
}

.tabs .indicator {
    background-color: var(--accent-color);
    height: 4px;
    border-radius: 2px;
}

.tab-content {
    padding-top: 20px; /* Space between tabs and content */
}

/* Player Container */
.player-container {
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    margin-top: 20px;
    margin-bottom: 40px;
    display: flex; /* For maintenance message alignment */
    flex-direction: column; /* For maintenance message */
    justify-content: center;
    align-items: center;
    color: var(--text-color-light);
    font-size: 1.5em;
    text-align: center;
    min-height: 200px; /* Min height when empty or in maintenance */
    transition: all 0.3s ease-in-out;
}

.player-container video,
.player-container audio {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

.maintenance-message {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.maintenance-message i {
    font-size: 3em;
    margin-bottom: 10px;
    color: var(--primary-light);
}


/* Footer */
footer.page-footer {
    padding-top: 20px;
    transition: background-color 0.3s ease;
}

footer.page-footer .footer-copyright {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 10px 0;
}

/* Footer Styles */
.page-footer h2, .page-footer .white-text {
    font-size: 2rem;
    font-weight: 600;
}
.page-footer ul li a, .page-footer p, .footer-copyright {
    font-size: 1rem;
}
@media (max-width: 600px) {
    .page-footer h2, .page-footer .white-text {
        font-size: 1.3rem;
    }
    .page-footer ul li a, .page-footer p, .footer-copyright {
        font-size: 0.95rem;
    }
}

/* Forzar enlaces de footer a blanco puro y bien visibles */
.page-footer ul li a,
.page-footer .footer-links a {
    color: #fff !important;
    font-weight: 600;
    text-shadow: 0 1px 4px #0008;
    letter-spacing: 0.5px;
    transition: color 0.2s;
}
.page-footer ul li a:hover,
.page-footer .footer-links a:hover {
    color: #ffe082 !important;
    text-decoration: underline;
}

/* Ajuste de tamaño de fuente para enlaces del footer */
.page-footer ul li a,
.page-footer .footer-links a {
    font-size: 1em !important;
}
@media (max-width: 600px) {
    .page-footer ul li a,
    .page-footer .footer-links a {
        font-size: 0.95em !important;
    }
}

/* Misc Utilities */
.full-width {
    width: 100%;
}

.mt-20 {
    margin-top: 20px !important;
}

/* CSS Grid for consistent card heights and alignment */
.row.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Responsive columns */
    grid-gap: 20px; /* Space between items */
}

.row.media-grid > .col {
    width: 100% !important; /* Override Materialize width */
    margin-left: 0 !important; /* Override Materialize margin */
    float: none !important; /* Override Materialize float */
    padding: 0 !important; /* Override Materialize padding */
    display: flex; /* Make column a flex container to ensure card fills it */
}

.row.media-grid .movie-card {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Card grows to fill column height */
    width: 100%; /* Ensure card fills the column */
}

.row.media-grid .movie-card .card-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Content area grows to push button down */
}

.row.media-grid .movie-card .card-content p:last-of-type {
    margin-top: auto; /* Pushes the button to the bottom */
}

/* Responsiveness */
@media (max-width: 992px) { /* Tablets */
    .movie-card .card-image img {
        height: 200px;
    }
    #featuredCarousel .carousel-item,
    #featuredMoviesCarousel .carousel-item,
    #featuredSeriesCarousel .carousel-item,
    #featuredTVCarousel .carousel-item,
    #featuredAudioCarousel .carousel-item {
        height: 250px;
    }
    .tabs .tab {
        flex-grow: 1; /* Distribute tabs evenly */
    }
    .section-title {
        font-size: 1.8em;
    }
    .preloader-icon {
        font-size: 4em;
    }
    .preloader-text {
        font-size: 1.2em;
    }
    
    .row.media-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        grid-gap: 15px;
    }
}

@media (max-width: 600px) { /* Mobile */
    .login-card {
        margin-top: 5vh;
        width: 90%;
        margin-left: auto;
        margin-right: auto;
    }
    .login-card .card-title {
        font-size: 1.8em;
    }
    nav .brand-logo {
        font-size: 1.5em;
    }
    .search-container {
        margin-top: 20px;
        margin-bottom: 20px;
    }
    .section-title {
        font-size: 1.5em;
    }
    .movie-card .card-image img {
        height: 250px; /* Aumentar altura para layout de una columna */
    }
    #featuredCarousel .carousel-item,
    #featuredMoviesCarousel .carousel-item,
    #featuredSeriesCarousel .carousel-item,
    #featuredTVCarousel .carousel-item,
    #featuredAudioCarousel .carousel-item {
        height: 200px;
    }
    .player-container {
        margin-bottom: 20px;
        min-height: 150px;
    }
    .tabs .tab {
        font-size: 0.8em;
        flex: 1 !important;
        min-width: auto !important;
    }
    .tabs .tab:last-child,
    .tabs .tab:nth-last-child(2) {
        flex: 0.8 !important;
    }
    .tabs .tab a {
        padding: 0 8px !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        min-height: 48px;
    }
    .tabs .tab a i {
        font-size: 20px !important;
        margin: 0 !important;
    }
    .tabs .tab a span {
        display: none !important;
    }
    .preloader-icon {
        font-size: 3.5em;
    }
    .preloader-text {
        font-size: 1em;
    }
    .preloader-bar {
        width: 150px;
    }
    
    .movie-card .card-title {
        font-size: 1.2em; /* Aumentar tamaño de fuente */
        min-height: 35px;
        padding-right: 35px;
        line-height: 1.3; /* Mejorar espaciado de línea */
        
        /* Re-declarar propiedades para asegurar el truncado en móviles */
        overflow: hidden;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        /* stylelint-disable-next-line property-no-vendor-prefix */
        -webkit-line-clamp: 3; /* Permitir hasta 3 líneas */
        line-clamp: 3;
    }
    
    .movie-card .card-title i {
        font-size: 20px;
        right: 2px;
    }
    
    .favorite-btn {
        width: 35px !important;
        height: 35px !important;
    }
    
    .favorite-btn i {
        font-size: 18px !important;
    }
    
    .rating-star {
        font-size: 16px !important;
    }
    
    .cinema-mode-btn {
        width: 40px !important;
        height: 40px !important;
        top: 10px;
        right: 10px;
    }
    
    .cinema-mode-btn i {
        font-size: 18px !important;
    }
    
    #featuredCarousel .carousel-caption,
    #featuredMoviesCarousel .carousel-caption,
    #featuredSeriesCarousel .carousel-caption,
    #featuredTVCarousel .carousel-caption,
    #featuredAudioCarousel .carousel-caption {
        padding: 15px 8px 8px;
    }
    
    #featuredCarousel .carousel-caption h5,
    #featuredMoviesCarousel .carousel-caption h5,
    #featuredSeriesCarousel .carousel-caption h5,
    #featuredTVCarousel .carousel-caption h5,
    #featuredAudioCarousel .carousel-caption h5 {
        font-size: 1.2em;
        margin-bottom: 8px;
        /* stylelint-disable-next-line property-no-vendor-prefix */
        -webkit-line-clamp: 2;
        line-clamp: 2;
        max-height: 2.4em;
        line-height: 1.2;
    }
    
    #featuredCarousel .carousel-caption .play-btn,
    #featuredMoviesCarousel .carousel-caption .play-btn,
    #featuredSeriesCarousel .carousel-caption .play-btn,
    #featuredTVCarousel .carousel-caption .play-btn,
    #featuredAudioCarousel .carousel-caption .play-btn {
        margin-top: 8px;
        padding: 8px 12px;
        font-size: 0.9em;
    }
    
    .cache-actions {
        flex-direction: column;
    }
    
    .cache-actions .btn {
        width: 100%;
        min-width: auto;
    }
    
    .cache-stats p {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .row.media-grid {
        grid-template-columns: 1fr; /* Forzar una sola columna */
        grid-gap: 25px; /* Aumentar espacio vertical */
    }
}

/* Nuevo: Estilos para el logo RyuFlix */
.brand-logo {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.8em; /* Ajusta según tu preferencia */
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.brand-logo:hover {
    transform: scale(1.03);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.brand-logo .logo-icon {
    font-size: 1.2em; /* Hace el ícono un poco más grande que el texto */
    margin-right: 8px;
    color: #ffeb3b; /* Un toque de color para el ícono, si quieres */
    text-shadow: 0 0 5px rgba(255, 235, 59, 0.7);
}

.brand-logo .logo-text {
    color: #fff;
}

/* Opcional: Ajustes para el reproductor si está oculto */
.player-container.hidden {
    display: none;
}

/* Mensaje de mantenimiento (para asegurar que siempre se vea bien) */
.maintenance-message {
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 30px;
    text-align: center;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%; /* Asegura que ocupe todo el espacio del contenedor */
}
.maintenance-message .material-icons {
    font-size: 4em;
    margin-bottom: 15px;
    color: #ffc107; /* Color de advertencia */
}
.maintenance-message p {
    font-size: 1.2em;
    margin: 0;
}

/* Estilos para el banner y mensaje dinámico */
#dynamicBannerContainer,
#dynamicMessageContainer {
    margin-top: 30px;
    margin-bottom: 20px;
}

#dynamicBanner {
    max-height: 250px; /* Limita la altura del banner para que no sea demasiado grande */
    object-fit: cover; /* Asegura que la imagen cubra el área sin distorsionarse */
}

#dynamicMessageContainer .card-title {
    display: flex;
    align-items: center;
    font-size: 1.5em;
}

#dynamicMessageContainer .card-title .material-icons {
    margin-right: 10px;
    font-size: 1.2em;
}

/* Opcional: para el modo oscuro, ajustar colores si es necesario */
body.dark-mode .nav-wrapper,
body.dark-mode .page-footer {
    background-color: #212121 !important; /* Un gris más oscuro para el modo oscuro */
}

body.dark-mode .card.deep-purple.darken-3 {
    background-color: #311b92 !important; /* Un púrpura más oscuro para el modo oscuro */
}

/* Banner Styles */
.banner-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    background-color: #f5f5f5;
    min-height: 200px;
}

.banner-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f5f5f5;
    z-index: 1;
}

.banner-placeholder .progress {
    width: 50%;
    background-color: rgba(0, 0, 0, 0.1);
}

.banner-placeholder .progress .indeterminate {
    background-color: #673ab7;
}

.banner-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.banner-wrapper img.loaded {
    opacity: 1;
}

.banner-wrapper:hover img {
    transform: scale(1.02);
}

/* Message Card Styles */
.message-card {
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.message-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.message-icon {
    font-size: 48px !important;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
}

.message-card .card-title {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 15px;
}

.message-card .divider {
    margin: 15px 0;
    opacity: 0.2;
}

.message-text {
    font-size: 16px;
    line-height: 1.6;
    margin: 15px 0;
    padding: 0 20px;
}

/* Animation for message appearance */
@keyframes messageFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-card {
    animation: messageFadeIn 0.5s ease-out;
}

/* Ajustes menú modal */
#settingsModal .modal-content h2, #settingsModal .modal-content h3, #settingsModal .modal-content label, #settingsModal .modal-content select {
    font-size: 1.2rem;
}
#settingsModal .modal-content h2 {
    text-align: center;
    font-size: 1.5rem;
}
#settingsModal .modal-content h3 {
    font-size: 1.1rem;
}

/* Centrar título mensaje importante */
.message-card .card-title {
    text-align: center;
    width: 100%;
    display: block;
    font-size: 1.3rem;
}

/* Nuevos estilos para favoritos, calificaciones e historial */

/* Card Actions (Favoritos) */
.card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.favorite-btn {
    background-color: rgba(0, 0, 0, 0.7) !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.favorite-btn:hover {
    background-color: rgba(0, 0, 0, 0.9) !important;
    transform: scale(1.1);
}

.favorite-btn i {
    color: white !important;
    font-size: 20px !important;
}

.favorite-active {
    background-color: rgba(244, 67, 54, 0.8) !important;
}

.favorite-active:hover {
    background-color: rgba(244, 67, 54, 1) !important;
}

/* Rating Stars */
.rating-container {
    margin: 10px 0;
}

.rating-stars {
    display: flex;
    align-items: center;
    gap: 2px;
}

.rating-star {
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px !important;
}

.rating-star:hover {
    transform: scale(1.2);
}

.star-filled {
    color: #ffc107 !important;
}

.star-empty {
    color: #ccc !important;
}

.star-filled:hover {
    color: #ff9800 !important;
}

.star-empty:hover {
    color: #ffc107 !important;
}

/* Empty States */
#noFavorites, #noHistory {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    margin: 20px 0;
}

#noFavorites i, #noHistory i {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.7;
}

#noFavorites h4, #noHistory h4 {
    margin-bottom: 10px;
    font-weight: 500;
}

#noFavorites p, #noHistory p {
    opacity: 0.8;
    font-size: 1.1em;
}

/* Responsive adjustments for new tabs */
@media (max-width: 600px) {
    .tabs .tab {
        font-size: 0.7em;
    }
    
    .tabs .tab i {
        font-size: 16px;
    }
    
    .favorite-btn {
        width: 35px !important;
        height: 35px !important;
    }
    
    .favorite-btn i {
        font-size: 18px !important;
    }
    
    .rating-star {
        font-size: 16px !important;
    }
}

/* Dark mode adjustments */
body.dark-mode .favorite-btn {
    background-color: rgba(255, 255, 255, 0.2) !important;
}

body.dark-mode .favorite-btn:hover {
    background-color: rgba(255, 255, 255, 0.3) !important;
}

body.dark-mode .favorite-active {
    background-color: rgba(244, 67, 54, 0.9) !important;
}

body.dark-mode .star-empty {
    color: #666 !important;
}

body.dark-mode #noFavorites, 
body.dark-mode #noHistory {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Cinema Mode Styles */
.cinema-mode-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(0, 0, 0, 0.7) !important;
    border-radius: 50% !important;
    width: 45px !important;
    height: 45px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cinema-mode-btn:hover {
    background-color: rgba(0, 0, 0, 0.9) !important;
    transform: scale(1.1);
}

.cinema-mode-btn i {
    color: white !important;
    font-size: 24px !important;
}

/* Cinema Mode Full Screen */
.cinema-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background-color: #000 !important;
    overflow: hidden !important;
}

.cinema-mode header,
.cinema-mode .search-container,
.cinema-mode .tabs,
.cinema-mode footer {
    display: none !important;
}

.cinema-mode .player-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    z-index: 10000 !important;
}

.cinema-mode .player-container video,
.cinema-mode .player-container audio {
    border-radius: 0 !important;
}

/* Theme Styles */
/* .theme-classic - Default theme - no changes needed */

.theme-neon {
    --primary-color: #00ff88;
    --primary-dark: #00cc6a;
    --primary-light: #33ffaa;
    --accent-color: #ff0080;
    --background-light: #0a0a0a;
    --background-dark: #000000;
    --card-background-light: #1a1a1a;
    --card-background-dark: #0f0f0f;
    --text-color-light: #ffffff;
    --text-color-dark: #00ff88;
}

.theme-retro {
    --primary-color: #ff6b35;
    --primary-dark: #e55a2b;
    --primary-light: #ff8a65;
    --accent-color: #f7931e;
    --background-light: #2c1810;
    --background-dark: #1a0f09;
    --card-background-light: #3d2317;
    --card-background-dark: #2a1810;
    --text-color-light: #fff3e0;
    --text-color-dark: #ff6b35;
}

.theme-minimal {
    --primary-color: #333333;
    --primary-dark: #1a1a1a;
    --primary-light: #666666;
    --accent-color: #666666;
    --background-light: #ffffff;
    --background-dark: #f8f8f8;
    --card-background-light: #f8f8f8;
    --card-background-dark: #eeeeee;
    --text-color-light: #333333;
    --text-color-dark: #000000;
}

.theme-ocean {
    --primary-color: #006994;
    --primary-dark: #004d6b;
    --primary-light: #4d94b3;
    --accent-color: #00bcd4;
    --background-light: #e3f2fd;
    --background-dark: #bbdefb;
    --card-background-light: #ffffff;
    --card-background-dark: #f5f9ff;
    --text-color-light: #006994;
    --text-color-dark: #004d6b;
}

/* Theme-specific adjustments */
.theme-neon .nav-wrapper {
    background-color: var(--primary-color) !important;
}

.theme-neon .card {
    background-color: var(--card-background-light) !important;
    border: 1px solid var(--primary-color);
}

.theme-retro .nav-wrapper {
    background-color: var(--primary-color) !important;
}

.theme-retro .card {
    background-color: var(--card-background-light) !important;
    border: 1px solid var(--accent-color);
}

.theme-minimal .nav-wrapper {
    background-color: var(--primary-color) !important;
}

.theme-minimal .card {
    background-color: var(--card-background-light) !important;
    border: 1px solid #e0e0e0;
}

.theme-ocean .nav-wrapper {
    background-color: var(--primary-color) !important;
}

.theme-ocean .card {
    background-color: var(--card-background-light) !important;
    border: 1px solid var(--accent-color);
}

/* Responsive adjustments for cinema mode */
@media (max-width: 600px) {
    .cinema-mode-btn {
        width: 40px !important;
        height: 40px !important;
        top: 10px;
        right: 10px;
    }
    
    .cinema-mode-btn i {
        font-size: 18px !important;
    }
    
    /* Mejorar caption en móviles */
    #featuredCarousel .carousel-caption,
    #featuredMoviesCarousel .carousel-caption,
    #featuredSeriesCarousel .carousel-caption,
    #featuredTVCarousel .carousel-caption,
    #featuredAudioCarousel .carousel-caption {
        padding: 15px 8px 8px;
    }
    
    #featuredCarousel .carousel-caption h5,
    #featuredMoviesCarousel .carousel-caption h5,
    #featuredSeriesCarousel .carousel-caption h5,
    #featuredTVCarousel .carousel-caption h5,
    #featuredAudioCarousel .carousel-caption h5 {
        font-size: 1.2em;
        margin-bottom: 8px;
        /* stylelint-disable-next-line property-no-vendor-prefix */
        -webkit-line-clamp: 2;
        line-clamp: 2;
        max-height: 2.4em;
        line-height: 1.2;
    }
    
    #featuredCarousel .carousel-caption .play-btn,
    #featuredMoviesCarousel .carousel-caption .play-btn,
    #featuredSeriesCarousel .carousel-caption .play-btn,
    #featuredTVCarousel .carousel-caption .play-btn,
    #featuredAudioCarousel .carousel-caption .play-btn {
        margin-top: 8px;
        padding: 8px 12px;
        font-size: 0.9em;
    }
}

/* Mobile tab icons styling */
@media (max-width: 600px) {
    .tabs .tab a {
        padding: 0 8px !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        min-height: 48px;
    }
    
    .tabs .tab a i {
        font-size: 20px !important;
        margin: 0 !important;
    }
    
    .tabs .tab a span {
        display: none !important;
    }
    
    /* Ajustar el ancho de las pestañas en móvil para que quepan mejor */
    .tabs .tab {
        flex: 1 !important;
        min-width: auto !important;
    }
    
    /* Hacer las pestañas de favoritos e historial un poco más pequeñas */
    .tabs .tab:last-child,
    .tabs .tab:nth-last-child(2) {
        flex: 0.8 !important;
    }
}

/* Cache Management Styles */
.cache-stats {
    background: rgba(103, 58, 183, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
}

.cache-stats p {
    margin: 8px 0;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cache-stats strong {
    color: var(--primary-color);
    font-weight: 600;
}

.cache-stats span {
    color: #666;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

body.dark-mode .cache-stats {
    background: rgba(103, 58, 183, 0.2);
    border-left-color: var(--primary-light);
}

body.dark-mode .cache-stats strong {
    color: var(--primary-light);
}

body.dark-mode .cache-stats span {
    color: #ccc;
}

.cache-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cache-actions .btn {
    flex: 1;
    min-width: 140px;
    font-size: 12px;
    padding: 0 15px;
    height: 36px;
    line-height: 36px;
}

.cache-actions .btn i {
    font-size: 16px;
    margin-right: 5px;
}

@media (max-width: 600px) {
    .cache-actions {
        flex-direction: column;
    }
    
    .cache-actions .btn {
        width: 100%;
        min-width: auto;
    }
    
    .cache-stats p {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Loading indicator for cache operations */
.cache-loading {
    opacity: 0.6;
    pointer-events: none;
}

.cache-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estilos básicos para imágenes */
.movie-card .card-image img {
    transition: opacity 0.3s ease;
}

.movie-card .card-image img[src="assets/default-poster.jpg"] {
    opacity: 0.8;
    filter: grayscale(20%);
}

/* Mejorar la experiencia del carrusel cuando las imágenes fallan */
.carousel-item img[src="assets/default-poster.jpg"] {
    opacity: 0.7;
    filter: brightness(0.8);
}

/* Estilos para el banner dinámico */
#dynamicBanner {
    transition: opacity 0.5s ease;
}

/* Mejorar la experiencia en modo oscuro */
body.dark-mode .movie-card .card-image img[src="assets/default-poster.jpg"] {
    opacity: 0.9;
    filter: grayscale(10%) brightness(0.9);
}

body.dark-mode .carousel-item img[src="assets/default-poster.jpg"] {
    opacity: 0.8;
    filter: brightness(0.9);
}

/* Mejorar la accesibilidad */
.movie-card .card-image img[alt*="sin título"],
.movie-card .card-image img[alt*="Desconocido"] {
    border: 2px dashed #ccc;
}

/* Tema claro - completamente blanco y bonito */
body:not(.dark-mode) {
    background: #ffffff !important;
    color: #333333;
}

body:not(.dark-mode) header nav {
    background: #ffffff !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

body:not(.dark-mode) header nav .brand-logo,
body:not(.dark-mode) header nav ul a {
    color: #333333 !important;
}

body:not(.dark-mode) header nav ul a:hover {
    background-color: rgba(0,0,0,0.05);
}

body:not(.dark-mode) .tabs {
    background-color: #f5f5f5;
}

body:not(.dark-mode) .tabs .tab a {
    color: #222 !important;
    font-weight: 600;
}

body:not(.dark-mode) .tabs .tab a.active {
    color: #1976d2 !important;
    font-weight: 700;
}

body:not(.dark-mode) .tabs .indicator {
    background-color: #1976d2 !important;
}

body:not(.dark-mode) .tabs.transparent {
    background-color: #f5f5f5;
}

body:not(.dark-mode) .tabs.transparent .tab a {
    color: #333333 !important;
}

body:not(.dark-mode) .tabs.transparent .tab a:hover,
body:not(.dark-mode) .tabs.transparent .tab a.active {
    color: #1976d2 !important;
}

body:not(.dark-mode) .card {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

body:not(.dark-mode) .card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

body:not(.dark-mode) .card-title {
    color: #333333 !important;
}

body:not(.dark-mode) .card-content p {
    color: #666666;
}

body:not(.dark-mode) .section-title {
    color: #333333 !important;
}

body:not(.dark-mode) .section-title i {
    color: #1976d2 !important;
}

body:not(.dark-mode) .play-btn {
    background-color: #1976d2 !important;
}

body:not(.dark-mode) .play-btn:hover {
    background-color: #1565c0 !important;
}

body:not(.dark-mode) .favorite-btn {
    background-color: rgba(255,255,255,0.9);
    color: #666666;
}

body:not(.dark-mode) .favorite-btn:hover {
    background-color: rgba(255,255,255,1);
    color: #333333;
}

body:not(.dark-mode) .favorite-active {
    color: #e91e63 !important;
}

body:not(.dark-mode) .favorite-active:hover {
    color: #c2185b !important;
}

body:not(.dark-mode) .rating-star {
    color: #ffc107;
}

body:not(.dark-mode) .star-empty {
    color: #e0e0e0;
}

body:not(.dark-mode) .star-empty:hover {
    color: #ffc107;
}

body:not(.dark-mode) footer.page-footer {
    background: #ffffff !important;
    color: #333333;
}

body:not(.dark-mode) footer.page-footer h2,
body:not(.dark-mode) footer.page-footer .white-text {
    color: #333333 !important;
}

body:not(.dark-mode) footer.page-footer ul li a,
body:not(.dark-mode) footer.page-footer p,
body:not(.dark-mode) .footer-copyright {
    color: #666666 !important;
}

body:not(.dark-mode) footer.page-footer ul li a:hover {
    color: #1976d2 !important;
}

body:not(.dark-mode) .search-container input[type="search"] {
    background-color: #f9f9f9;
    color: #222 !important;
    border: 1.5px solid #ccc;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    font-weight: 500;
}

body:not(.dark-mode) .search-container input[type="search"]:focus {
    background-color: #fff;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.10);
}

body:not(.dark-mode) .search-container input[type="search"]::placeholder {
    color: #888 !important;
    opacity: 1;
    font-weight: 400;
}

body:not(.dark-mode) .search-container .label-icon {
    color: #444 !important;
}

body:not(.dark-mode) .search-container .material-icons {
    color: #444 !important;
}

body:not(.dark-mode) .search-container {
    background: #f9f9f9;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding-left: 8px;
    padding-right: 8px;
}

body:not(.dark-mode) .search-clear-btn {
    color: #888 !important;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

body:not(.dark-mode) .tabs .tab a {
    color: #222 !important;
    font-weight: 600;
}

body:not(.dark-mode) .tabs .tab a.active {
    color: #1976d2 !important;
    font-weight: 700;
}

body:not(.dark-mode) .modal {
    background-color: #ffffff;
}

body:not(.dark-mode) .modal .modal-content h2,
body:not(.dark-mode) .modal .modal-content h3,
body:not(.dark-mode) .modal .modal-content label {
    color: #333333 !important;
}

body:not(.dark-mode) .modal .modal-content select {
    color: #333333;
}

body:not(.dark-mode) .switch label input[type=checkbox]:checked + .lever {
    background-color: #bdbdbd;
}

body:not(.dark-mode) .switch label input[type=checkbox]:checked + .lever:after {
    background-color: #1976d2;
}

body:not(.dark-mode) .switch label input[type=checkbox]:checked + .lever:before {
    background-color: rgba(25, 118, 210, 0.2);
}

body:not(.dark-mode) .btn {
    background-color: #1976d2;
}

body:not(.dark-mode) .btn:hover {
    background-color: #1565c0;
}

body:not(.dark-mode) .btn-flat {
    color: #1976d2;
}

body:not(.dark-mode) .btn-flat:hover {
    background-color: rgba(25, 118, 210, 0.1);
}

body:not(.dark-mode) .sidenav {
    background-color: #ffffff;
}

body:not(.dark-mode) .sidenav li > a {
    color: #333333;
}

body:not(.dark-mode) .sidenav li > a:hover {
    background-color: rgba(0,0,0,0.05);
}

body:not(.dark-mode) .sidenav li > a i {
    color: #666666;
}

body:not(.dark-mode) .sidenav li > a:hover i {
    color: #1976d2;
}

body:not(.dark-mode) .carousel-caption {
    background: rgba(255,255,255,0.9);
    color: #333333;
}

body:not(.dark-mode) .carousel-caption h5 {
    color: #333333;
}

body:not(.dark-mode) .carousel-caption .play-btn {
    background-color: #1976d2;
}

body:not(.dark-mode) .carousel-caption .play-btn:hover {
    background-color: #1565c0;
}

body:not(.dark-mode) #noResults {
    color: #666666;
}

body:not(.dark-mode) #noFavorites,
body:not(.dark-mode) #noHistory {
    color: #666666;
}

body:not(.dark-mode) #noFavorites i,
body:not(.dark-mode) #noHistory i {
    color: #999999;
}

body:not(.dark-mode) #noFavorites h4,
body:not(.dark-mode) #noHistory h4 {
    color: #333333;
}

body:not(.dark-mode) #noFavorites p,
body:not(.dark-mode) #noHistory p {
    color: #666666;
}

body:not(.dark-mode) .cache-stats {
    background-color: #f5f5f5;
    color: #333333;
}

body:not(.dark-mode) .cache-stats strong {
    color: #1976d2;
}

body:not(.dark-mode) .cache-stats span {
    color: #666666;
}

/* Mejorar la transición entre temas */
body,
header nav,
footer.page-footer,
.card,
.search-container,
.modal,
.sidenav {
    transition: all 0.3s ease;
}

body:not(.dark-mode) .message-card {
    background: #ffffff !important;
    color: #333333 !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

body:not(.dark-mode) .message-card .card-title {
    color: #333333 !important;
}

body:not(.dark-mode) .message-card .message-text {
    color: #666666 !important;
}

body:not(.dark-mode) .message-card .divider {
    background-color: #e0e0e0 !important;
}

body:not(.dark-mode) .message-card .message-icon {
    color: #1976d2 !important;
}

/* Logo RyuFlix visible en tema claro */
body:not(.dark-mode) .brand-logo,
body:not(.dark-mode) .logo-text {
    color: #222 !important;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* Buscador moderno y elegante */
body:not(.dark-mode) .search-container {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 24px 0 rgba(25, 118, 210, 0.07), 0 1.5px 4px 0 rgba(0,0,0,0.04);
    padding: 0 18px;
    display: flex;
    align-items: center;
    min-height: 56px;
    max-width: 480px;
    margin: 0 auto 18px auto;
    position: relative;
}

body:not(.dark-mode) .search-container input[type="search"] {
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    color: #222 !important;
    font-size: 1.15rem;
    font-weight: 500;
    padding: 16px 0 16px 44px;
    min-height: 56px;
    width: 100%;
}

body:not(.dark-mode) .search-container input[type="search"]:focus {
    background: transparent;
    border: none;
    box-shadow: none;
}

body:not(.dark-mode) .search-container input[type="search"]::placeholder {
    color: #888 !important;
    font-size: 1.08rem;
    font-weight: 400;
    opacity: 1;
}

body:not(.dark-mode) .search-container .label-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #1976d2 !important;
    font-size: 2rem !important;
    z-index: 2;
    pointer-events: none;
}

body:not(.dark-mode) .search-container .material-icons.search-clear-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #888 !important;
    font-size: 1.5rem !important;
    cursor: pointer;
    z-index: 2;
    background: none;
    border: none;
    outline: none;
}

body:not(.dark-mode) .search-container input[type="search"]:focus::placeholder {
    color: #bbb !important;
    opacity: 0.8;
}

body:not(.dark-mode) .search-container:focus-within {
    box-shadow: 0 0 0 2px #1976d2;
    border: 1.5px solid #1976d2;
}