/* ============================================================
   Archivo: style.css
   Sucesión Abisay (Estilos Globales, Chasis 3D y Flex Pool)
   ============================================================ */

/* ============================
   ESTILO GLOBAL
   ============================ */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
}

.main-wrapper {
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
}

/* ============================
   FILA 1: Cabecera
   ============================ */
.header-row {
    background-color: #222;
    color: white;
    padding: 15px;
    text-align: center;
}

.header-row h1 {
    margin: 0;
    font-size: 24px;
}

.header-row nav {
    margin-top: 10px;
}

.header-row nav a {
    color: white;
    margin: 0 10px;
    text-decoration: none;
    font-weight: bold;
}

.header-row nav a:hover {
    text-decoration: underline;
}

/* ============================
   FILA 2: Grid Asimétrico Maestro (3 Columnas Reales)
   ============================ */
.content-row {
    display: grid;
    grid-template-columns: 1.5fr 1.0fr 1.5fr;
    gap: 15px;
    padding: 15px;
    box-sizing: border-box;
    align-items: stretch;
}

.main-column {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.main-column > .box {
    flex: 1;
}

.row-bottom {
    grid-column: 1 / -1;
    margin-top: 5px;
}

.box {
    border: 1px solid #333;
    padding: 15px;
    border-radius: 4px;
    background-color: #fafafa;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
    box-sizing: border-box;
}

.box h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

/* ============================================================
   CHASIS GRIS TÉCNICO BAJO LOS BOTONES Y BOTONERA 3D (EFECTO CALCULADORA)
   ============================================================ */
.grid-3d-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    background-color: #d1d5db !important;
    padding: 14px;
    border-radius: 20px;
    box-shadow:
        inset 0px 3px 6px rgba(0, 0, 0, 0.25),
        0px 4px 10px rgba(0, 0, 0, 0.08);
    width: max-content;
    margin: 15px auto;
}

.cell-button-3d {
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: bold;
    color: #ffffff;
    border-radius: 16px;
    text-shadow: 0px 2px 3px rgba(0, 0, 0, 0.5);
    user-select: none;
    box-sizing: border-box;
    transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease !important;
    cursor: pointer;
}

