/* MFS API Tester - Postman Style */

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

:root {
    --primary-color: #ff6c37;
    --secondary-color: #5f6368;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --bg-color: #f5f5f5;
    --panel-bg: #ffffff;
    --border-color: #e0e0e0;
    --code-bg: #282c34;
    --code-text: #abb2bf;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: var(--panel-bg);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 24px;
    color: var(--primary-color);
}

.env-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.env-selector label {
    font-weight: 500;
}

.env-selector select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

/* Flow Diagram */
.flow-diagram {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.flow-diagram svg {
    width: 100%;
    height: auto;
    max-height: 300px;
    border-radius: 8px;
}

/* Vertical API Selection */
.api-tabs-vertical {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.tab-btn-vertical {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    background: white;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--secondary-color);
    border-radius: 6px;
    transition: all 0.3s;
}

.tab-btn-vertical:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.tab-btn-vertical.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.api-group-vertical {
    display: none;
    flex-direction: column;
    gap: 8px;
}

.api-group-vertical.active {
    display: flex;
}

.api-option-vertical {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.api-option-vertical:hover {
    border-color: var(--primary-color);
    background: #fafafa;
    transform: translateX(2px);
}

.api-option-vertical input[type="radio"] {
    margin-top: 4px;
    margin-right: 10px;
    cursor: pointer;
    flex-shrink: 0;
}

.api-option-vertical input[type="radio"]:checked ~ .api-info {
    color: var(--primary-color);
}

.api-option-vertical input[type="radio"]:checked ~ .api-info .api-method {
    background: var(--primary-color);
    color: white;
}

.api-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.api-method {
    display: inline-block;
    padding: 2px 8px;
    background: var(--secondary-color);
    color: white;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    width: fit-content;
}

.api-method.get {
    background: #10b981;
}

.api-path {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    word-break: break-all;
}

.api-info small {
    color: var(--secondary-color);
    font-size: 11px;
}

/* Main Content - 3 Column Grid (1:1:2) */
.main-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: 20px;
    margin-bottom: 20px;
}

.api-selection-vertical,
.params-panel-vertical,
.curl-panel-vertical {
    background: var(--panel-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.api-selection-vertical h2,
.params-panel-vertical h2,
.curl-panel-vertical h2 {
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 600;
}

/* Form Styles */
#params-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--secondary-color);
}

.form-group input,
.form-group select {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* curl Panel */
.curl-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #e55a2b;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #4a4d52;
}

.code-block {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 15px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    min-height: 200px;
}

/* Response Section */
.response-section {
    background: var(--panel-bg);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.response-section h2 {
    font-size: 16px;
    margin-bottom: 15px;
}

.response-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 14px;
}

.response-meta span {
    padding: 5px 10px;
    background: var(--bg-color);
    border-radius: 4px;
}

.status-success {
    background: var(--success-color) !important;
    color: white;
}

.status-error {
    background: var(--error-color) !important;
    color: white;
}

/* DB Section - 스타일은 하단 db-verify-grid 참조 */

/* History Section */
.history-section {
    background: var(--panel-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.history-section h2 {
    font-size: 16px;
    margin-bottom: 15px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    padding: 12px;
    background: var(--bg-color);
    border-radius: 4px;
    border-left: 4px solid var(--primary-color);
    cursor: pointer;
    transition: all 0.3s;
}

.history-item:hover {
    background: #e8e8e8;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.history-item-time {
    font-size: 12px;
    color: var(--secondary-color);
}

.history-item-status {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.history-item-body {
    font-size: 13px;
    font-family: 'Courier New', monospace;
    color: var(--secondary-color);
}

/* Responsive */
@media (max-width: 1400px) {
    .main-content-grid {
        grid-template-columns: 1fr 2fr;
    }
    
    .api-selection-vertical {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1200px) {
    .main-content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
    }

    .api-group.active {
        grid-template-columns: 1fr;
    }

    .db-controls {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tunnel Warning */
.tunnel-warning {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #856404;
}

.tunnel-warning code {
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.tunnel-warning a {
    color: #0056b3;
    text-decoration: underline;
    margin-left: 10px;
}

.tunnel-help {
    background: var(--panel-bg);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.tunnel-help h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.tunnel-help pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 15px;
}

.tunnel-help button {
    padding: 8px 16px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.tunnel-help button:hover {
    background: #4a4d52;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-success {
    color: var(--success-color);
}

.text-error {
    color: var(--error-color);
}

.text-warning {
    color: var(--warning-color);
}

/* Policy Tables Section */
.policy-tables {
    background: var(--panel-bg);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
}

.policy-tables-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.policy-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.policy-column {
    flex: 1;
    min-width: 280px;
}

.policy-table-card {
    background: var(--panel-bg);
    border-radius: 8px;
    padding: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.combine-method-card {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 1px solid #dde3f0;
}

.policy-styled-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #2d3748;
    border-radius: 6px;
    overflow: hidden;
}

.policy-styled-table th,
.policy-styled-table td {
    border: 1px solid #cbd5f5;
    padding: 10px;
    text-align: center;
}

.policy-styled-table thead {
    background: #111827;
    color: #fff;
}

.policy-styled-table tbody tr:nth-child(even) {
    background: rgba(99, 102, 241, 0.08);
}

/* DB Section - Postman Style */
.db-section {
    background: var(--panel-bg);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
}

.db-section h2 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.db-verify-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    min-width: 0; /* grid 자식 overflow 허용 */
}

@media (max-width: 1000px) {
    .db-verify-grid {
        grid-template-columns: 1fr;
    }
}

.db-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0; /* flex 자식 overflow 허용 */
    overflow: hidden;
}

.db-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.db-card-header strong {
    font-size: 14px;
    color: #1f2937;
}

.db-card-header p {
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
}

/* Postman-style Node Badge */
.db-node-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #49cc90;
    color: #fff;
}

.db-node-badge-target {
    background: #f93e3e;
}

.db-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.db-controls label {
    font-weight: 600;
    font-size: 12px;
    color: #475569;
    margin-right: 4px;
}

.db-controls input,
.db-controls select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    flex: 1;
    min-width: 120px;
}

.db-controls input:focus,
.db-controls select:focus {
    border-color: #ff6c37;
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 108, 55, 0.15);
}

.db-controls .btn {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
}

.schema-label {
    font-size: 12px;
    color: #64748b;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.schema-label strong {
    color: #334155;
    font-weight: 700;
}

.db-compare-card {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #f0fdf4 0%, #f8fafc 100%);
    border: 1px solid #86efac;
    min-width: 0;
    overflow: hidden;
}

.db-compare-card .db-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.db-compare-card .db-controls input[type="text"] {
    flex: 1;
    max-width: none;
}

.db-compare-card .db-card-header strong {
    color: #166534;
}

/* 비교 결과 스타일 */
.compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 12px;
    min-width: 0;
}

@media (max-width: 800px) {
    .compare-grid {
        grid-template-columns: 1fr;
    }
}

.compare-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
    min-width: 0;
    overflow: hidden;
}

.compare-panel h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #475569;
    font-weight: 600;
}

.compare-panel pre {
    margin: 0;
    font-size: 11px;
    white-space: pre-wrap;
    word-break: break-all;
    background: #fff;
    padding: 8px;
    border-radius: 4px;
    max-height: 200px;
    overflow: auto;
}

.compare-panel .no-data {
    color: #94a3b8;
    font-style: italic;
    margin: 0;
}

.compare-status {
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
}

.compare-status.match {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.compare-status.mismatch {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.db-results {
    margin-top: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    max-width: 100%;
    -webkit-overflow-scrolling: touch; /* 모바일 스크롤 부드럽게 */
}

/* 테이블 래퍼 (스크롤 가능) */
.db-table-wrapper {
    overflow-x: auto;
    max-width: 100%;
}

.db-results:empty {
    display: none;
}

.db-results .db-table,
.db-results .policy-styled-table {
    width: 100%;
    font-size: 12px;
    margin: 0;
    border: none;
}

.policy-table-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.policy-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    border: 2px solid #333;
    border-radius: 6px;
}

.policy-table th {
    background: #343a40;
    color: #fff;
    padding: 12px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    border: 1px solid #4b5563;
}

.policy-table td {
    padding: 10px 8px;
    border: 1px solid #e5e7eb;
    color: #1f2933;
    background: #fff;
    text-align: center;
}

.policy-table tbody tr:nth-child(even) td {
    background: #f8fafc;
}

.policy-table tbody tr:hover td {
    background: #fff;
}

.profile-chip,
.policy-chip,
.value-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #1f2933;
    background: #f1f5f9;
    border: 1px solid #d1d5db;
}

.value-chip {
    background: #fefce8;
    border-color: #fde68a;
}

.profile-chip {
    background: #f5f3ff;
    border-color: #ddd6fe;
}

.policy-chip {
    background: #e0f2fe;
    border-color: #bae6fd;
}

.method-badge {
    display: inline-block;
    font-weight: 700;
    font-size: 14px;
    color: #475569;
}

.policy-table .qkd-yes {
    color: #065f46;
    font-weight: 700;
    font-size: 14px;
}

.policy-table .qkd-no {
    color: #b91c1c;
    font-weight: 700;
    font-size: 14px;
}

.policy-note {
    margin-top: 12px;
    font-size: 12px;
    color: var(--secondary-color);
    padding: 8px 12px;
    background: var(--bg-color);
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
}

.policy-note strong {
    color: var(--primary-color);
    font-weight: 600;
}

@media (max-width: 1200px) {
    .policy-tables-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   DB Key List Section (Paginated)
   ======================================== */

.db-keylist-section {
    margin-top: 20px;
}

.db-keylist-section .db-card {
    max-width: 100%;
}

.keylist-controls {
    flex-wrap: wrap;
}

.keylist-controls label {
    font-size: 13px;
    color: #475569;
    font-weight: 500;
}

.keylist-controls select {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    min-width: 80px;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.pagination-controls:empty {
    display: none;
}

.pagination-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-btn.nav-btn {
    font-weight: 600;
}

.pagination-ellipsis {
    padding: 0 8px;
    color: #6b7280;
    font-size: 14px;
}

.pagination-info {
    text-align: center;
    font-size: 12px;
    color: #6b7280;
    margin-top: 10px;
}

.pagination-info:empty {
    display: none;
}

/* Keylist Table Styles */
#keylist-results .db-table {
    font-size: 11px;
}

#keylist-results .db-table th,
#keylist-results .db-table td {
    padding: 8px 10px;
    white-space: nowrap;
}

#keylist-results .db-table td:first-child {
    font-family: monospace;
    font-size: 10px;
}

