/* 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;
    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;
}

.combine-badge.kpqc-ecdh {
    background: #fce7f3;
    color: #9d174d;
}

.combine-badge.ecdh-kpqc {
    background: #fdf2f8;
    color: #be185d;
}

.combine-badge.kpqc-qkd {
    background: #fff1f2;
    color: #9f1239;
}

.combine-badge.qkd-kpqc {
    background: #ffe4e6;
    color: #be123c;
}

.combine-badge.kpqc-mlkem {
    background: #fce4ec;
    color: #880e4f;
}

.combine-badge.mlkem-kpqc {
    background: #f3e5f5;
    color: #6a1b9a;
}

/* 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;
}

/* ========================================
   N:N Topology Visualizer Styles
   ======================================== */

.topology-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.topology-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.topology-header h2 {
    color: #f8fafc;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.topology-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* 🆕 효과 설정 아코디언 */
.topology-accordion {
    margin-bottom: 6px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid #334155;
    border-radius: 8px;
    font-size: 12px;
    overflow: hidden;
}

.accordion-header {
    padding: 7px 12px;
    color: #94a3b8;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.accordion-header::-webkit-details-marker {
    display: none;
}

.accordion-header::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.topology-accordion[open]>.accordion-header::before {
    transform: rotate(45deg);
}

.accordion-header:hover {
    color: #e2e8f0;
}

.accordion-body {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    border-top: 1px solid #334155;
}

.effect-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 6px 12px;
}

.effect-group+.effect-group {
    border-top: 1px solid rgba(51, 65, 85, 0.5);
}

.effect-group-label {
    color: #cbd5e1;
    font-weight: 600;
    font-size: 11px;
    min-width: 70px;
    white-space: nowrap;
}

/* 뷰 모드 토글 버튼 */
.view-mode-toggle {
    display: flex;
    border: 1px solid #475569;
    border-radius: 6px;
    overflow: hidden;
}

.btn-view {
    padding: 6px 12px;
    font-size: 11px;
    border: none;
    background: #1e293b;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-view:first-child {
    border-right: 1px solid #475569;
}

.btn-view:hover {
    background: #334155;
    color: #f8fafc;
}

.btn-view.active {
    background: #3b82f6;
    color: #ffffff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.topology-select {
    padding: 6px 12px;
    border: 1px solid #475569;
    border-radius: 4px;
    background: #1e293b;
    color: #f8fafc;
    font-size: 12px;
    cursor: pointer;
}

.topology-select:focus {
    outline: none;
    border-color: #6366f1;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #6366f1;
    cursor: pointer;
}

.topology-content {
    display: grid;
    grid-template-columns: 2fr 10px 1fr;
    gap: 0;
    min-height: 700px;
}

/* 리사이즈 핸들 (스플리터) */
.resize-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 10px;
    cursor: col-resize;
    background: #1a2332;
    border-left: 1px solid #2d3d50;
    border-right: 1px solid #2d3d50;
    position: relative;
    user-select: none;
    z-index: 10;
    transition: background 0.15s, border-color 0.15s;
}

.resize-handle:hover,
.resize-handle.active {
    background: #243044;
    border-left-color: #6366f1;
    border-right-color: #6366f1;
}

.resize-handle-dots {
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 1;
}

.resize-handle-dots span {
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #475569;
    transition: background 0.15s;
}

.resize-handle:hover .resize-handle-dots span,
.resize-handle.active .resize-handle-dots span {
    background: #818cf8;
}

/* 라이트 테마 리사이즈 핸들 */
body[data-theme="light"] .resize-handle {
    background: #e2e8f0;
    border-left-color: #cbd5e1;
    border-right-color: #cbd5e1;
}

body[data-theme="light"] .resize-handle:hover,
body[data-theme="light"] .resize-handle.active {
    background: #cbd5e1;
    border-left-color: #6366f1;
    border-right-color: #6366f1;
}

body[data-theme="light"] .resize-handle-dots span {
    background: #94a3b8;
}

body[data-theme="light"] .resize-handle:hover .resize-handle-dots span,
body[data-theme="light"] .resize-handle.active .resize-handle-dots span {
    background: #6366f1;
}

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

    .resize-handle {
        display: none;
    }
}

