html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #121212;
    color: #ffff;
    overflow: hidden;
}

#main-content {
    width: 100%;
    height: 100%;
    padding: 20px;
}

.light-mode {
    background-color: #f0f0f0;
    color: #0000;
}

.hidden {
    display: none;
}

#initial-screen {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.app-title {
    font-size: 2em;
    font-weight: bold;
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 20px;
}

#initial-screen .logo {
    width: 400px;
    height: auto;
    margin-bottom: 20px;
}

#initial-screen button {
    padding: 10px 30px;
    font-size: 18px;
    cursor: pointer;
    border: none;
    background-color: #0000;
    color: #ffff;
    border-radius: 25px;
    margin-top: 20px;
    transition: background-color 0.3s, transform 0.3s;
}

#initial-screen button:hover {
    background-color: #3333;
    transform: scale(1.05);
}

.container {
    display: flex;
    background-color: #282828;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    width: 90%;
    height: 90%;
    max-width: 90%;
    max-height: 90%;
    transition: all 1s ease-out;
    box-sizing: border-box;
    margin: auto;
}

.left-column, aside {
    width: 25%;
    padding: 20px;
    overflow: hidden; /* Cambiado de auto a hidden */
    transition: transform 1s ease-out, width 1s ease-out;
    display: flex;
    flex-direction: column;
}

.left-column {
    border-right: 5px solid #4444;
}

aside {
    border-left: 5px solid #4444;
}

/* Mejora del diseño de la columna izquierda */
.left-column header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.left-column .logo-small {
    width: 200px;
    height: auto;
    margin-bottom: 10px;
}

.left-column h1 {
    text-align: center;
    font-size: 1.2em;
    margin: 0;
    margin-bottom: 10px;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 10px 0;
}

.controls button {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background-color: #4444;
    color: #ffff;
    border: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    min-width: 100px;
}

.controls button:hover {
    background-color: #6666;
    transform: scale(1.05);
}

/* Botón de pantalla completa */
#fullscreenButton {
    background-color: #4444;
    padding: 8px 12px;
    border-radius: 5px;
}

.fullscreen-icon {
    font-size: 1.2em;
}

/* Estilos para modo pantalla completa */
.fullscreen-mode .container {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
}

.left-column #fps {
    margin-top: 10px;
    text-align: center;
}

.left-column #cameraList {
    display: none;
    margin-top: 10px;
}

.left-column #cameraList select,
.left-column #allObjects select {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    background-color: #4444;
    color: #ffff;
    border: none;
    border-radius: 5px;
}

.left-column #allObjects {
    text-align: center;
    overflow-y: auto;
    flex-grow: 1;
}

/* Contenedor de objetos detectados con scroll fijo */
aside {
    display: flex;
    flex-direction: column;
    height: 100%;
}

aside h2 {
    text-align: center;
    margin: 0;
    padding: 10px 0;
    background-color: #282828;
    position: sticky;
    top: 0;
    z-index: 2;
}

#detectedObjects {
    list-style-type: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
}

#detectedObjects li {
    background-color: #4444;
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

#detectedObjects li:hover {
    background-color: #6666;
}

.main {
    flex: 1;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-container {
    position: relative;
    width: 100%;
    padding-top: 75%;
    background-color: black;
    border-radius: 10px;
    overflow: hidden;
}

video, canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5em;
    color: inherit;
}

/* Agregar estos media queries al final de tu archivo CSS */

@media screen and (orientation: portrait) {
    .container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        width: 100%;
        padding: 10px;
    }

    .left-column {
        width: 100%;
        height: auto;
        min-height: 200px;
        border-right: none;
        border-bottom: 5px solid #4444;
        padding: 10px;
    }

    .controls {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
        justify-content: center;
        margin: 10px 0;
    }

    .controls button {
        flex: 1;
        min-width: 100px;
        max-width: 150px;
        padding: 8px;
        margin: 2px;
        font-size: 14px;
    }

    .main {
        order: 2;
        width: 100%;
        height: 40vh;
    }

    .video-container {
        padding-top: 56.25%; /* Relación de aspecto 16:9 */
    }

    aside {
        width: 100%;
        height: auto;
        max-height: 30vh;
        border-left: none;
        border-top: 5px solid #4444;
        overflow-y: auto;
    }

    #allObjects {
        max-height: 150px;
        overflow-y: auto;
    }

    #allObjectsSelect {
        height: 100px;
    }

    .left-column .logo-small {
        width: 150px;
        margin-bottom: 5px;
    }

    .left-column h1 {
        font-size: 1em;
        margin-bottom: 5px;
    }

    #cameraList {
        width: 100%;
        margin: 5px 0;
    }

    #cameraSelect, #selectCamera {
        width: 100%;
        margin: 5px 0;
    }
}

/* Ajustes adicionales para pantallas muy pequeñas */
@media screen and (max-width: 320px) {
    .controls button {
        min-width: 80px;
        font-size: 12px;
        padding: 6px;
    }

    .left-column h1 {
        font-size: 0.9em;
    }
}

/* Asegurar que los botones sean siempre visibles */
.controls button {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
}

/* Ajuste para el contenedor de controles */
.controls {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
    justify-content: center !important;
    margin: 10px 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
}