.cell-button-3d.gris-base {
    background-image: linear-gradient(135deg, #757f9a, #4a569d);
    box-shadow: 0px 6px 0px #2c3e50, inset 0px 4px 4px rgba(255,255,255,0.2), inset 0px -4px 6px rgba(0,0,0,0.3);
}
.cell-button-3d.cell-azul {
    background-image: linear-gradient(135deg, #00b4db, #0083b0);
    box-shadow: 0px 6px 0px #0056b3, inset 0px 4px 4px rgba(255,255,255,0.3), inset 0px -4px 6px rgba(0,0,0,0.3);
}
.cell-button-3d.cell-verde {
    background-image: linear-gradient(135deg, #11998e, #38ef7d);
    box-shadow: 0px 6px 0px #145a32, inset 0px 4px 4px rgba(255,255,255,0.3), inset 0px -4px 6px rgba(0,0,0,0.3);
}
.cell-button-3d.cell-rojo {
    background-image: linear-gradient(135deg, #ff416c, #ff4b2b);
    box-shadow: 0px 6px 0px #641e16, inset 0px 4px 4px rgba(255,255,255,0.3), inset 0px -4px 6px rgba(0,0,0,0.3);
}

.cell-button-3d.gris-base:hover { transform: translateY(3px); box-shadow: 0px 3px 0px #2c3e50, inset 0px 4px 4px rgba(255,255,255,0.2), inset 0px -4px 6px rgba(0,0,0,0.3); }
.cell-button-3d.cell-azul:hover { transform: translateY(3px); box-shadow: 0px 3px 0px #0056b3, inset 0px 4px 4px rgba(255,255,255,0.3), inset 0px -4px 6px rgba(0,0,0,0.3); }
.cell-button-3d.cell-verde:hover { transform: translateY(3px); box-shadow: 0px 3px 0px #145a32, inset 0px 4px 4px rgba(255,255,255,0.3), inset 0px -4px 6px rgba(0,0,0,0.3); }
.cell-button-3d.cell-rojo:hover { transform: translateY(3px); box-shadow: 0px 3px 0px #641e16, inset 0px 4px 4px rgba(255,255,255,0.3), inset 0px -4px 6px rgba(0,0,0,0.3); }

/* ============================
   FORMULARIOS, INPUTS Y BOTONES
   ============================ */
.form-group {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
}

.form-group label {
    font-weight: bold;
    color: #333;
    min-width: 90px;
}

input[type="text"] {
    width: 6ch;
    padding: 5px;
    font-size: 14px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
}

button {
    background-color: #222;
    color: white;
    border: none;
    padding: 6px 12px;
    margin-left: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.2s;
}

button:disabled { background-color: #888; cursor: not-allowed; }
button:hover:not(:disabled) { background-color: #444; } 
input[readonly].locked { background-color: #e9ecef; color: #495057; border: 1px solid #ced4da; cursor: not-allowed; }
input[type="text"]:disabled { background-color: #e9ecef; color: #6c757d; cursor: not-allowed; }
#no_x4 { margin-left: 12px; transform: scale(1.2); cursor: pointer; }
#no_x4:disabled { cursor: not-allowed; }

.control-btn-wrapper {
    text-align: center;
    margin-top: 10px;
}
.btn-calcular {
    background-color: #222;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    box-shadow: 0px 4px 0px #000, 0px 4px 6px rgba(0,0,0,0.2);
    transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.2s;
}
.btn-calcular:hover { background-color: #333; }
.btn-calcular:active { transform: translateY(3px); box-shadow: 0px 1px 0px #000; }

.probables-pool {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px;
    min-height: 65px;
    background-color: #fafafa;
    border: 1px solid #333;
    border-radius: 4px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
}

.probable-tag {
    background: #f1f3f5;
    color: #222;
    padding: 6px 14px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 15px;
    border-left: 4px solid #222;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.probable-btn {
    background-color: #222;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 15px;
    cursor: default;
    min-width: 50px;
    text-align: center;
}

/* ============================================================
   ESTILOS DE LA TABLA ANALÍTICA DINÁMICA DE LA BITÁCORA
   ============================================================ */
.tabla-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #333;
    border-radius: 4px;
    margin-bottom: 10px;
}

.tabla-analitica-abisay {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: center;
}

.tabla-analitica-abisay th {
    background-color: #222;
    color: white;
    padding: 8px;
    font-weight: bold;
    border: 1px solid #333;
}

.tabla-analitica-abisay td {
    padding: 6px;
    border: 1px solid #dddddd;
    vertical-align: middle;
}

.fila-rojo { background-color: #fce8e6; color: #c5221f; }
.fila-rojo .col-digito-base { background-color: #fad2cf; font-weight: bold; border-right: 3px solid #c5221f; }

.fila-verde { background-color: #e6f4ea; color: #137333; }
.fila-verde .col-digito-base { background-color: #c2e7cd; font-weight: bold; border-right: 2px solid #137333; }

.fila-azul { background-color: #e8f0fe; color: #1a73e8; }
.fila-azul .col-digito-base { background-color: #d2e3fc; font-weight: bold; border-right: 2px solid #1a73e8; }

.log-line-footer {
    margin-top: 12px;
    padding: 8px;
    background-color: #222222;
    color: #00ff00;
    font-family: monospace;
    font-size: 0.8rem;
    border-radius: 4px;
    max-height: 75px;
    overflow-y: auto;
    text-align: left;
    border-left: 4px solid #00aa00;
    line-height: 1.4;
}

@keyframes efectoRuletaAbisay {
    0%, 100% {
        transform: translateY(0);
        outline: 0px solid transparent;
        box-shadow: 0px 6px 0px rgba(0, 0, 0, 0.3), inset 0px 4px 4px rgba(255,255,255,0.2), inset 0px -4px 6px rgba(0,0,0,0.3) !important;
    }
    15% {
        transform: translateY(4px);
        outline: 4px solid #ffd700 !important;
        outline-offset: -2px;
        box-shadow: 0px 2px 0px #b58900, 0px 0px 25px #ffd700, 0px 0px 45px #ffa500, inset 0px 4px 4px rgba(255,255,255,0.3), inset 0px -4px 6px rgba(0,0,0,0.3) !important;
    }
}

/* ============================================================
   MEDIA QUERIES: ADAPTACIÓN RESPONSIVA
   ============================================================ */
@media (max-width: 991px) and (min-width: 768px) {
    .content-row { grid-template-columns: 1fr 1fr; }
    .col-permutaciones { grid-column: span 2; margin-top: 10px; }
    .row-bottom { grid-template-columns: 1fr 1fr !important; }
}

@media (max-width: 767px) {
    .content-row { display: flex; flex-direction: column; padding: 10px; gap: 15px; }
    .main-column { width: 100%; }
    .row-bottom { display: flex !important; flex-direction: column; gap: 15px; }
    .form-group { width: 100%; }
    .form-group input[type="text"] { flex: 1; max-width: 120px; }
    .grid-3d-container { grid-template-columns: repeat(2, 1fr); gap: 12px; background-color: #d1d5db !important; padding: 14px; border-radius: 20px; box-shadow: inset 0px 3px 6px rgba(0, 0, 0, 0.25), 0px 4px 10px rgba(0, 0, 0, 0.08); width: max-content; margin: 15px auto; }
    .cell-button-3d { width: 65px; height: 65px; font-size: 1.8rem; border-radius: 16px; }
}