.topology-graph-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 700px;
    background: #0f172a;
    border-radius: 8px;
    border: 1px solid #334155;
}

.topology-detail-panel {
    background: #1e293b;
    border-radius: 8px;
    border: 1px solid #334155;
    padding: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 700px;
}

.detail-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    color: #64748b;
    text-align: center;
}

.placeholder-icon {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.detail-placeholder p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

/* 노드 상세 정보 */

/* ===== 클러스터 대시보드 ===== */
.cluster-dashboard {
    color: #e2e8f0;
    padding: 4px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #334155;
}

.dashboard-header h3 {
    margin: 0;
    font-size: 16px;
    color: #f8fafc;
}

.dashboard-header.compressed {
    align-items: center;
    border-bottom: 1px solid #334155;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-node-status {
    display: none;
    /* Removed from DOM, but just in case */
}

.node-total {
    font-size: 13px;
    font-weight: 600;
    color: #cbd5e1;
}

.status-counts {
    display: flex;
    gap: 8px;
}

.status-count {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.status-count.online {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.status-count.error {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
}

.status-count.offline {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.dashboard-summary {
    margin-bottom: 12px;
}

.summary-stat {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.summary-label {
    font-size: 13px;
    color: #94a3b8;
}

.summary-value {
    font-size: 24px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.summary-value.healthy {
    color: #22c55e;
}

.summary-value.warning {
    color: #f59e0b;
}

.summary-value.critical {
    color: #ef4444;
}

.summary-detail {
    font-size: 12px;
    color: #94a3b8;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(30, 41, 59, 0.6);
    padding: 3px 8px;
    border-radius: 4px;
}

/* 알고리즘별 통계 */
.dashboard-algo-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.algo-stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.algo-stat-icon {
    font-size: 15px;
    width: 22px;
    text-align: center;
}

.algo-stat-name {
    width: 56px;
    color: #94a3b8;
    font-size: 12px;
}

.algo-stat-bar {
    flex: 1;
    height: 8px;
    background: #1e293b;
    border-radius: 4px;
    overflow: hidden;
}

.algo-stat-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.algo-stat-fill.healthy {
    background: #22c55e;
}

.algo-stat-fill.warning {
    background: #f59e0b;
}

.algo-stat-fill.critical {
    background: #ef4444;
}

.algo-stat-pct {
    width: 36px;
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
}

.algo-stat-pct.healthy {
    color: #22c55e;
}

.algo-stat-pct.warning {
    color: #f59e0b;
}

.algo-stat-pct.critical {
    color: #ef4444;
}

.algo-stat-detail {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: #94a3b8;
    background: rgba(30, 41, 59, 0.6);
    padding: 2px 6px;
    border-radius: 4px;
    text-align: center;
    min-width: 90px;
}

/* 히트맵 */
.dashboard-heatmap {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.heatmap-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
}

.heatmap-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.heatmap-cell.healthy {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}

.heatmap-cell.warning {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
}

.heatmap-cell.critical {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    animation: heatmap-pulse 2s ease-in-out infinite;
}

@keyframes heatmap-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

.heatmap-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-bottom: 4px;
}

.dot-online {
    background: #22c55e;
}

.dot-error {
    background: #f97316;
}

.dot-offline {
    background: #ef4444;
}

.heatmap-label {
    font-size: 12px;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 2px;
}

.heatmap-pct {
    font-size: 15px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: #e2e8f0;
}

.heatmap-stats {
    display: flex;
    flex-direction: column;
    gap: 1px;
    width: 100%;
}

.heatmap-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2px;
}

.heatmap-tag {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.5px;
}

.heatmap-worst {
    font-size: 14px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.heatmap-worst.healthy {
    color: #22c55e;
}

.heatmap-worst.warning {
    color: #f59e0b;
}

.heatmap-worst.critical {
    color: #ef4444;
}

/* 경고 목록 */
.dashboard-alerts {
    margin-bottom: 12px;
}

.dashboard-alerts h4 {
    margin: 0 0 6px 0;
    font-size: 12px;
    color: #f59e0b;
}

.alert-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
    margin-bottom: 3px;
    gap: 8px;
}

.alert-source {
    flex-shrink: 0;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
}

.alert-node {
    letter-spacing: 0.5px;
    width: 48px;
    text-align: center;
}

.direction-badge.alert-dir {
    background: transparent !important;
    padding: 1px 0;
    width: 42px;
    /* Increased to fit the arrow */
    text-align: center;
    font-size: 9px;
    letter-spacing: 0.2px;
}

.direction-badge.alert-dir.outbound {
    color: #34d399 !important;
    /* Lighter green text for dark mode */
    border: 1px solid rgba(52, 211, 153, 0.4);
}

.direction-badge.alert-dir.inbound {
    color: #818cf8 !important;
    /* Lighter purple/blue text for dark mode */
    border: 1px solid rgba(129, 140, 248, 0.4);
}

.alert-detail {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
}

.alert-algo {
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    /* System font for better readability */
    opacity: 1;
    /* removed 0.9 */
    letter-spacing: 0.3px;
}

.alert-algo strong {
    color: #f8fafc;
    font-weight: 700;
}

.alert-stats {
    background: rgba(30, 41, 59, 0.6);
    padding: 2px 6px;
    border-radius: 4px;
    color: #94a3b8;
}

.alert-pct {
    margin-left: 2px;
    color: #e2e8f0;
    font-weight: 600;
}

.alert-row.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

.alert-row.critical {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

.alert-empty-state {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 6px;
    border: 1px dashed rgba(34, 197, 94, 0.3);
}

.empty-icon {
    font-size: 14px;
}

.empty-text {
    font-size: 12px;
    color: #4ade80;
    font-weight: 500;
}

.alert-more {
    font-size: 10px;
    color: #94a3b8;
    text-align: center;
    padding: 4px 0;
    margin-top: 4px;
    border-radius: 4px;
}

.alert-more.toggle {
    cursor: pointer;
    background: rgba(30, 41, 59, 0.4);
    transition: background 0.2s, color 0.2s;
}

.alert-more.toggle:hover {
    background: rgba(30, 41, 59, 0.8);
    color: #e2e8f0;
}

.dashboard-hint {
    text-align: center;
    font-size: 11px;
    color: #475569;
    padding-top: 8px;
    border-top: 1px solid #1e293b;
}

/* 라이트 모드 */
[data-theme="light"] .cluster-dashboard {
    color: #1e293b;
}

[data-theme="light"] .dashboard-header {
    border-color: #cbd5e1;
}

[data-theme="light"] .dashboard-header h3 {
    color: #1e293b;
}

[data-theme="light"] .summary-label {
    color: #64748b;
}

[data-theme="light"] .summary-detail {
    color: #475569;
    background: rgba(226, 232, 240, 0.8);
}

[data-theme="light"] .algo-stat-name {
    color: #64748b;
}

[data-theme="light"] .algo-stat-detail {
    color: #475569;
    background: rgba(226, 232, 240, 0.8);
}

[data-theme="light"] .dashboard-alerts h4 {
    color: #d97706;
    /* Darker amber for better contrast */
}

[data-theme="light"] .alert-row.warning {
    color: #b45309;
}

[data-theme="light"] .alert-row.critical {
    color: #b91c1c;
}

[data-theme="light"] .alert-algo strong {
    color: #0f172a;
}

[data-theme="light"] .alert-stats {
    background: #ffffff;
    color: #334155;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .alert-pct {
    color: #0f172a;
    font-weight: 700;
}

[data-theme="light"] .direction-badge.alert-dir.outbound {
    color: #059669 !important;
    border-color: rgba(5, 150, 105, 0.3);
    background: rgba(5, 150, 105, 0.05) !important;
}

[data-theme="light"] .direction-badge.alert-dir.inbound {
    color: #4f46e5 !important;
    border-color: rgba(79, 70, 229, 0.3);
    background: rgba(79, 70, 229, 0.05) !important;
}

[data-theme="light"] .alert-empty-state {
    background: rgba(74, 222, 128, 0.1);
    border-color: rgba(74, 222, 128, 0.4);
}

[data-theme="light"] .alert-more.toggle {
    background: rgba(226, 232, 240, 0.8);
    color: #475569;
}

[data-theme="light"] .alert-more.toggle:hover {
    background: #cbd5e1;
    color: #0f172a;
}

[data-theme="light"] .empty-text {
    color: #166534;
}

[data-theme="light"] .algo-stat-bar {
    background: #e2e8f0;
}

[data-theme="light"] .heatmap-label {
    color: #475569;
}

[data-theme="light"] .heatmap-pct {
    color: #1e293b;
}

[data-theme="light"] .dashboard-hint {
    color: #94a3b8;
    border-color: #e2e8f0;
}

[data-theme="light"] .dashboard-node-status {
    background: rgba(241, 245, 249, 0.8);
}

[data-theme="light"] .node-total {
    color: #475569;
}

[data-theme="light"] .heatmap-cell:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 노드 상세 정보 */
.node-detail,
.edge-detail {
    color: #e2e8f0;
}

.node-detail-header,
.edge-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #334155;
}

.node-detail-header h3,
.edge-detail-header h3 {
    margin: 0;
    font-size: 16px;
    color: #f8fafc;
}

.edge-detail-header .subtitle {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.online {
    background: #22c55e;
    color: #fff;
}

.status-badge.offline {
    background: #ef4444;
    color: #fff;
}

.status-badge.unknown {
    background: #64748b;
    color: #fff;
}

.status-badge.error {
    background: #f97316;
    color: #fff;
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.node-detail-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.info-row .label {
    color: #94a3b8;
}

.info-row .value {
    color: #e2e8f0;
    font-weight: 500;
}

.info-row .value.mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
}

/* 버퍼 상세 섹션 */
.buffer-detail-section h4 {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #cbd5e1;
    font-weight: 600;
}

.buffer-peer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 4px;
}

.edge-buffer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    min-width: 0;
}

.edge-buffer-panel {
    min-width: 0;
    overflow: hidden;
}

.edge-buffer-panel .buffer-card {
    padding: 4px 6px;
}

.edge-buffer-panel .buffer-row {
    gap: 6px;
    padding: 4px 6px;
}

@media (max-width: 560px) {
    .edge-buffer-grid {
        grid-template-columns: 1fr;
    }
}

.edge-buffer-panel h4 {
    margin: 0 0 6px 0;
    font-size: 11px;
    color: #94a3b8;
}

/* 버퍼 카드 */
.buffer-card {
    background: #0f172a;
    border-radius: 6px;
    padding: 6px;
    border: 1px solid #334155;
    min-width: 0;
    overflow: hidden;
}

.buffer-card-header {
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.peer-label {
    font-size: 12px;
    font-weight: 600;
    color: #a78bfa;
}

.peer-direction-tag {
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.peer-direction-tag.both {
    background: rgba(147, 51, 234, 0.2);
    color: #c084fc;
    border: 1px solid rgba(147, 51, 234, 0.5);
}

.peer-direction-tag.out {
    background: rgba(5, 150, 105, 0.2);
    color: #34d399;
    border: 1px solid rgba(5, 150, 105, 0.5);
}

.peer-direction-tag.in {
    background: rgba(79, 70, 229, 0.2);
    color: #818cf8;
    border: 1px solid rgba(79, 70, 229, 0.5);
}

.buffer-direction {
    margin-bottom: 5px;
}

.buffer-direction:last-child {
    margin-bottom: 0;
}

.direction-header {
    margin-bottom: 4px;
}

.direction-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.direction-badge.outbound {
    background: #059669;
    color: white;
}

.direction-badge.inbound {
    background: #4f46e5;
    color: white;
}

.direction-badge.outbound.inactive,
.direction-badge.inbound.inactive {
    background: transparent;
    border: 1px dashed #475569;
    color: #475569;
    padding: 1px 7px;
}

/* 버퍼 행 */
.buffer-row {
    display: grid;
    grid-template-columns: 18px 50px 1fr;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    background: #1e293b;
    border-radius: 4px;
    margin-bottom: 4px;
    font-size: 11px;
}

.buffer-icon {
    font-size: 12px;
    text-align: center;
}

.buffer-type {
    color: #94a3b8;
    font-weight: 500;
}

.buffer-count {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

.buffer-row.inactive {
    opacity: 0.3;
    filter: grayscale(1);
    background: transparent;
    border: 1px dashed #334155;
}

.buffer-count-overlay.inactive {
    color: #475569;
}

.buffer-count.healthy {
    color: #22c55e;
}

.buffer-count.warning {
    color: #f59e0b;
}

.buffer-count.critical {
    color: #ef4444;
}

.buffer-count.unknown {
    color: #64748b;
}

.buffer-count-overlay.warning {
    color: #d4a057;
}

.buffer-count-overlay.warning .buffer-val-current {
    color: #f0d0a0;
}

.buffer-count-overlay.critical {
    color: #d47070;
}

.buffer-count-overlay.critical .buffer-val-current {
    color: #f0b0b0;
}

/* 버퍼 프로그레스 바 (하단 얇은 바 + 상단 숫자) */
.buffer-progress {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.buffer-count-overlay {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 12px;
    font-weight: 300;
    letter-spacing: -0.2px;
    pointer-events: none;
    text-align: right;
    display: block;
}

.buffer-val-current {
    color: #c8d1dc;
}

.buffer-count-overlay.healthy {
    color: #94a3b8;
}

.buffer-count-overlay.warning {
    color: #d4a057;
}

.buffer-count-overlay.critical {
    color: #d47070;
}

.buffer-progress-track {
    height: 4px;
    background: #1e293b;
    border-radius: 0;
    overflow: hidden;
}

.buffer-progress-fill {
    height: 100%;
    border-radius: 0;
    transition: width 0.3s ease;
}

.buffer-progress-fill.healthy {
    background: #5cb87a;
}

.buffer-progress-fill.warning {
    background: #d4a44e;
}

.buffer-progress-fill.critical {
    background: #d46565;
}

/* 범례 */
.topology-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #334155;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #94a3b8;
    font-size: 11px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-color.healthy {
    background: #22c55e;
}

.legend-color.warning {
    background: #f59e0b;
}

.legend-color.critical {
    background: #ef4444;
}

.legend-color.online {
    background: #22c55e;
    border: 2px solid #166534;
}

.legend-color.offline {
    background: #ef4444;
    border: 2px solid #991b1b;
}

.legend-divider {
    width: 1px;
    height: 16px;
    background: #475569;
    margin: 0 4px;
}

[data-theme="light"] .legend-divider {
    background: #cbd5e1;
}

.legend-emoji {
    font-size: 13px;
    line-height: 1;
}

/* ===== 사이버펑크 노드 Ripple 효과 ===== */
.node-ripple {
    position: absolute;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.node-ripple.ripple-circle {
    border-radius: 50%;
}

.node-ripple.ripple-rect {
    border-radius: 10px;
}

.ripple-warning {
    border: 3px solid rgba(245, 158, 11, 0.8);
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.5),
        0 0 32px rgba(245, 158, 11, 0.25),
        inset 0 0 8px rgba(245, 158, 11, 0.1);
    animation: cyberpunk-pulse-warning 1.5s ease-in-out infinite;
}

.ripple-critical {
    border: 4px solid rgba(239, 68, 68, 0.9);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6),
        0 0 40px rgba(239, 68, 68, 0.3),
        inset 0 0 10px rgba(239, 68, 68, 0.12);
    animation: cyberpunk-pulse-critical 0.8s ease-in-out infinite;
}

@keyframes cyberpunk-pulse-warning {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.9;
        box-shadow: 0 0 16px rgba(245, 158, 11, 0.5), 0 0 32px rgba(245, 158, 11, 0.25);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.06);
        opacity: 0.7;
        box-shadow: 0 0 28px rgba(245, 158, 11, 0.7), 0 0 50px rgba(245, 158, 11, 0.3);
    }
}

@keyframes cyberpunk-pulse-critical {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.6), 0 0 40px rgba(239, 68, 68, 0.3);
    }

    30% {
        transform: translate(-50%, -50%) scale(1.08);
        opacity: 0.75;
        box-shadow: 0 0 35px rgba(239, 68, 68, 0.8), 0 0 60px rgba(239, 68, 68, 0.35);
    }

    60% {
        opacity: 1;
    }
}

/* ===== 테마 토글 버튼 ===== */
.theme-toggle {
    background: transparent;
    border: 1px solid #475569;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.theme-toggle:hover {
    background: rgba(100, 116, 139, 0.3);
    border-color: #94a3b8;
}

/* ===== 테마 전환 Flash 오버레이 ===== */
.theme-flash-overlay {
    position: fixed;
    inset: 0;
    background: white;
    opacity: 0;
    pointer-events: none;
    z-index: 99999;
    transition: opacity 0.15s ease-out;
}

.theme-flash-overlay.active {
    animation: themeFlash 0.4s ease-out forwards;
}

@keyframes themeFlash {
    0% {
        opacity: 0.3;
    }

    100% {
        opacity: 0;
    }
}

/* ===== 라이트 테마 오버라이드 ===== */

/* --- 전체 토폴로지 섹션 --- */
[data-theme="light"] .topology-section {
    background: #f8fafc;
    color: #1e293b;
}

[data-theme="light"] .topology-header {
    border-color: #cbd5e1;
}

[data-theme="light"] .topology-header h2 {
    color: #1e293b;
}

/* --- 그래프 컨테이너 --- */
[data-theme="light"] .topology-graph-container {
    background: #f1f5f9;
    border-color: #94a3b8;
}

[data-theme="light"] .topology-accordion {
    background: rgba(241, 245, 249, 0.8);
    border-color: #cbd5e1;
}

[data-theme="light"] .accordion-header {
    color: #475569;
}

[data-theme="light"] .accordion-header:hover {
    color: #1e293b;
}

[data-theme="light"] .accordion-body {
    border-top-color: #cbd5e1;
}

[data-theme="light"] .effect-group+.effect-group {
    border-top-color: rgba(203, 213, 225, 0.6);
}

[data-theme="light"] .effect-group-label {
    color: #334155;
}

/* --- 컨트롤 바 --- */
[data-theme="light"] .topology-controls .btn {
    background: #e2e8f0;
    color: #334155;
    border-color: #94a3b8;
}

[data-theme="light"] .topology-controls .btn:hover {
    background: #cbd5e1;
}

[data-theme="light"] .topology-controls .btn.active {
    background: #3b82f6;
    color: #ffffff;
}

[data-theme="light"] .topology-select {
    background: #ffffff;
    color: #334155;
    border-color: #94a3b8;
}

/* 라이트 모드: 아코디언 내부 btn-view */
[data-theme="light"] .topology-accordion .btn-view {
    background: #e2e8f0;
    color: #475569;
    border-color: #94a3b8;
}

[data-theme="light"] .topology-accordion .btn-view:hover {
    background: #cbd5e1;
    color: #1e293b;
}

[data-theme="light"] .topology-accordion .btn-view.active {
    background: #3b82f6;
    color: #ffffff;
}

[data-theme="light"] .topology-accordion .view-mode-toggle {
    border-color: #94a3b8;
}

[data-theme="light"] .view-mode-toggle .btn-view:first-child {
    border-right-color: #94a3b8;
}

[data-theme="light"] .toggle-label span {
    color: #334155;
}

[data-theme="light"] .theme-toggle {
    border-color: #94a3b8;
    color: #334155;
}

[data-theme="light"] .theme-toggle:hover {
    background: rgba(148, 163, 184, 0.3);
}

/* --- 상세 패널 (우측) --- */
[data-theme="light"] .topology-detail-panel {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #1e293b;
}

[data-theme="light"] .detail-placeholder {
    color: #64748b;
}

/* --- 노드/엣지 상세 헤더 --- */
[data-theme="light"] .node-detail,
[data-theme="light"] .edge-detail {
    color: #1e293b;
}

[data-theme="light"] .node-detail-header,
[data-theme="light"] .edge-detail-header {
    border-bottom-color: #cbd5e1;
}

[data-theme="light"] .node-detail-header h3,
[data-theme="light"] .edge-detail-header h3 {
    color: #1e293b;
}

[data-theme="light"] .edge-detail-header .subtitle {
    color: #64748b;
}

[data-theme="light"] .info-row .label {
    color: #64748b;
}

[data-theme="light"] .info-row .value {
    color: #1e293b;
}

/* --- 버퍼 상세 섹션 --- */
[data-theme="light"] .buffer-detail-section h4 {
    color: #475569;
}

/* --- 버퍼 카드 (Buffer Status) --- */
[data-theme="light"] .buffer-card {
    background: #f8fafc;
    border-color: #cbd5e1;
}

[data-theme="light"] .peer-label {
    color: #6d28d9;
}



[data-theme="light"] .buffer-type {
    color: #475569;
}

[data-theme="light"] .buffer-progress-track {
    background: #e2e8f0;
}

[data-theme="light"] .buffer-progress-fill.healthy {
    background: #7eb895;
}

[data-theme="light"] .buffer-progress-fill.warning {
    background: #c49a4a;
}

[data-theme="light"] .buffer-progress-fill.critical {
    background: #c46060;
}

/* 기본: 전체 오버레이 (/ max 부분) */
[data-theme="light"] .buffer-count-overlay {
    color: #64748b;
}

/* 정상: 진한 초록 계열 */
[data-theme="light"] .buffer-count-overlay.healthy {
    color: #4b7960;
}

[data-theme="light"] .buffer-count-overlay.healthy .buffer-val-current {
    color: #15803d;
}

/* 경고: 진한 주황/갈색 계열 */
[data-theme="light"] .buffer-count-overlay.warning {
    color: #92400e;
}

[data-theme="light"] .buffer-count-overlay.warning .buffer-val-current {
    color: #b45309;
}

/* 위험: 진한 빨강 계열 */
[data-theme="light"] .buffer-count-overlay.critical {
    color: #991b1b;
}

[data-theme="light"] .buffer-count-overlay.critical .buffer-val-current {
    color: #dc2626;
}

/* 기본 현재 값 */
[data-theme="light"] .buffer-val-current {
    color: #1e293b;
}

[data-theme="light"] .buffer-row {
    background: #f1f5f9;
}

[data-theme="light"] .buffer-row.inactive {
    background: transparent;
    border-color: #cbd5e1;
}

/* --- 방향 배지 (라이트) --- */
[data-theme="light"] .direction-badge.outbound {
    background: #818cf8;
}

[data-theme="light"] .direction-badge.inbound {
    background: #34d399;
}

[data-theme="light"] .direction-badge.outbound.inactive,
[data-theme="light"] .direction-badge.inbound.inactive {
    background: transparent;
    border-color: #cbd5e1;
    color: #64748b;
}

/* --- 엣지 버퍼 패널 --- */
[data-theme="light"] .edge-buffer-panel h4 {
    color: #475569;
}

/* --- 범례 --- */
[data-theme="light"] .topology-legend {
    border-top-color: #cbd5e1;
}

[data-theme="light"] .legend-item {
    color: #475569;
}

/* --- 기타 다크 텍스트 보정 --- */
[data-theme="light"] .detail-section {
    background: #f1f5f9;
    color: #1e293b;
}

[data-theme="light"] .detail-section h4 {
    color: #1e293b;
}

[data-theme="light"] .buffer-bar {
    background: #cbd5e1;
}

/* ===== 🔐 키 교환 이모지 애니메이션 ===== */
.key-emoji-overlay {
    position: absolute;
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.6));
    transition: opacity 0.3s;
}

