/* Enhanced Label Display UI Improvements */

/* Improved Label Cards - Consolidated definition */
.labels-visual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.label-visual-card {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(191, 180, 163, 0.2);
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.label-visual-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--primary-color), 
        transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.label-visual-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(191, 180, 163, 0.25);
}

.label-visual-card:hover::before {
    opacity: 1;
}

/* Improved Key Styling */
.label-card-key {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.label-card-key::before {
    content: '▸';
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* Enhanced Value Display */
.label-card-value {
    font-size: 1rem;
    color: var(--text-primary);
    word-break: break-word;
    line-height: 1.6;
    font-weight: 400;
}

.label-card-value.array {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Improved Tag Styling */
.label-tag {
    padding: 0.4rem 1rem;
    background: linear-gradient(135deg, rgba(191, 180, 163, 0.15), rgba(113, 107, 98, 0.15));
    border: 1px solid rgba(191, 180, 163, 0.3);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.label-tag:hover {
    background: linear-gradient(135deg, rgba(191, 180, 163, 0.25), rgba(113, 107, 98, 0.25));
    border-color: var(--primary-color);
    transform: scale(1.05);
}

/* JSON Display in Cards */
.label-json {
    background: rgba(0, 0, 0, 0.4);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.5;
    overflow-x: auto;
    margin: 0;
    border: 1px solid rgba(191, 180, 163, 0.1);
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

/* Search and Filter Bar */
.labels-search-container {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.labels-search-input {
    flex: 1;
    min-width: 250px;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(191, 180, 163, 0.2);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.labels-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(191, 180, 163, 0.1);
    background: rgba(0, 0, 0, 0.5);
}

.labels-search-input::placeholder {
    color: var(--text-muted);
}

.labels-filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: rgba(191, 180, 163, 0.1);
    border: 1px solid rgba(191, 180, 163, 0.2);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(191, 180, 163, 0.2);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.filter-btn.active {
    background: linear-gradient(135deg, rgba(191, 180, 163, 0.2), rgba(113, 107, 98, 0.2));
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Label Count Display */
.label-count-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(191, 180, 163, 0.1);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.label-count-display strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Hidden label cards */
.label-visual-card.hidden {
    display: none;
}

/* Enhanced Section Header */
.result-section-header {
    cursor: pointer;
    user-select: none;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(191, 180, 163, 0.05), rgba(113, 107, 98, 0.05));
    border-radius: 12px;
    transition: all 0.3s ease;
}

.result-section-header:hover {
    background: linear-gradient(135deg, rgba(191, 180, 163, 0.1), rgba(113, 107, 98, 0.1));
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.section-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.section-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(191, 180, 163, 0.3));
    transition: transform 0.3s ease;
}

.result-section-header:hover .section-icon svg {
    transform: scale(1.1);
}

.section-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.label-count-badge {
    padding: 0.3rem 0.9rem;
    background: linear-gradient(135deg, rgba(191, 180, 163, 0.2), rgba(113, 107, 98, 0.2));
    border: 1px solid rgba(191, 180, 163, 0.3);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Enhanced JSON View */
.json-view-container {
    margin-top: 2rem;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(191, 180, 163, 0.2);
}

.json-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(191, 180, 163, 0.2);
}

.json-view-header span {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.json-toggle-btn {
    padding: 0.5rem 1rem;
    background: rgba(191, 180, 163, 0.1);
    border: 1px solid rgba(191, 180, 163, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.json-toggle-btn:hover {
    background: rgba(191, 180, 163, 0.2);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.result-json {
    padding: 1.5rem;
    margin: 0;
    background: rgba(0, 0, 0, 0.5);
    color: var(--text-primary);
    font-family: 'Courier New', 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
    border: none;
}

/* Syntax Highlighting for JSON */
.result-json {
    background: var(--bg-dark);
    color: var(--text-primary);
}

/* Scrollbar Styling */
.result-json::-webkit-scrollbar,
.label-json::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.result-json::-webkit-scrollbar-track,
.label-json::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.result-json::-webkit-scrollbar-thumb,
.label-json::-webkit-scrollbar-thumb {
    background: rgba(191, 180, 163, 0.3);
    border-radius: 4px;
}

.result-json::-webkit-scrollbar-thumb:hover,
.label-json::-webkit-scrollbar-thumb:hover {
    background: rgba(191, 180, 163, 0.5);
}

/* Empty State */
.labels-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.labels-empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.labels-empty-state-text {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.labels-empty-state-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .labels-visual-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .labels-search-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .labels-search-input {
        min-width: 100%;
    }
    
    .labels-filter-buttons {
        justify-content: center;
    }
    
    .label-visual-card {
        padding: 1.25rem;
    }
    
    .result-json {
        font-size: 0.8rem;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .label-card-key {
        font-size: 0.7rem;
    }
    
    .label-card-value {
        font-size: 0.9rem;
    }
    
    .label-tag {
        font-size: 0.8rem;
        padding: 0.3rem 0.8rem;
    }
}

/* Animation for label cards appearing */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.label-visual-card {
    animation: fadeInUp 0.5s ease-out;
}

.label-visual-card:nth-child(1) { animation-delay: 0.05s; }
.label-visual-card:nth-child(2) { animation-delay: 0.1s; }
.label-visual-card:nth-child(3) { animation-delay: 0.15s; }
.label-visual-card:nth-child(4) { animation-delay: 0.2s; }
.label-visual-card:nth-child(5) { animation-delay: 0.25s; }
.label-visual-card:nth-child(n+6) { animation-delay: 0.3s; }

/* Improved badge styling - Consolidated definition */
.badge {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    text-transform: capitalize;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
}

.badge-modality {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.2));
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-modality:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(37, 99, 235, 0.3));
    transform: translateY(-1px);
}

.badge-category {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(147, 51, 234, 0.2));
    color: #a78bfa;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-category:hover {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(147, 51, 234, 0.3));
    transform: translateY(-1px);
}






