* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f6f8;
    color: #202124;
}

a {
    color: inherit;
    text-decoration: none;
}


/* HEADER */

.site-header {
    background: #202124;
    color: white;
}

.header-inner {
    max-width: 1100px;
    margin: auto;
    padding: 16px 24px;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 20px;
    font-weight: bold;
}

.main-nav {
    display: flex;
    gap: 24px;
}

.main-nav a {
    color: #ffffff;
    opacity: 0.9;
}

.main-nav a:hover {
    opacity: 1;
}


/* CONTENEDOR */

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px;
}


/* HERO */

.hero {
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

.hero p {
    font-size: 18px;
    color: #5f6368;
}


/* CARDS */

.cards {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(250px, 1fr));

    gap: 20px;
}

.card {
    background: white;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 24px;

    transition:
        transform 0.1s ease,
        box-shadow 0.1s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card h2 {
    margin-top: 0;
}

.card p {
    color: #5f6368;
    line-height: 1.5;
}

.card-action {
    display: inline-block;
    margin-top: 15px;
    font-weight: bold;
}


/* PAGE HEADER */

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    margin-bottom: 8px;
}

.page-header p {
    color: #5f6368;
}


/* SEARCH */

.search-panel {
    background: white;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 25px;
}

.search-panel label {
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
}

.search-row {
    display: flex;
    gap: 10px;
}

.search-row input {
    flex: 1;

    padding: 12px;

    border:
        1px solid #c4c7c5;

    border-radius: 5px;

    font-size: 16px;
}

button,
.button {
    display: inline-block;

    border: none;
    border-radius: 5px;

    padding: 11px 18px;

    background: #202124;
    color: white;

    cursor: pointer;

    font-size: 15px;
}

button:hover,
.button:hover {
    opacity: 0.9;
}


/* EJEMPLOS */

.examples {
    margin-top: 30px;
}

.examples li {
    margin-bottom: 10px;
}

.examples a {
    text-decoration: underline;
}


/* MENSAJES */

.message {
    background: white;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.error {
    border-left: 4px solid #c5221f;
}


/* POST */

.post-card {
    background: white;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 25px;
}

.post-meta {
    border-bottom: 1px solid #dadce0;
    margin-bottom: 25px;
}

.post-content {
    line-height: 1.6;
}

details {
    margin-top: 30px;
}

summary {
    cursor: pointer;
    font-weight: bold;
}

pre {
    background: #202124;
    color: #f1f3f4;

    padding: 20px;

    overflow-x: auto;

    border-radius: 6px;

    font-size: 13px;
}

/* DOCUMENTOS */

.document-list {
    margin-top: 30px;
}

.documents-table {
    width: 100%;
    border-collapse: collapse;

    background: white;
    border: 1px solid #dadce0;
    border-radius: 8px;
    overflow: hidden;
}

.documents-table th,
.documents-table td {
    padding: 12px 14px;

    border-bottom: 1px solid #dadce0;

    text-align: left;

    vertical-align: top;
}

.documents-table th {
    background: #f1f3f4;
    font-weight: bold;
}

.documents-table tr:last-child td {
    border-bottom: none;
}

.documents-table td {
    font-size: 14px;
}

.database-actions {
    margin-top: 25px;
}




/* FOOTER */

.site-footer {
    max-width: 1100px;
    margin: 40px auto 0;

    padding: 20px 24px;

    color: #5f6368;

    font-size: 13px;
}


/* MÓVIL */

@media (max-width: 650px) {

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .main-nav {
        gap: 15px;
    }

    .search-row {
        flex-direction: column;
    }

}


/* EXPLORADOR DE DOCUMENTOS */

.table-container {
    width: 100%;
    overflow-x: auto;
}

.document-id {
    font-family: monospace;
    font-size: 13px !important;
    word-break: break-all;
}

.scraper {
    font-size: 13px !important;
    word-break: break-word;
}

.document-type {
    display: inline-block;

    padding: 4px 8px;

    border-radius: 4px;

    font-size: 12px;

    font-weight: bold;

    background: #f1f3f4;
}

.post-type {
    background: #e8f0fe;
}

.observation-type {
    background: #e6f4ea;
}

.documents-table .button {
    white-space: nowrap;
    font-size: 13px;
    padding: 8px 12px;
}


/* PAGINACIÓN */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;

    margin-bottom: 20px;
}

.page-info {
    font-weight: bold;
    color: #5f6368;
}

.json-action {
    margin-top: 10px;
}


/* RESUMEN DEL DOCUMENTO */

.document-summary {
    background: white;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

.document-summary h2,
.document-raw h2 {
    margin-top: 0;
}

.document-summary dl {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 12px 20px;
    margin: 0;
}

.document-summary dt {
    font-weight: bold;
    color: #5f6368;
}

.document-summary dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.document-raw {
    margin-bottom: 30px;
}

.document-raw .json-view {
    margin-top: 15px;
}
/* ============================================================
   RESULTADOS QBE
   ============================================================ */

.qbe-summary {
    background: white;

    border: 1px solid #dadce0;
    border-radius: 8px;

    padding: 20px 25px;

    margin-bottom: 30px;
}

.qbe-summary p {
    margin: 8px 0;
}


.qbe-results {
    margin-top: 20px;
}


.qbe-result {
    background: white;

    border: 1px solid #dadce0;
    border-radius: 8px;

    padding: 25px;

    margin-bottom: 25px;
}


.qbe-result-header h2 {
    margin-top: 0;
    margin-bottom: 6px;
}


.qbe-meta {
    color: #5f6368;
    margin-top: 0;
}


.qbe-fields {
    border-top: 1px solid #dadce0;
    border-bottom: 1px solid #dadce0;

    padding: 15px 0;
    margin: 20px 0;
}

.qbe-fields p {
    margin: 6px 0;
    overflow-wrap: anywhere;
}


.qbe-terms {
    margin: 20px 0;
}


.qbe-term {
    display: inline-block;

    padding: 4px 9px;
    margin: 3px;

    border-radius: 4px;

    background: #e8f0fe;

    font-weight: bold;
    font-size: 13px;
}


.qbe-fragments {
    margin-top: 25px;
}

.qbe-fragments h3 {
    margin-bottom: 15px;
}


.qbe-fragment {
    border-left: 4px solid #dadce0;

    padding: 12px 15px;

    margin-bottom: 18px;

    background: #f8f9fa;
}


.qbe-path {
    font-family: monospace;

    font-size: 12px;

    color: #5f6368;

    margin-bottom: 8px;

    overflow-wrap: anywhere;
}


.qbe-text {
    line-height: 1.6;

    white-space: pre-wrap;

    overflow-wrap: anywhere;
}


.qbe-fragment-terms {
    margin-top: 10px;

    font-size: 13px;

    color: #5f6368;
}


.qbe-result-actions {
    display: flex;

    gap: 10px;

    margin-top: 25px;

    flex-wrap: wrap;
}


.secondary-button {
    background: #5f6368;
}


.actions {
    margin-top: 25px;
}


@media (max-width: 650px) {

    .qbe-result {
        padding: 18px;
    }

    .qbe-result-actions {
        flex-direction: column;
    }

    .qbe-result-actions .button {
        text-align: center;
    }

}
