/* ============================================
   VARIABLES GLOBALES
   ============================================ */
:root {
    --bg-dark: #282c34;
    --bg-medium: #3a404a;
    --accent-blue: #61dafb;
    --accent-green: #4CAF50;
    --accent-red: #f44336;
    --text-light: #f8f8f2;
    --text-dark: #2c2c2c;
    --border-color: #00b7e6;
    --button-hover: #00b7e6;
    --button-active: #008fa3;
    --index-dpad-bg: #4a515c;
    --index-dpad-shadow: rgba(0, 0, 0, 0.3);
}

/* ============================================
   RESET Y ESTILOS BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

h1 {
    color: var(--accent-blue);
    margin-bottom: 20px;
    font-size: 1.8em;
    text-shadow: 0 0 10px rgba(97, 218, 251, 0.5);
    text-align: center;
}

h2 {
    color: var(--accent-blue);
    margin: 15px 0;
    font-size: 1.5em;
}

/* ============================================
   CONTENEDORES PRINCIPALES
   ============================================ */
.lobby-container,
.remote-container,
.screen-container {
    background-color: var(--bg-medium);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90%;
    max-width: 500px;
    text-align: center;
    margin: 0 auto 20px;
}

/* Contenedor específico para control remoto */
.remote-container {
    max-width: 360px;
    min-height: 600px;
    border-radius: 30px;
    background: linear-gradient(145deg, #2e333d, #1e2229);
    border: 2px solid #444;
    padding: 20px 10px;
}

/* Contenedor para pantalla de video */
.screen-container {
    max-width: 85%;
    position: relative;
    width: 100%;
}

/* ============================================
   FORMULARIOS Y ENTRADAS
   ============================================ */
.input-group {
    margin: 15px 0;
    width: 100%;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-light);
    font-size: 1.1em;
}

.input-group input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--text-dark);
    color: var(--text-light);
    font-size: 1em;
    outline: none;
    transition: all 0.2s;
}

.input-group input[type="text"]:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 8px rgba(97, 218, 251, 0.4);
}

/* ============================================
   BOTONES Y CONTROLES
   ============================================ */