/* ===== 📁 토폴로지 미리보기 모드 ===== */

/* 드래그 앤 드롭 오버레이 */
.topology-graph-container.drag-over {
    position: relative;
    outline: 3px dashed #f59e0b !important;
    outline-offset: -3px;
    background: rgba(245, 158, 11, 0.04) !important;
}

.topology-graph-container .drag-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.88);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    pointer-events: none;
    border-radius: 8px;
}

.topology-graph-container.drag-over .drag-overlay {
    display: flex;
}

.drag-overlay-icon {
    font-size: 48px;
    animation: drag-bounce 1s ease-in-out infinite;
}

.drag-overlay-text {
    font-size: 16px;
    font-weight: 700;
    color: #fbbf24;
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

.drag-overlay-hint {
    font-size: 12px;
    color: #94a3b8;
}

@keyframes drag-bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* 미리보기 배너 */
.preview-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(251, 191, 36, 0.06));
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 8px;
    color: #f59e0b;
    font-size: 13px;
    margin-bottom: 8px;
    animation: banner-slide-in 0.3s ease-out;
}

@keyframes banner-slide-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.preview-banner .preview-icon {
    font-size: 20px;
}

.preview-banner .preview-filename {
    font-weight: 700;
    color: #fbbf24;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.preview-banner .preview-label {
    color: #d97706;
    font-style: italic;
    font-size: 12px;
}

