/* ========================================
   RESET Y ESTILOS BASE
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* ========================================
   CONTENEDOR PRINCIPAL
   ======================================== */

body {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ========================================
   ENCABEZADOS
   ======================================== */

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 40px;
    font-size: 2.5rem;
    border-bottom: 3px solid #3498db;
    padding-bottom: 15px;
}

h2 {
    color: #34495e;
    font-size: 1.3rem;
    margin-bottom: 15px;
}

/* ========================================
   SECCIONES
   ======================================== */

.seccion {
    background: white;
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.seccion:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ========================================
   INPUTS
   ======================================== */

input[type="text"],
input[type="number"],
input[type="date"] {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 12px;
    border: 1px solid #bdc3c7;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.3);
}

/* ========================================
   BOTONES
   ======================================== */

button {
    background-color: #3498db;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: 100%;
    font-weight: 600;
}

button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

/* ========================================
   RESULTADOS
   ======================================== */

.resultado {
    background-color: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 15px;
    margin-top: 15px;
    border-radius: 4px;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    word-break: break-word;
    white-space: pre-wrap;
    display: none;
}

.resultado:not(:empty) {
    display: block;
}

/* ========================================
   ESTILOS PARA JSON/TEXTOS EN RESULTADOS
   ======================================== */

.resultado {
    color: #2c3e50;
}

.resultado.error {
    border-left-color: #e74c3c;
    background-color: #fadbd8;
    color: #c0392b;
}

.resultado.success {
    border-left-color: #27ae60;
    background-color: #d5f4e6;
    color: #1e5631;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
        padding-bottom: 10px;
        margin-bottom: 30px;
    }

    h2 {
        font-size: 1.1rem;
    }

    .seccion {
        padding: 15px;
        margin-bottom: 15px;
    }

    button {
        padding: 10px 18px;
        font-size: 0.95rem;
    }

    input[type="text"],
    input[type="number"],
    input[type="date"] {
        padding: 10px 12px;
        margin-bottom: 10px;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .seccion {
        padding: 12px;
        margin-bottom: 12px;
    }

    input[type="text"],
    input[type="number"],
    input[type="date"] {
        padding: 8px 10px;
        margin-bottom: 8px;
    }
}

/* ========================================
   SCROLLBAR PERSONALIZADO (opcional)
   ======================================== */

.resultado::-webkit-scrollbar {
    width: 8px;
}

.resultado::-webkit-scrollbar-track {
    background: #ecf0f1;
    border-radius: 10px;
}

.resultado::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 10px;
}

.resultado::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* ========================================
   TABLAS
   ======================================== */

.tabla-resultados {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 0.95rem;
}

.tabla-resultados thead {
    background-color: #3498db;
    color: white;
}

.tabla-resultados th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #2980b9;
}

.tabla-resultados tbody tr {
    border-bottom: 1px solid #ecf0f1;
    transition: background-color 0.2s ease;
}

.tabla-resultados tbody tr:hover {
    background-color: #ecf0f1;
}

.tabla-resultados td {
    padding: 10px 15px;
    word-wrap: break-word;
}

.tabla-resultados tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* ========================================
   RESPONSIVE TABLAS
   ======================================== */

@media (max-width: 768px) {
    .tabla-resultados {
        font-size: 0.85rem;
    }

    .tabla-resultados th,
    .tabla-resultados td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .tabla-resultados {
        font-size: 0.8rem;
    }

    .tabla-resultados th,
    .tabla-resultados td {
        padding: 6px 8px;
    }
}
