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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

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

/* Header */
.header {
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.subtitle {
    color: #7f8c8d;
    font-size: 14px;
}

/* Tabs */
.tabs {
    background: white;
    border-radius: 10px 10px 0 0;
    display: flex;
    gap: 1px;
    overflow: hidden;
}

.tab-button {
    flex: 1;
    padding: 15px;
    border: none;
    background: #ecf0f1;
    color: #7f8c8d;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.tab-button:hover {
    background: #dfe6e9;
}

.tab-button.active {
    background: white;
    color: #2c3e50;
    box-shadow: 0 -3px 0 #3498db inset;
}

/* Tab Content */
.tab-content {
    background: white;
    border-radius: 0 0 10px 10px;
    min-height: 500px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tab-panel {
    display: none;
    padding: 30px;
}

.tab-panel.active {
    display: block;
}

/* Form Sections */
.section {
    margin-bottom: 25px;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    overflow: hidden;
}

.section-header {
    background: #f8f9fa;
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
    position: sticky;
    top: 0;
    z-index: 10;
}

.section-header:hover {
    background: #e9ecef;
}

.section-header h2 {
    font-size: 18px;
    color: #2c3e50;
    margin: 0;
}

.section-toggle {
    font-size: 20px;
    color: #7f8c8d;
    transition: transform 0.3s;
}

.section.collapsed .section-toggle {
    transform: rotate(-90deg);
}

.section-content {
    padding: 20px;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
    position: relative;
}

.section.collapsed .section-content {
    max-height: 0;
    padding: 0 20px;
}

/* Sub-sections for grouping related fields */
.sub-section {
    margin: 15px 0;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    background: #fcfcfc;
}

.sub-section-header {
    background: #f1f3f4;
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
}

.sub-section-header:hover {
    background: #e9ecef;
}

.sub-section-toggle {
    font-size: 16px;
    color: #6c757d;
    transition: transform 0.2s;
}

.sub-section.collapsed .sub-section-toggle {
    transform: rotate(-90deg);
}

.sub-section-content {
    padding: 15px;
    transition: all 0.2s ease-in-out;
}

.sub-section.collapsed .sub-section-content {
    max-height: 0;
    padding: 0 15px;
    overflow: hidden;
}

.sub-section-count {
    background: #667eea;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 10px;
    font-weight: normal;
}

/* Field groups for better organization */
.field-group {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.array-item-content .field-group {
    background: #fcfcfc;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
}

.field-group-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
    font-size: 15px;
}

.array-item-content .field-group-title {
    font-size: 14px;
    padding-bottom: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid #dee2e6;
}

.section-description {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 20px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

/* Form Fields */
.field {
    margin-bottom: 20px;
}

.field.hidden {
    display: none;
}

.field-label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.required-indicator {
    color: #e74c3c;
    margin-left: 4px;
}

.help-icon {
    margin-left: 8px;
    width: 16px;
    height: 16px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: help;
    position: relative;
}

.help-icon:hover::after {
    content: attr(data-help);
    position: absolute;
    left: 25px;
    top: -5px;
    background: #2c3e50;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    width: 250px;
    font-size: 12px;
    font-weight: normal;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    line-height: 1.4;
}

/* Input Styles */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
    background: white;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

input:disabled,
textarea:disabled,
select:disabled {
    background: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.6;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

/* Object Container */
.object-container {
    border-left: 3px solid #3498db;
    padding-left: 20px;
    margin-left: 10px;
    margin-top: 10px;
}

.nested-object {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
}

/* Array Fields */
.array-container {
    margin-top: 10px;
}

.array-controls {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.array-button-wrapper {
    display: inline-block;
}

.array-expand-collapse {
    display: inline-block;
    margin-left: 15px;
}

.array-expand-collapse .btn-sm {
    background: #6c757d;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.array-expand-collapse .btn-sm:hover {
    background: #5a6268;
}

.array-items {
    margin-top: 10px;
    max-height: none; /* Allow dynamic height for publications */
}

/* Custom scrollbar for array items */
.array-items::-webkit-scrollbar {
    width: 6px;
}

.array-items::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.array-items::-webkit-scrollbar-thumb {
    background: #aaa;
    border-radius: 3px;
}

.array-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0;
    margin-bottom: 15px;
    position: relative;
    animation: slideIn 0.3s ease-out;
    overflow: hidden;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.array-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
    transition: background 0.2s;
}

.array-item-header:hover {
    background: #f8f9fa;
}

.array-item.collapsed .array-item-header {
    border-bottom: none;
    background: #f1f3f4;
}

.array-item-title {
    font-weight: 500;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 10px;
}

.array-item-preview {
    font-weight: normal;
    color: #6c757d;
    font-size: 13px;
    font-style: italic;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.array-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.array-item-toggle {
    font-size: 16px;
    color: #6c757d;
    transition: transform 0.2s;
    margin-right: 10px;
}

.array-item.collapsed .array-item-toggle {
    transform: rotate(-90deg);
}

.array-item-content {
    padding: 15px;
    transition: all 0.3s ease-in-out;
}

.array-item.collapsed .array-item-content {
    max-height: 0;
    padding: 0 15px;
    overflow: hidden;
}

.array-item-title {
    font-weight: 500;
    color: #495057;
}

.array-count-badge {
    background: #3498db;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 10px;
}

.btn-add-item {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-add-item:before {
    content: "+";
    font-size: 18px;
    font-weight: bold;
}

.btn-add-item:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(40, 167, 69, 0.3);
}

.btn-add-item:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-remove-item {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.btn-remove-item:hover {
    background: #c82333;
    transform: scale(1.05);
}

/* Validation */
.error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.field.has-error input,
.field.has-error textarea,
.field.has-error select {
    border-color: #dc3545;
}

.field.has-error .error-message {
    display: block;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

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

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* JSON Preview */
#json-output {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 20px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

.json-actions {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

/* Completeness Chart */
#completeness-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 36px;
    font-weight: bold;
    color: #2c3e50;
}

.stat-label {
    color: #7f8c8d;
    font-size: 14px;
    margin-top: 5px;
}

#missing-fields {
    margin-top: 30px;
}

.missing-field-item {
    padding: 10px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    margin-bottom: 10px;
    border-radius: 4px;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.loading::after {
    content: "...";
    animation: dots 1.5s steps(4, end) infinite;
}
/* URL Reference Field Styles */
.url-reference-container {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    margin: 10px 0;
}

.reference-mode-selection {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    padding: 8px;
    background: white;
    border-radius: 4px;
}

.reference-mode-selection input[type="radio"] {
    margin-right: 5px;
}

.reference-mode-selection label {
    margin-right: 15px;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
}

.publication-selector,
.manual-url-input {
    width: 100%;
    margin-top: 5px;
}

.publication-selector:disabled,
.manual-url-input:disabled {
    opacity: 0.5;
    background: #f1f1f1;
}

/* Visual indicator for active mode */
.reference-mode-selection input[type="radio"]:checked + label {
    font-weight: 600;
    color: #3498db;
}
/* Auto-save indicator styles */
.auto-save-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
    z-index: 1000;
    transition: all 0.3s;
    opacity: 0.8;
}

.auto-save-indicator:hover {
    opacity: 1;
}

.auto-save-indicator .indicator-icon {
    font-size: 18px;
}

.auto-save-indicator.saving {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.auto-save-indicator.saved {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

.auto-save-indicator.saved .indicator-text {
    color: #155724;
}

.auto-save-indicator.error {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
}

.auto-save-indicator.error .indicator-text {
    color: #721c24;
}

/* Danger button style */
.btn-danger {
    background: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.btn-danger:hover {
    background: #c82333;
    border-color: #bd2130;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

@keyframes dots {
    0%, 20% {
        content: ".";
    }
    40% {
        content: "..";
    }
    60%, 100% {
        content: "...";
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .tabs {
        flex-direction: column;
    }

    .tab-button {
        border-radius: 0;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
    
    /* Smaller padding on mobile */
    .section-content {
        padding: 15px;
    }
    
    .sub-section-content {
        padding: 10px;
    }
}/* Entity Search / Knowledge Graph Explorer Styles */

/* Main Container */
.kg-search-container {
    max-width: 100%;
    padding: 0;
}

/* Search Header */
.kg-search-header {
    margin-bottom: 20px;
}

.kg-search-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.kg-search-input {
    flex: 1;
    padding: 14px 18px;
    font-size: 16px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    transition: all 0.3s;
}

.kg-search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.kg-search-button {
    padding: 14px 32px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.kg-search-button:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.kg-search-button:active {
    transform: translateY(0);
}

/* Search Filters */
.kg-search-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.kg-filter-group {
    display: flex;
    flex-direction: column;
}

.kg-filter-label {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
}

.kg-filter-input {
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.kg-filter-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Results Header */
.kg-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e6ed;
}

.kg-results-info {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.kg-view-toggle {
    display: flex;
    gap: 5px;
    background: #f8f9fa;
    padding: 4px;
    border-radius: 6px;
}

.kg-view-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s;
}

.kg-view-btn:hover {
    background: #e9ecef;
}

.kg-view-btn.active {
    background: white;
    color: #3498db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Quick Links */
.kg-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.kg-quick-link {
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.kg-link-google {
    background: #28a745;
    color: white;
}

.kg-link-google:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.kg-link-news {
    background: #17a2b8;
    color: white;
}

.kg-link-news:hover {
    background: #138496;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.3);
}

.kg-link-images {
    background: #28a745;
    color: white;
}

.kg-link-images:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.kg-link-kg {
    background: #007bff;
    color: white;
}

.kg-link-kg:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

/* Results List */
.kg-results-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Result Card */
.kg-result-card {
    background: white;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
}

.kg-result-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.kg-card-header {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 20px;
    padding: 20px;
    align-items: start;
    background: white;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.kg-card-header:hover {
    background: #f8f9fa;
}

.kg-card-header.collapsed {
    background: #f8f9fa;
}

.kg-card-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e0e6ed;
}

.kg-card-title-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kg-card-title {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.kg-card-description {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.kg-card-types {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.kg-type-badge {
    padding: 4px 10px;
    background: #e9ecef;
    color: #495057;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.kg-card-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
    font-size: 13px;
}

.kg-card-score {
    padding: 4px 10px;
    background: #d4edda;
    color: #155724;
    border-radius: 12px;
    font-weight: 600;
}

.kg-card-id {
    padding: 4px 10px;
    background: #f8f9fa;
    color: #6c757d;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
}

.kg-card-controls {
    display: flex;
    align-items: center;
}

.kg-toggle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.kg-toggle-btn:hover {
    background: #e9ecef;
}

.kg-toggle-icon {
    font-size: 16px;
    color: #6c757d;
}

/* Card Content */
.kg-card-content {
    padding: 0 20px 20px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tabs within cards */
.kg-tabs {
    margin-bottom: 20px;
}

.kg-tab-buttons {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid #e0e6ed;
    margin-bottom: 20px;
}

.kg-tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.2s;
}

.kg-tab-btn:hover {
    color: #495057;
    background: #f8f9fa;
}

.kg-tab-btn.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.kg-tab-content {
    position: relative;
}

.kg-tab-panel {
    display: none;
}

.kg-tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Overview Tab */
.kg-overview {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
}

.kg-overview-text {
    color: #495057;
    line-height: 1.6;
    margin: 0 0 15px 0;
}

.kg-overview-source {
    font-size: 13px;
    color: #6c757d;
    margin: 0;
}

.kg-overview-source a {
    color: #3498db;
    text-decoration: none;
}

.kg-overview-source a:hover {
    text-decoration: underline;
}

/* Properties Tab */
.kg-properties-table {
    width: 100%;
    border-collapse: collapse;
}

.kg-properties-table tr {
    border-bottom: 1px solid #e9ecef;
}

.kg-properties-table tr:last-child {
    border-bottom: none;
}

.kg-prop-key {
    padding: 12px;
    font-weight: 600;
    color: #495057;
    width: 30%;
    background: #f8f9fa;
}

.kg-prop-value {
    padding: 12px;
    color: #6c757d;
}

/* Links Tab */
.kg-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.kg-links-list li {
    border-bottom: 1px solid #e9ecef;
}

.kg-links-list li:last-child {
    border-bottom: none;
}

.kg-link {
    display: block;
    padding: 12px;
    color: #3498db;
    text-decoration: none;
    transition: all 0.2s;
}

.kg-link:hover {
    background: #f8f9fa;
    padding-left: 20px;
}

/* Raw Data Tab */
.kg-raw-data {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 20px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
    margin: 0;
}

/* Card Footer */
.kg-card-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e6ed;
    display: flex;
    gap: 10px;
}

.kg-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
}

.kg-btn-primary {
    background: #4267B2;
    color: white;
}

.kg-btn-primary:hover {
    background: #365899;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(66, 103, 178, 0.3);
}

.kg-btn-secondary {
    background: #6c757d;
    color: white;
}

.kg-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

/* Empty Message */
.kg-empty-message {
    padding: 40px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

/* Loading State */
.kg-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.kg-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.kg-loading p {
    color: #6c757d;
    font-size: 16px;
}

/* Error State */
.kg-error {
    padding: 20px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    margin-bottom: 20px;
}

/* Empty State */
.kg-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.kg-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.kg-empty-state h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.kg-empty-state p {
    color: #6c757d;
    max-width: 500px;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .kg-card-header {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .kg-card-image {
        width: 60px;
        height: 60px;
    }

    .kg-card-meta {
        flex-direction: row;
        justify-content: flex-start;
    }

    .kg-search-filters {
        grid-template-columns: 1fr;
    }

    .kg-quick-links {
        flex-direction: column;
    }

    .kg-quick-link {
        width: 100%;
        justify-content: center;
    }

    .kg-tab-buttons {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .kg-tab-btn {
        white-space: nowrap;
    }
}