/* Loading State */
.loading-indicator {
    text-align: center;
    padding: 20px;
    color: #6b7280;
}

.loading-indicator::before {
    content: "⏳ ";
}

/* ========================================
   Key Compare Section (Enhanced 2025-12-17)
   ======================================== */

.compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 900px) {
    .compare-grid {
        grid-template-columns: 1fr;
    }
}

.compare-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
}

.compare-panel h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 8px;
}

.node-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.node-badge.source {
    background: #dbeafe;
    color: #1d4ed8;
}

.node-badge.target {
    background: #dcfce7;
    color: #15803d;
}

.no-data {
    padding: 16px;
    text-align: center;
    color: #94a3b8;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 13px;
}

.no-data small {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: #9ca3af;
}

/* Key Info Card (in compare panel) */
.key-info-card {
    background: white;
    border-radius: 6px;
    padding: 12px;
    border: 1px solid #e5e7eb;
}

.key-info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 12px;
}

.key-info-row:last-child {
    border-bottom: none;
}

.key-info-label {
    font-weight: 500;
    color: #64748b;
    flex-shrink: 0;
    width: 110px;
}

.key-info-value {
    color: #1e293b;
    text-align: right;
    word-break: break-all;
}

.key-data-mono {
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 10px;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: help;
}

