/* assets/css/style.css */

/* RESET BÁSICO Y FUENTE */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background-color: #b0b0b0; /* gris escritorio */
}

/* CONTENEDOR CENTRAL TIPO ESCRITORIO */
.desktop-center {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px; /* da respiro en móviles */
}

/* VENTANA TIPO SWING */
.app-window {
    background-color: #e0e0e0;
    border: 1px solid #4f4f4f;
    box-shadow: 0 0 0 1px #ffffff inset,
                0 0 8px rgba(0, 0, 0, 0.4);
    width: 850px;        /* más ancho para tablas en escritorio */
    max-width: 100%;     /* que nunca se salga de la pantalla */
    overflow: hidden;    /* 👈 CAMBIO: nada se dibuja fuera del marco */
}

/* BARRA DE TÍTULO AZUL */
.app-titlebar {
    background: linear-gradient(to bottom, #2b63b8, #1f4e8f);
    color: #ffffff;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
}

/* TÍTULO DE VENTANA */
.app-titlebar-title {
    font-weight: bold;
}

/* BOTONES DE CONTROL SIMULADOS */
.app-titlebar-controls {
    display: flex;
    gap: 4px;
}

.app-titlebar-btn {
    width: 14px;
    height: 14px;
    border: 1px solid #d0d0d0;
    background-color: #f0f0f0;
    box-shadow: 0 0 0 1px #ffffff inset;
    font-size: 10px;
    line-height: 12px;
    text-align: center;
    cursor: default;
}

/* CONTENIDO DE LA VENTANA */
.app-window-body {
    padding: 16px 18px 18px 18px;
    font-size: 14px;
    background-color: #ffffff;

    width: 100%;       /* 👈 CAMBIO: ocupa todo el ancho del marco */
    max-width: 100%;
    overflow-x: auto;  /* 👈 CAMBIO: scroll horizontal interno */
    overflow-y: auto;
}

/* SEPARADOR ESTILO SWING */
.app-separator {
    border-top: 1px solid #ffffff;
    border-bottom: 1px solid #a0a0a0;
    margin: 10px 0 16px 0;
}

/* GRUPOS DE FORMULARIO */
.form-group {
    margin-bottom: 12px;
}

.form-label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
}

/* CAMPOS INPUT TIPO ESCRITORIO PERO TOUCH-FRIENDLY */
.form-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #7a7a7a;
    background-color: #fdfdfd;
    font-size: 14px;
    outline: none;
    min-height: 36px; /* cómodo para dedo */
}

.form-input:focus {
    border-color: #2b63b8;
}