/* Botones generales */
button {
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

/* Grupo de botones en lobby */
.lobby-buttons {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin: 40px 0;
    width: 100%;
    max-width: 1100px;
    padding: 0 20px;
    flex-wrap: wrap;
}

/* Botón individual del lobby */
.lobby-button {
    flex: 1;
    min-width: 250px;
    max-width: 330px;
    min-height: 180px;
    padding: 25px;
    background-color: var(--bg-medium);
    border: none;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.lobby-button:hover {
    background-color: #4a515c;
    transform: translateY(-6px);
    box-shadow: 0 14px 24px rgba(0, 0, 0, 0.45);
}

.lobby-button.selected,
.lobby-button.selected-option {
    border: 4px solid var(--accent-blue);
    box-shadow: 0 0 15px rgba(97, 218, 251, 0.7);
    transform: scale(1.05);
}

/* Contenedor de icono */
.icon-wrapper {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Icono como imagen */
.icon-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.lobby-button:hover .icon-image {
    transform: scale(1.09);
}

/* Texto del botón */
.lobby-button span {
    color: white;
    font-size: 1.4em;
    font-weight: bold;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Botones de acción específicos */
.create-button { background-color: var(--bg-medium); }
.join-button { background-color: var(--bg-medium); }

.create-button:hover { box-shadow: 0 0 15px rgba(76, 175, 80, 0.4); }
.join-button:hover { box-shadow: 0 0 15px rgba(0, 183, 230, 0.4); }

/* Botones de control remoto */
.remote-button,
.media-button {
    width: 40px;
    height: 40px;
    font-size: 1em;
    font-weight: bold;
    border: none;
    border-radius: 50%;
    background-color: #4a515c;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.remote-button:hover,
.media-button:hover {
    background-color: var(--button-hover);
    transform: scale(1.05);
}

.remote-button:active,
.media-button:active {
    background-color: var(--button-active);
    transform: scale(0.95);
}

/* Botón Enter especial */
#enterBtn {
    border-radius: 10px;
    width: 60px;
    background-color: #e67e22;
    font-size: 1em;
}

#enterBtn:hover {
    background-color: #d35400;
}

/* Botones de salida */
.leave-room-button,
.close-room-button {
    background-color: var(--accent-red);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.leave-room-button:hover,
.close-room-button:hover {
    background-color: #d32f2f;
    transform: translateY(-2px);
}

/* ============================================
   CONTROL REMOTO ESPECÍFICO
   ============================================ */
.remote-shell {
    width: 360px;
    max-width: calc(100% - 20px);
    background: linear-gradient(180deg, #141416 0%, #2a2d31 100%);
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.04);
    margin: 0 auto;
}

.remote-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.brand {
    color: var(--accent-blue);
    font-weight: 700;
    letter-spacing: 1px;
}

.status {
    font-size: 0.85rem;
    color: #bfc6cc;
}

/* Botones grandes del control */
.big-button {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: linear-gradient(180deg, #3a3f46, #232629);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.45);
}

.big-button:active {
    transform: translateY(2px) scale(0.99);
}

/* Botón de apagado */
#btn-power-off {
    background: linear-gradient(180deg, #ff6b6b, #c44d4d);
    color: white;
    box-shadow: 0 6px 12px rgba(255, 0, 0, 0.45);
}

/* Filas de botones */
.row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    justify-content: center;
}

/* Botones redondos */
.round {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3a3f46;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.round.large {
    width: 64px;
    height: 64px;
}

/* D-Pad */
.dpad {
    width: 100%;
    max-width: 230px;
    margin: 0 auto 12px;
    display: grid;
    grid-template-areas:
        ". up ."
        "left center right"
        ". down .";
    grid-gap: 8px;
    justify-items: center;
    align-items: center;
}

.dpad .up { grid-area: up; }
.dpad .left { grid-area: left; }
.dpad .center { 
    grid-area: center; 
    border-radius: 10px; 
    width: 86px; 
    height: 46px; 
}
.dpad .right { grid-area: right; }
.dpad .down { grid-area: down; }

/* D-Pad simplificado para Index Control */
.dpad.simple {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
    width: 180px;
    height: 180px;
    margin: 30px auto;
}

.dpad.simple .round {
    background-color: var(--index-dpad-bg);
    color: var(--text-light);
    border-radius: 15%;
    font-size: 1.2em;
    font-weight: bold;
    box-shadow: 0 4px 8px var(--index-dpad-shadow);
    width: 100%;
    height: 100%;
}

.dpad.simple .round:hover {
    background-color: var(--button-hover);
    color: var(--text-dark);
}

.dpad.simple .round:active {
    transform: scale(0.95);
    background-color: var(--button-active);
}

.dpad.simple .round.large {
    font-size: 1.4em;
    background-color: var(--accent-blue);
    color: var(--text-dark);
}

.dpad.simple .round.large:hover {
    background-color: var(--button-hover);
    color: var(--text-light);
}

/* Posiciones D-Pad */
.dpad.simple .up { grid-area: 1 / 2 / 2 / 3; }
.dpad.simple .left { grid-area: 2 / 1 / 3 / 2; }
.dpad.simple .center { grid-area: 2 / 2 / 3 / 3; }
.dpad.simple .right { grid-area: 2 / 3 / 3 / 4; }
.dpad.simple .down { grid-area: 3 / 2 / 4 / 3; }

/* Secciones del control remoto */
.chan-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.label {
    font-size: 0.9rem;
    color: #cdd7dc;
    margin-bottom: 4px;
}

.section-title {
    text-align: center;
    color: #9fb3bd;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.media-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 12px;
}

/* Controles de volumen y timeline */
.remote-volume,
.timeline-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 15px;
    width: 100%;
}

.remote-volume label,
.timeline-container label {
    font-size: 0.9em;
    color: var(--text-light);
}

/* Sliders */
input[type="range"] {
    width: 100px;
    background: #444;
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    background: var(--accent-blue);
    border-radius: 50%;
    cursor: pointer;
}

/* ============================================
   SLIDER DE BOTONES (TV, MOV, DS, AUD)
   ============================================ */
.button-slider {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 10px 0;
    gap: 15px;
    width: 100%;
    margin-top: 20px;
    scrollbar-width: thin;
    scrollbar-color: #3a3f46 #2a2d31;
}

.button-slider::-webkit-scrollbar {
    height: 8px;
}

.button-slider::-webkit-scrollbar-thumb {
    background-color: #3a3f46;
    border-radius: 4px;
}

.button-slider::-webkit-scrollbar-track {
    background: #2a2d31;
}

.button-slider .lobby-button {
    flex: 0 0 calc(70% / 4);
    min-width: 100px;
    max-width: 200px;
    height: 120px;
    padding: 5px;
    gap: 5px;
    background-color: transparent;
    border: none;
    box-shadow: none;
}

.button-slider .lobby-button .icon-wrapper {
    height: 80px;
}

.button-slider .lobby-button .icon-image {
    width: 60px;
    height: 60px;
}

.button-slider .lobby-button span {
    font-size: 1.1em;
    white-space: normal;
}

.button-slider .lobby-button:hover {
    background-color: rgba(97, 218, 251, 0.1);
    transform: scale(1.05);
}

/* ============================================
   ACORDEÓN DE CONTROLES REMOTOS
   ============================================ */
.remote-slider-accordion {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out, padding 0.3s ease-out;
    opacity: 0;
    padding: 0;
    margin-top: 0;
    width: 100%;
}

.remote-slider-accordion.expanded {
    max-height: 500px;
    opacity: 1;
    padding: 10px 0;
}

#toggle-slider-btn i {
    transition: transform 0.3s ease;
    margin-right: 5px;
}

.remote-slider-accordion.expanded ~ div button#toggle-slider-btn i {
    transform: rotate(180deg);
}

.remote-slider-accordion .button-slider {
    margin-top: 0;
}

/* ============================================
   VENTANA MODAL TIPO ESCRITORIO
   ============================================ */
.window-modal {
    display: none;
    position: fixed;
    width: 800px;
    height: 600px;
    background-color: #2a2d31;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(97, 218, 251, 0.3);
    overflow: auto;
    z-index: 5000;
    flex-direction: column;
    min-width: 300px;
    min-height: 200px;
    resize: both;
    transition: all 0.2s ease-out, opacity 0.2s ease-out, transform 0.2s ease-out;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
    top: 50%;
    left: 50%;
}

.window-modal[style*="display: flex"] {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.window-header {
    background-color: #3a404a;
    color: var(--text-light);
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    user-select: none;
    border-bottom: 1px solid #4a515c;
    touch-action: none;
    min-width: 100%;
}

.window-title {
    font-weight: bold;
    font-size: 1.1em;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.window-button {
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0.8em;
    color: #333;
}

.window-button i {
    visibility: visible;
    color: #333;
}

.window-button:hover i {
    color: #000;
}

.minimize-btn { background-color: #ffbd44; }
.minimize-btn:hover { background-color: #e0ac3c; }

.maximize-btn { background-color: #00ca4e; }
.maximize-btn:hover { background-color: #00a840; }

.close-btn { background-color: #ff605c; }
.close-btn:hover { background-color: #e05450; }

.window-content {
    flex-grow: 1;
    overflow: hidden;
    padding: 0;
    width: 100%;
    height: 100%;
}

.window-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ============================================
   BARRA DE TAREAS
   ============================================ */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background-color: #1a1e24;
    border-top: 1px solid #333;
    display: flex;
    align-items: center;
    padding: 0 10px;
    z-index: 4000;
}

.taskbar-item {
    background-color: #3a404a;
    color: var(--text-light);
    border: none;
    padding: 5px 10px;
    margin-right: 10px;
    border-radius: 5px;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.taskbar-item:hover {
    background-color: #4a515c;
}

.taskbar-item.active {
    background-color: var(--button-hover);
    box-shadow: 0 0 8px rgba(0, 183, 230, 0.5);
}

/* ============================================
   MODALES
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

/* Modal de unirse */
.modal-join-content {
    background-color: var(--bg-medium);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
    width: 90%;
    max-width: 400px;
    text-align: center;
    animation: fadeIn 0.3s ease-out;
}

/* Modal de configuración */
.modal-content {
    background: #2a2d31;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    color: #cdd7dc;
    position: relative;
}

/* Modal de sistema */
.system-modal-content {
    background: #1e1e1e;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    color: #ffffff;
    text-align: left;
    max-width: 500px;
    width: 90%;
    animation: fadeIn 0.3s ease-out;
}

/* Botones de modal */
.modal-button-group {
    display: flex;
    justify-content: space-around;
    gap: 15px;
    margin-top: 20px;
}

.modal-button {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: bold;
    flex-grow: 1;
}

.primary-button {
    background-color: var(--accent-blue);
    color: var(--text-dark);
}

.primary-button:hover {
    background-color: #4dbfff;
}

.secondary-button {
    background-color: #6c757d;
    color: white;
}

.secondary-button:hover {
    background-color: #5a6268;
}

/* Botón de imagen D-Pad en modal */
.modal-button-group.index-remote-image-container {
    display: flex;
    justify-content: center;
    margin: 25px 0;
}

.index-remote-image-button {
    background: none;
    border: none;
    padding: 0;
    width: 150px;
    height: 150px;
    transition: transform 0.1s;
}

.modal-dpad-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.index-remote-image-button:hover {
    transform: scale(1.2);
    filter: brightness(1.1);
}

.index-remote-image-button:active {
    transform: scale(0.98);
}

/* Listas de opciones en modales */
#configOptions,
#systemConfigOptions {
    list-style: none;
    padding: 0;
    margin: 0;
}

#configOptions {
    max-height: 300px;
    overflow-y: auto;
}

#configOptions li {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 5px;
    cursor: pointer;
}

#configOptions li.highlighted {
    background: #3a3f46;
}

#configOptions li img {
    width: 70px;
    height: 70px;
    margin-right: 10px;
    object-fit: contain;
}

#systemConfigOptions li {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#systemConfigOptions li i {
    margin-right: 10px;
}

#systemConfigOptions li.highlighted {
    background: #4b525d;
    font-weight: bold;
}

/* ============================================
   REPRODUCTOR DE VIDEO Y CONTENIDO
   ============================================ */
.video-container {
    background: #000;
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.video-container video,
.video-container #youtubePlayer {
    width: 100%;
    height: 100%;
}

#videoPlayer, #youtubePlayer {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Pantalla de cine */
.cinema-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.cinema-preloader {
    width: 80px;
    height: 80px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #4CAF50;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 30px;
}

.waiting-text {
    color: white;
    font-size: 2em;
    font-weight: bold;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.waiting-subtext {
    color: #ccc;
    font-size: 1.2em;
    margin-top: 10px;
    text-align: center;
}

.cinema-room-code {
    position: absolute;
    top: 30px;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 101;
}

.cinema-room-code span {
    color: #ffeb3b;
    font-size: 2.5em;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 30px;
    border-radius: 15px;
    border: 3px solid #4CAF50;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
}

/* Contenedor de contenido principal */
#contentContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #000;
    display: none;
    z-index: 9999;
}

#mainVideo,
#mainImage {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#mainVideo {
    object-fit: cover;
}

.close-video {
    position: absolute;
    top: 20px;
    right: 20px;
    background: red;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 1.2em;
    z-index: 10000;
}

/* Indicadores en pantalla */
.meeting-id-display,
.sala-code {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-light);
    padding: 10px;
    border-radius: 5px;
    z-index: 10;
}

.meeting-id-display {
    font-size: 2.2em;
}

.sala-code {
    color: yellow;
    font-size: 1.8em;
    font-weight: bold;
}

.audio-indicator {
    position: absolute;
    top: 60px;
    left: 10px;
    color: #2196F3;
    font-size: 1.2em;
    font-weight: bold;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    padding: 5px 10px;
    border-radius: 5px;
}

.playlist-indicator {
    position: absolute;
    top: 100px;
    left: 10px;
    color: #4CAF50;
    font-size: 1.2em;
    font-weight: bold;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    padding: 5px 10px;
    border-radius: 5px;
}

/* ============================================
   GESTIÓN DE ARCHIVOS Y VIDEOS
   ============================================ */
.video-list-container {
    background: #333;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.video-list-item {
    background: #444;
    padding: 12px;
    margin: 8px 0;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid #007bff;
}

.video-list-item:hover {
    background: #555;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.video-list-item.playing {
    border-left: 4px solid #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.video-info {
    flex: 1;
    color: white;
    min-width: 0;
}

.video-name {
    font-weight: bold;
    font-size: 0.95em;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-name i.fa-video { color: #2196F3; }
.video-name i.fa-image { color: #4CAF50; }

.video-path {
    font-size: 0.75em;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.video-duration {
    font-size: 0.75em;
    color: #FF9800;
    font-weight: bold;
}

.video-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Botones de acción de video */
.delete-video-btn,
.preview-video-btn,
.play-video-btn,
.repeat-video-btn,
.rotate-single-btn,
.audio-button,
.rotate-button {
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.delete-video-btn { background: #f44336; }
.delete-video-btn:hover { background: #d32f2f; }

.preview-video-btn { background: #2196F3; }
.preview-video-btn:hover { background: #1976d2; }

.play-video-btn { background: #FF9800; }
.play-video-btn:hover { background: #f57c00; }

.repeat-video-btn,
.rotate-single-btn { background: #9C27B0; }
.repeat-video-btn:hover,
.rotate-single-btn:hover { background: #7b1fa2; }

.repeat-video-btn.active,
.rotate-single-btn.active,
.audio-button.active,
.rotate-button.active {
    background: #4CAF50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}

.audio-button { background: #2196F3; }
.audio-button:hover { background: #1976d2; }

.rotate-button { background: #9C27B0; }
.rotate-button:hover { background: #7b1fa2; }

/* Indicador de reproducción */
.playing-indicator {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    margin-left: 8px;
    animation: pulse 2s infinite;
}

/* Secciones de rotación y audio */
.rotate-section,
.audio-section {
    background: #333;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
}

/* ============================================
   MODAL DE PREVISUALIZACIÓN
   ============================================ */
.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.preview-modal-content {
    background: #333;
    border-radius: 10px;
    padding: 20px;
    max-width: 90%;
    max-height: 90%;
    width: 800px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.preview-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #555;
}

.preview-modal-title {
    color: white;
    font-size: 1.2em;
    font-weight: bold;
    margin: 0;
}

.preview-close-btn {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
}

.preview-close-btn:hover {
    background: #d32f2f;
}

.preview-container {
    width: 100%;
    background: #000;
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.preview-video,
.preview-image {
    max-width: 100%;
    max-height: 70vh;
    display: block;
}

.preview-file-info {
    margin-top: 10px;
    color: #ccc;
    font-size: 0.9em;
    text-align: center;
}

/* ============================================
   ESTADO DE SUBIDA Y PROGRESO
   ============================================ */
.upload-status {
    margin-top: 10px;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
}

.upload-success {
    background: #4CAF50;
    color: white;
}

.upload-error {
    background: #f44336;
    color: white;
}

.upload-info {
    background: #2196F3;
    color: white;
}

.upload-progress {
    background: #333;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    display: none;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    color: white;
}

.progress-bar-container {
    background: #2c3e50;
    border-radius: 10px;
    height: 12px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    transition: width 0.3s;
    border-radius: 10px;
}

.progress-details {
    color: #ccc;
    font-size: 0.85em;
    text-align: center;
}

/* ============================================
   ESTADO DE CONEXIÓN Y SERVIDOR
   ============================================ */
.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-connected { background-color: #4CAF50; }
.status-disconnected { background-color: #f44336; }
.status-connecting { background-color: #FF9800; }
.status-blocked { 
    background: #ff6b6b !important; 
    animation: pulse-red 2s infinite; 
}

.server-rotation-info {
    background: #2c3e50;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    border-left: 4px solid #3498db;
}

.server-rotation-info.active {
    border-left-color: #2ecc71;
}

/* ============================================
   INFORMACIÓN DE ALMACENAMIENTO
   ============================================ */
.storage-info {
    background: #34495e;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    text-align: center;
    border-left: 4px solid #e74c3c;
}

.storage-info.good { border-left-color: #2ecc71; }
.storage-info.warning { border-left-color: #f39c12; }
.storage-info.danger { border-left-color: #e74c3c; }

.storage-progress {
    background: #2c3e50;
    border-radius: 10px;
    height: 8px;
    margin: 8px 0;
    overflow: hidden;
}

.storage-progress-bar {
    height: 100%;
    background: #3498db;
    transition: width 0.3s;
}

.storage-progress-bar.good { background: #2ecc71; }
.storage-progress-bar.warning { background: #f39c12; }
.storage-progress-bar.danger { background: #e74c3c; }

.videos-count {
    color: #4CAF50;
    font-weight: bold;
    margin-left: 10px;
}

/* ============================================
   OCR Y RECONOCIMIENTO
   ============================================ */
.ocr-results-section,
.ocr-section {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.ocr-section {
    border-left: 4px solid #3498db;
}

.ocr-results-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #3498db;
    color: #2c3e50;
}

.ocr-results-table {
    overflow-x: auto;
}

.ocr-results-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 6px;
    overflow: hidden;
}

.ocr-results-table th {
    background: #3498db;
    color: white;
    padding: 10px;
    text-align: left;
    font-weight: 600;
}

.ocr-results-table td {
    padding: 10px;
    border-bottom: 1px solid #e9ecef;
}

.ocr-results-table tr:hover {
    background: #f8f9fa;
}

.ocr-result-value,
.ocr-value {
    color: #27ae60;
    font-weight: bold;
    font-size: 1.1em;
}

.ocr-confidence {
    color: #3498db;
    font-weight: bold;
}

.ocr-not-found {
    color: #e74c3c;
    font-style: italic;
}

.ocr-result-item {
    margin: 8px 0;
    padding: 10px;
    background: white;
    border-radius: 5px;
    border-left: 3px solid #27ae60;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ocr-actions {
    margin-top: 10px;
    text-align: center;
}

.ocr-results-table img {
    transition: transform 0.2s ease;
}

.ocr-results-table img:hover {
    transform: scale(1.1);
}

/* ============================================
   VOUCHERS Y CONTROL MASTER
   ============================================ */
.voucher-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.voucher-modal-content {
    background: white;
    padding: 25px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.voucher-preview {
    max-width: 100%;
    max-height: 300px;
    margin: 15px 0;
    border-radius: 5px;
}

.voucher-notification-indicator {
    margin: 10px 0;
    text-align: center;
}

.voucher-status-section {
    background: rgba(52, 73, 94, 0.8);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    border: 1px solid #34495e;
}

.voucher-actions,
.storage-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.voucher-btn {
    background: #ff9800;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.9em;
}

.voucher-btn:hover {
    background: #f57c00;
}

/* Bloqueo por Master */
.master-blocked-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 107, 107, 0.1);
    z-index: 999;
    pointer-events: none;
    display: none;
}

.master-blocked-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ff6b6b;
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.controls-disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

/* ============================================
   MENSAJES Y NOTIFICACIONES
   ============================================ */
.message {
    margin-top: 20px;
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
    width: 100%;
    text-align: center;
}

.message.error {
    background-color: var(--accent-red);
    color: white;
}

.message.success {
    background-color: var(--accent-green);
    color: white;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background-color: #333;
    width: 100%;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 1000;
}

.copyright-link {
    color: #ccc;
    text-decoration: none;
    font-size: 1.1vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60vw;
}

.copyright-link:hover {
    color: #fff;
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes pulse-red {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading {
    color: #ffeb3b;
    font-style: italic;
}

.room-code-disconnected {
    color: #f44336 !important;
    font-style: italic;
}

/* ============================================
   MEDIA QUERIES - RESPONSIVIDAD
   ============================================ */

/* Pantallas grandes */
@media (max-width: 1100px) {
    .lobby-buttons {
        gap: 20px;
    }
    
    .lobby-button {
        min-width: 220px;
        max-width: 300px;
    }
}

/* Tablets */
@media (max-width: 900px) {
    .lobby-buttons {
        gap: 25px;
    }
    
    .lobby-button {
        min-height: 220px;
        max-width: 220px;
    }
    
    .lobby-button .icon-image {
        width: 120px;
        height: 120px;
    }
    
    .lobby-button span {
        font-size: 1.3em;
    }
    
    .window-modal {
        width: 95vw !important;
        height: 85vh !important;
        min-width: 95vw;
        min-height: 85vh;
        transform: translate(-50%, -50%) !important;
        resize: none;
    }
}

/* Tablets pequeñas */
@media (max-width: 768px) {
    .lobby-container,
    .remote-container,
    .screen-container {
        max-width: 90%;
        padding: 15px;
    }
    
    .video-container {
        height: 300px;
    }
    
    .modal-join-content {
        padding: 20px;
    }
}

/* Móviles grandes */
@media (max-width: 700px) {
    .lobby-buttons {
        gap: 20px;
    }
    
    .lobby-button {
        min-height: 190px;
        max-width: 190px;
    }
    
    .lobby-button .icon-image {
        width: 120px;
        height: 120px;
    }
    
    .lobby-button span {
        font-size: 1.2em;
    }
    
    .remote-shell {
        width: 320px;
        padding: 14px;
    }
    
    .big-button {
        width: 56px;
        height: 56px;
    }
    
    .round {
        width: 42px;
        height: 42px;
    }
    
    .round.large {
        width: 56px;
        height: 56px;
    }
    
    .dpad .center {
        width: 76px;
        height: 40px;
    }
}

/* Móviles medianos */
@media (max-width: 600px) {
    .lobby-container {
        padding: 20px;
    }
    
    .lobby-button {
        min-height: 150px;
    }
    
    .lobby-button .icon-image {
        width: 100px;
        height: 100px;
    }
    
    .remote-container {
        min-height: auto;
        padding: 10px 5px;
        max-width: 100%;
        border-radius: 0;
        border: none;
    }
    
    .remote-top,
    .remote-channels,
    .remote-volume,
    .remote-dpad,
    .media-controls,
    .timeline-container {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
        justify-content: center;
    }
    
    .remote-button,
    .media-button {
        width: 60px;
        height: 60px;
        font-size: 1.5em;
    }
    
    #enterBtn {
        width: 80px;
    }
    
    input[type="range"] {
        width: 80%;
    }
    
    .video-container {
        height: calc(100vh - 60px);
    }
    
    .meeting-id-display {
        font-size: 1.5em;
        padding: 5px;
        top: 5px;
        left: 5px;
    }
    
    .close-room-button {
        width: 100%;
        margin-top: 10px;
        font-size: 1.2em;
        padding: 15px;
    }
    
    .modal-content {
        width: 90%;
    }
    
    h1 {
        font-size: 1.5em;
    }
}

/* Móviles pequeños */
@media (max-width: 550px) {
    .lobby-buttons {
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }
    
    .lobby-button {
        width: 100%;
        max-width: 300px;
        min-height: 180px;
    }
    
    .lobby-button .icon-image {
        width: 85px;
        height: 85px;
    }
    
    .lobby-button span {
        font-size: 1.3em;
    }
    
    .modal-content,
    .system-modal-content {
        width: 95%;
    }
}

/* Móviles muy pequeños */
@media (max-width: 480px) {
    .lobby-button {
        min-height: 120px;
    }
    
    .lobby-button .icon-image {
        width: 80px;
        height: 80px;
    }
    
    .lobby-button span {
        font-size: 1em;
    }
    
    .modal-button {
        padding: 10px 15px;
    }
    
    .window-modal {
        min-width: 98vw;
        min-height: calc(100vh - 40px);
        border-radius: 0;
    }
    
    .window-controls {
        gap: 5px;
    }
    
    .remote-shell {
        width: 280px;
        padding: 10px;
    }
    
    .big-button {
        width: 48px;
        height: 48px;
    }
    
    .round {
        width: 36px;
        height: 36px;
    }
    
    .round.large {
        width: 48px;
        height: 48px;
    }
    
    .dpad .center {
        width: 66px;
        height: 36px;
    }
}

/* Móviles extra pequeños */
@media (max-width: 350px) {
    .lobby-button {
        min-height: 160px;
    }
    
    .lobby-button .icon-image {
        width: 70px;
        height: 70px;
    }
    
    .modal-content {
        width: 98%;
    }
    
    .system-modal-content {
        width: 95%;
    }
}

/* Orientación landscape */
@media (orientation: landscape) and (max-height: 480px) {
    .remote-shell {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: flex-start;
        width: auto;
        max-width: 100%;
        padding: 10px;
    }
    
    .dpad {
        order: -1;
        margin: 0 20px;
    }
}

/* ============================================
   CLASES DE UTILIDAD
   ============================================ */
.hidden {
    display: none !important;
}

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

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

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

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }

.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }

.p-10 { padding: 10px; }
.p-20 { padding: 20px; }
.p-30 { padding: 30px; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.flex { display: flex; }
.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

.rounded { border-radius: 8px; }
.rounded-lg { border-radius: 12px; }

.shadow { box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); }
.shadow-lg { box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3); }
