/**
 * Key-Value Table Component
 *
 * Reusable styling for key-value pair tables.
 * Used in information display pages like MrEnvironment.
 *
 * Version: 1.0
 * Updated: 2025-10-31
 */

/* Wrapper Container */
.kv-table-wrapper {
    margin-bottom: 32px;
}

/* Section Title */
.kv-table-title {
    font-size: 1.3em;
    margin-bottom: 16px;
    color: #1a202c;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 2px solid #3b82f6;
}

/* Scroll Container (for horizontal overflow) */
.kv-table-scroll {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Table Base Styles */
.kv-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    font-size: 0.95em;
}

/* Table Headers (Keys) */
.kv-table th {
    background-color: #f8f9fa;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border: 1px solid #dee2e6;
    white-space: nowrap;
    width: 30%;
    min-width: 150px;
}

/* Table Data (Values) */
.kv-table td {
    padding: 12px 16px;
    border: 1px solid #dee2e6;
    color: #495057;
    word-break: break-word;
    background-color: #fff;
}

/* Striped Rows (optional) */
.kv-table-striped tbody tr:nth-child(even) th {
    background-color: #e9ecef;
}

.kv-table-striped tbody tr:nth-child(even) td {
    background-color: #f8f9fa;
}

/* Hover Effect */
.kv-table tbody tr:hover th {
    background-color: #e3f2fd;
}

.kv-table tbody tr:hover td {
    background-color: #f1f8ff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .kv-table {
        font-size: 0.9em;
    }

    .kv-table th,
    .kv-table td {
        padding: 10px 12px;
    }

    .kv-table th {
        width: 40%;
        min-width: 120px;
    }

    .kv-table-title {
        font-size: 1.2em;
    }
}

@media (max-width: 480px) {
    .kv-table {
        font-size: 0.85em;
    }

    .kv-table th,
    .kv-table td {
        padding: 8px 10px;
    }

    .kv-table th {
        width: 45%;
        min-width: 100px;
    }

    .kv-table-title {
        font-size: 1.1em;
        margin-bottom: 12px;
    }

    .kv-table-wrapper {
        margin-bottom: 24px;
    }
}

/* Print Styles */
@media print {
    .kv-table-scroll {
        overflow-x: visible;
        box-shadow: none;
    }

    .kv-table th,
    .kv-table td {
        border: 1px solid #000;
    }

    .kv-table tbody tr:hover th,
    .kv-table tbody tr:hover td {
        background-color: inherit;
    }
}

/* Legacy Compatibility (for MrEnvironment) */
.env-section {
    margin-bottom: 32px;
}

.env-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    font-size: 0.95em;
}

.env-table th {
    background-color: #f8f9fa;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border: 1px solid #dee2e6;
    white-space: nowrap;
    width: 30%;
    min-width: 150px;
}

.env-table td {
    padding: 12px 16px;
    border: 1px solid #dee2e6;
    color: #495057;
    word-break: break-word;
}

.env-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.env-table tbody tr:hover {
    background-color: #e3f2fd;
}