/* 돌아가기 버튼 */
.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #1e293b;
    font-weight: 600;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1e293b;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* 파일 미리보기 버튼 */
.btn-preview {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-preview:hover {
    background: rgba(245, 158, 11, 0.25);
    border-color: #f59e0b;
}

/* 미리보기 모드 피어 관계 테이블 */
.preview-peer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 8px;
}

.preview-peer-table th {
    text-align: left;
    padding: 4px 8px;
    color: #94a3b8;
    font-weight: 600;
    border-bottom: 1px solid #334155;
    font-size: 11px;
}

.preview-peer-table td {
    padding: 4px 8px;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}

.preview-dir-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.preview-dir-badge.dir-both {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.preview-dir-badge.dir-out {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.preview-dir-badge.dir-in {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
}

.preview-module-chip {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    margin-right: 3px;
    background: rgba(100, 116, 139, 0.2);
    color: #cbd5e1;
}

/* 미리보기 요약 카드 */
.preview-summary-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.preview-summary-card h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #fbbf24;
}

.preview-info-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 12px;
}

.preview-info-row .label {
    color: #94a3b8;
}

.preview-info-row .value {
    color: #e2e8f0;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
}

/* ===== 🚨 검증 오버레이 (그래프 위 표시) ===== */
.validation-overlay {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    z-index: 100;
    border-radius: 12px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    transition: all 0.4s ease;
    animation: validation-slide-up 0.4s ease-out;
    pointer-events: auto;
}

