/* ========================================
   ✅ STYLES.CSS - Versión limpia y responsive
   ======================================== */

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base del body */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.4;
    text-align: center;
    margin: 0;
    padding: 10px;
    font-size: 16px;
    /* Base fija para rem */
    overflow-x: hidden;
}

/* Ocultar contenido hasta verificar sesión */
body.oculto {
    display: none;
}

/* ========================================
   🔹 Cabecera superior: 6 datos en grilla
   ======================================== */
.info-superior {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin: 10px auto;
    max-width: 1200px;
    padding: 0;
}

.info-superior div {
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 5px 3px;
    text-align: center;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.info-superior .label {
    font-size: 0.8rem;
    font-weight: bold;
    color: #555;
}

.info-superior .value {
    font-size: 0.9rem;
    font-weight: bold;
    color: #111;
}

/* Clases de alerta */
.naranja-suave {
    background-color: #ff9800;
    color: black;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.8rem;
    font-weight: bold;
    display: inline-block;
}

.rojo-suave {
    background-color: red;
    color: black;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.8rem;
    font-weight: bold;
    display: inline-block;
}

/* ========================================
   🔹 Grilla de pasos (3 columnas)
   ======================================== */
.grilla-pasos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 1200px;
    margin: 15px auto;
    padding: 0 10px;
}

/* Bloque de cada paso */
.paso-bloque {
    background-color: white;
    border: 2px solid #007bff;
    border-radius: 0;
    padding: 8px;
    text-align: left;
    position: relative;
    font-size: 0.8rem;
}

.paso-bloque h3 {
    color: #8B0000;
    font-size: 1rem;
    margin: 5px 0;
}

.paso-bloque .evento-fecha {
    font-size: 0.9rem;
    font-weight: bold;
    color: #444;
}

.paso-bloque .titulo-evento {
    font-weight: bold;
}

.paso-bloque .dia-anterior {
    color: #D2691E;
    font-weight: bold;
}

.paso-bloque .dia-actual {
    color: #004085;
    font-weight: bold;
}

.paso-bloque .dia-siguiente {
    color: #006400;
    font-weight: bold;
}

/* Bloque vacío (espaciador) */
.paso-bloque.vacio {
    border-style: dashed;
    border-color: #999;
    background-color: #f7f7f7;
    color: #999;
    text-align: center;
    font-style: italic;
    font-size: 0.8rem;
    padding: 20px 0;
}

/* Botón para Google Drive */
.ciclo-btn {
    background-color: #ff9900;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.75rem;
    cursor: pointer;
    margin-left: 8px;
}

/* Año homólogo (arriba a la derecha del bloque) */
.año-homologo {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 0.8rem;
    font-style: italic;
    color: #666;
    background: #eee;
    padding: 2px 6px;
    border-radius: 4px;
}

/* ========================================
   🔹 Menú de pestañas (consultar / registro)
   ======================================== */
.menu-compacto {
    grid-column: 1 / -1;
    text-align: center;
}

.menu-tabs {
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    background: white;
}

.tab-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.tab-buttons button {
    background-color: #2980b9;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    min-width: 180px;
}

.tab-buttons button:hover {
    background-color: #1c5980;
}

/* ========================================
   🔹 Área dinámica: registro y consulta
   ======================================== */
#area-dinamica {
    background: #f9f9f9;
    border: 1px dashed #ccc;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    font-size: 0.9rem;
    text-align: left;
}

#area-dinamica h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #333;
}

#area-dinamica textarea,
#area-dinamica input[type="date"],
#area-dinamica button {
    font-size: 0.9rem;
    margin: 5px 0;
    padding: 8px;
}

#area-dinamica textarea {
    width: 100%;
    resize: vertical;
    min-height: 80px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.input-boton {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.input-boton input[type="date"] {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.input-boton button {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.input-boton button:first-child {
    background-color: #28a745;
    color: white;
}

.input-boton button:last-child {
    background-color: #ffc107;
    color: #333;
}

.input-boton button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* ========================================
   📱 RESPONSIVE: Móviles y tablets
   ======================================== */
@media (max-width: 768px) {
    body {
        padding: 8px;
        font-size: 15px;
    }

    h1 {
        font-size: 1.4rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    /* Cabecera superior: 2 columnas en móvil */
    .info-superior {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 0 10px;
    }

    .info-superior .label {
        font-size: 0.75rem;
    }

    .info-superior .value {
        font-size: 0.85rem;
    }

    /* Grilla: 1 columna en móvil pequeño */
    @media (max-width: 480px) {
        .grilla-pasos {
            grid-template-columns: 1fr;
            gap: 8px;
            padding: 0 5px;
        }
    }

    /* En tablets: 2 columnas */
    @media (min-width: 481px) and (max-width: 768px) {
        .grilla-pasos {
            grid-template-columns: repeat(2, 1fr);
        }
    }

    /* Menú de pestañas: vertical en móvil */
    .tab-buttons {
        flex-direction: column;
    }

    .tab-buttons button {
        width: 100%;
        min-width: auto;
    }

    /* Área dinámica */
    #area-dinamica {
        padding: 12px;
    }

    #area-dinamica textarea,
    #area-dinamica input,
    #area-dinamica button {
        font-size: 1rem;
        width: 100%;
    }

    .input-boton {
        flex-direction: column;
        align-items: stretch;
    }

    .input-boton button {
        width: 100%;
    }

    /* Ajuste de bloques de pasos */
    .paso-bloque {
        font-size: 0.85rem;
        padding: 6px;
    }

    .paso-bloque h3 {
        font-size: 1rem;
    }

    .ciclo-btn {
        font-size: 0.8rem;
        padding: 4px 6px;
    }
}

/* ========================================
   💻 Pantallas grandes (opcional)
   ======================================== */
@media (min-width: 1200px) {
    .grilla-pasos {
        grid-template-columns: repeat(3, 1fr);
    }

    .info-superior {
        grid-template-columns: repeat(6, 1fr);
    }
}