/* State Badges */
.key-state,
.state-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.state-created {
    background: #dbeafe;
    color: #1e40af;
}

.state-active {
    background: #dcfce7;
    color: #166534;
}

.state-synced {
    background: #ede9fe;
    color: #5b21b6;
}

.state-deactivated {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.state-destroyed {
    background: #fee2e2;
    color: #991b1b;
}

.state-suspended {
    background: #fef3c7;
    color: #92400e;
}

.state-compromised {
    background: #ffedd5;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

.state-destroyed-compromised {
    background: #fce7f3;
    color: #9d174d;
    border: 1px solid #fbcfe8;
}

.state-unknown {
    background: #e5e7eb;
    color: #374151;
    border: 1px solid #d1d5db;
}

/* Compare Status */
.compare-status {
    padding: 12px 16px;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    font-size: 14px;
}

.compare-status.match {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.compare-status.mismatch {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* Compare Details Table */
.compare-details {
    margin-top: 16px;
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #e2e8f0;
}

.compare-details h5 {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #475569;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.compare-table th,
.compare-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.compare-table th {
    background: #f1f5f9;
    font-weight: 600;
    color: #475569;
}

.compare-table td:last-child {
    text-align: center;
    width: 50px;
}

.match-ok {
    color: #16a34a;
    font-weight: 700;
}

.match-fail {
    color: #dc2626;
    font-weight: 700;
}

/* Compare Hint */
.compare-hint {
    margin-top: 16px;
    padding: 12px 16px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    font-size: 12px;
    color: #0369a1;
}

.compare-hint p {
    margin: 0 0 8px 0;
}

.compare-hint ul {
    margin: 0;
    padding-left: 20px;
}

.compare-hint li {
    margin-bottom: 4px;
}

.compare-hint code {
    background: #e0f2fe;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 11px;
}

/* Error Message */
.error-message {
    padding: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #991b1b;
    text-align: center;
    font-size: 13px;
}

/* Truncated Value - 축약된 값 (호버 시 전체 표시, 클릭 시 복사) */
.truncated-value {
    display: block;
    width: 100%;
    max-width: 100%;  /* 컬럼 넓이에 맞춤 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    transition: color 0.2s ease;
    box-sizing: border-box;
    color: inherit;
}

.truncated-value:hover {
    background: transparent;
    border-color: transparent;
    color: #0369a1;  /* 호버시만 색상 변경 */
    text-decoration: underline;
}

.truncated-value:active {
    transform: scale(0.98);
}

/* Tooltip for full value */
/* Custom Tooltip - 빠른 호버 표시 */
.key-handle-cell {
    position: relative;
    display: inline-block;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    background: #f1f5f9;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    transition: background 0.15s;
}

.key-handle-cell:hover {
    background: #dbeafe;
}

/* Tooltip - fixed position으로 테이블 overflow 문제 해결 */
.key-handle-cell::before {
    content: attr(data-full);
    position: fixed;
    background: #1e293b;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.08s, visibility 0.08s;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transform: translateY(-100%) translateY(-8px);
}

.key-handle-cell:hover::before {
    opacity: 1;
    visibility: visible;
}

/* 테이블 셀 스타일 */
.db-table td {
    overflow: visible !important;
    white-space: nowrap;  /* 줄바꿈 방지 */
}

.db-results {
    overflow-x: auto;
    overflow-y: visible;
}

.copied-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #22c55e;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    z-index: 1000;
    animation: fadeInOut 1.5s ease;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(10px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* Copied feedback */
.truncated-value.copied {
    background: #dcfce7;
    border-color: #22c55e;
    color: #166534;
}

/* Key info card improvements */
.key-info-value.truncated-value {
    max-width: 180px;
}

/* Combine Method Badge */
.combine-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.combine-badge.qkd-ecdh {
    background: #dcfce7;
    color: #166534;
}

.combine-badge.ecdh-qkd {
    background: #e0f2fe;
    color: #0369a1;
}

.combine-badge.mlkem-ecdh {
    background: #fae8ff;
    color: #86198f;
}

.combine-badge.ecdh-mlkem {
    background: #f5f3ff;
    color: #6d28d9;
}

.combine-badge.mlkem-qkd {
    background: #fef3c7;
    color: #92400e;
}

.combine-badge.qkd-mlkem {
    background: #fed7aa;
    color: #c2410c;
}

/* API Type 배지 (KMS vs QKD-014) */
.api-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.api-badge.api-kms {
    background: #dbeafe;
    color: #1e40af;
}

.api-badge.api-qkd014 {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

/* Expired 배지 (만료된 키 표시) */
.expired-badge {
    color: #dc2626;
    font-weight: 600;
    text-decoration: line-through;
}

/* KDF 알고리즘 배지 */
.kdf-badge {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    background: #f3e8ff;
    color: #7c3aed;
}