@keyframes validation-slide-up {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 오류 있을 때 (빨간 배경) */
.validation-overlay.has-errors {
    background: rgba(239, 68, 68, 0.35);
    border: 2px solid rgba(239, 68, 68, 0.6);
    box-shadow: 0 4px 24px rgba(239, 68, 68, 0.3),
        inset 0 0 30px rgba(239, 68, 68, 0.05);
}

/* 경고만 있을 때 (주황 배경) */
.validation-overlay.has-warnings {
    background: rgba(245, 158, 11, 0.25);
    border: 2px solid rgba(245, 158, 11, 0.5);
    box-shadow: 0 4px 24px rgba(245, 158, 11, 0.2),
        inset 0 0 30px rgba(245, 158, 11, 0.05);
}

.validation-overlay-content {
    padding: 14px 18px;
}

.validation-overlay-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.validation-overlay-icon {
    font-size: 22px;
    animation: validation-pulse 2s ease-in-out infinite;
}

@keyframes validation-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

.validation-overlay-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.validation-overlay-issues {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.validation-overlay-issue {
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    padding: 4px 8px;
    border-radius: 4px;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.validation-overlay-issue.error {
    background: rgba(239, 68, 68, 0.25);
}

.validation-overlay-issue.warning {
    background: rgba(245, 158, 11, 0.2);
}

.validation-overlay-more {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    padding: 2px 0;
}

.validation-overlay-hint {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-align: right;
}

/* 축소 상태 - 작은 배지로 변환 */
.validation-overlay.collapsed {
    left: auto;
    right: 16px;
    bottom: 16px;
    width: auto;
    max-width: 200px;
    border-radius: 20px;
}

.validation-overlay.collapsed .validation-overlay-issues,
.validation-overlay.collapsed .validation-overlay-hint {
    display: none;
}

.validation-overlay.collapsed .validation-overlay-content {
    padding: 8px 14px;
}

.validation-overlay.collapsed .validation-overlay-header {
    margin-bottom: 0;
    gap: 6px;
}

.validation-overlay.collapsed .validation-overlay-title {
    font-size: 12px;
}

.validation-overlay.collapsed .validation-overlay-icon {
    font-size: 16px;
}