/* BOTONES TIPO SWING */
.btn {
    padding: 6px 14px;
    border: 1px solid #4f4f4f;
    background: linear-gradient(to bottom, #f5f5f5, #d0d0d0);
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 0 0 1px #ffffff inset;
    min-width: 90px;
    min-height: 34px; /* área de toque suficiente */

    /* 👇 Normalización base para consistencia visual */
    font-family: inherit;
    line-height: 1.2;
    vertical-align: middle;
}

/* 👇 NORMALIZACIÓN: mismos estilos reales para <a class="btn"> y <button class="btn"> */
a.btn,
button.btn {
    display: inline-block;     /* <a> deja de ser inline */
    text-decoration: none;     /* quita subrayado del enlace */
    color: inherit;            /* respeta color del botón, especialmente .btn-primary */
}

/* 👇 Neutraliza estilos nativos del botón del navegador/OS */
button.btn {
    -webkit-appearance: none;
    appearance: none;
    background-clip: padding-box;
}

/* 👇 Ajuste fino para que <a> se vea igual que <button> */
a.btn {
    line-height: 20px; /* afina la altura del texto en anchors */
}

.btn:hover {
    background: linear-gradient(to bottom, #ffffff, #dcdcdc);
}

.btn-primary {
    border-color: #1f4e8f;
    background: linear-gradient(to bottom, #3d79d0, #285ba6);
    color: #ffffff;
    box-shadow: 0 0 0 1px #9fbce5 inset;
}

.btn-primary:hover {
    background: linear-gradient(to bottom, #4a86df, #2f63b3);
}

/* 👇 Enfoque accesible y consistente (teclado) */
.btn:focus {
    outline: none;
}

.btn:focus-visible {
    outline: 2px solid rgba(43, 99, 184, 0.45);
    outline-offset: 2px;
}

/* BARRA DE ESTADO INFERIOR */
.app-statusbar {
    margin-top: 10px;
    padding-top: 6px;
    border-top: 1px solid #ffffff;
    font-size: 11px;
    color: #333333;
}

/* MENÚ TIPO LISTA */
.menu-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.menu-list li {
    margin-bottom: 4px;
}

.menu-link {
    text-decoration: none;
    color: #000080;
    font-size: 13px;
}

.menu-link:hover {
    text-decoration: underline;
}

/* BARRA DE MENÚ SUPERIOR */
.app-menubar {
    background-color: #d0d0d0;
    border-bottom: 1px solid #ffffff;
    border-top: 1px solid #a0a0a0;
    padding: 4px 8px;
    font-size: 13px;
    display: flex;
    flex-wrap: wrap;      /* para que se ajuste en móviles */
    gap: 8px 16px;
}

/* LINKS EN MENÚ SUPERIOR */
.app-menubar a {
    text-decoration: none;
    color: #000000;
}

.app-menubar a:hover {
    text-decoration: underline;
}

/* UTILIDADES DE TEXTO */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: #555555;
    font-size: 12px;
}

/* ---------------------------------------------------------
   SECCIÓN RESPONSIVE PARA SMARTPHONES
--------------------------------------------------------- */

@media (max-width: 600px) {
    body {
        background-color: #909090; /* un poco más oscuro, como escritorio compacto */
    }

    .desktop-center {
        align-items: flex-start;   /* empieza desde arriba en móviles */
        padding: 8px;
    }

    .app-window {
        width: 100%;
        max-width: 100%;
        margin-top: 8px;
    }

    .app-window-body {
        padding: 12px 10px 14px 10px;
        font-size: 13px;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: auto;
    }

    .app-titlebar {
        padding: 4px 8px;
        font-size: 12px;
    }

    .form-input {
        font-size: 13px;
        min-height: 38px;
    }

    .btn {
        width: 100%;          /* en móviles los botones ocupan todo el ancho */
        display: inline-block;
        text-align: center;
        min-height: 38px;
    }

    .text-right {
        text-align: center;
    }

    .app-menubar {
        font-size: 12px;
        gap: 6px 10px;
        padding: 4px 6px;
    }

    .menu-link {
        font-size: 12px;
    }
}

/* ---------------------------------------------------------
   DIÁLOGO ESTILO JAVA SWING (MODAL)
--------------------------------------------------------- */

.java-dialog-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.java-dialog {
    background-color: #e0e0e0;
    border: 1px solid #4f4f4f;
    box-shadow: 0 0 0 1px #ffffff inset,
                0 0 8px rgba(0, 0, 0, 0.5);
    width: 320px;
    max-width: 90%;
    font-size: 13px;
}

/* Barra de título del diálogo */
.java-dialog-titlebar {
    background: linear-gradient(to bottom, #2b63b8, #1f4e8f);
    color: #ffffff;
    padding: 6px 8px;
    font-weight: bold;
    font-size: 13px;
}

/* Cuerpo del diálogo */
.java-dialog-body {
    padding: 12px 14px;
}

/* Pie del diálogo */
.java-dialog-footer {
    padding: 8px 14px 10px 14px;
    border-top: 1px solid #ffffff;
    display: flex;
    justify-content: flex-end;
}

/* Botón dentro del diálogo: reutiliza .btn y .btn-primary */
.java-dialog-footer .btn {
    min-width: 80px;
}
