/*
 * Visualizer Components CSS
 * Award-winning design for data visualization
 * Version: 2.0
 */

/* ===== Visualizer Container ===== */
.visualizer-container {
    border-radius: 20px;
    overflow: hidden;
    animation: fadeInUp 0.5s ease-out;
}

.theme-dark .visualizer-container {
    background: linear-gradient(135deg, rgba(33, 33, 33, 0.95) 0%, rgba(24, 24, 24, 0.98) 100%);
    border: 1px solid rgba(232, 232, 240, 0.08);
}

.theme-light .visualizer-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.95) 100%);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

/* ===== Hero Image Section ===== */
.visualizer-hero {
    position: relative;
    height: 320px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.visualizer-hero:hover {
    filter: brightness(1.05);
}

.hero-backdrop {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(30px) brightness(0.35) saturate(1.2);
    transform: scale(1.2);
    transition: filter 0.4s ease;
}

.visualizer-hero:hover .hero-backdrop {
    filter: blur(25px) brightness(0.4) saturate(1.3);
}

.hero-image-container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.hero-main-image {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.visualizer-hero:hover .hero-main-image {
    transform: scale(1.02);
}

.hero-zoom-hint {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.visualizer-hero:hover .hero-zoom-hint {
    opacity: 1;
    transform: scale(1);
}

.hero-zoom-hint svg {
    color: white;
}

/* ===== Visualizer Content ===== */
.visualizer-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===== Visualizer Section ===== */
.visualizer-section {
    border-radius: 16px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    animation: sectionFadeIn 0.5s ease-out forwards;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-dark .visualizer-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.theme-light .visualizer-section {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.visualizer-section:hover {
    transform: translateY(-2px);
}

.theme-dark .visualizer-section:hover {
    border-color: rgba(var(--section-accent, 0, 150, 255), 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.theme-light .visualizer-section:hover {
    border-color: rgba(var(--section-accent, 0, 150, 255), 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Section with accent border */
.visualizer-section[style*="--section-accent"] {
    border-left: 3px solid rgba(var(--section-accent), 0.6);
}

.visualizer-section.collapsed {
    transform: none;
}

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

/* ===== Section Header ===== */
.visualizer-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    gap: 12px;
    user-select: none;
}

.visualizer-section-header.clickable {
    cursor: pointer;
    transition: background 0.2s ease;
}

.theme-dark .visualizer-section-header.clickable:hover {
    background: rgba(255, 255, 255, 0.03);
}

.theme-light .visualizer-section-header.clickable:hover {
    background: rgba(0, 0, 0, 0.03);
}

.section-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.section-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Section Icon */
.section-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--icon-bg, rgba(0, 150, 255, 0.15));
    color: var(--icon-color, rgba(0, 150, 255, 1));
    transition: transform 0.3s ease;
}

.visualizer-section:hover .section-icon {
    transform: scale(1.05);
}

/* Section Title */
.section-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.section-title {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.theme-dark .section-title {
    color: rgba(232, 232, 240, 0.95);
}

.theme-light .section-title {
    color: rgba(0, 0, 0, 0.85);
}

.section-subtitle {
    font-size: 0.75rem;
}

.theme-dark .section-subtitle {
    color: rgba(232, 232, 240, 0.5);
}

.theme-light .section-subtitle {
    color: rgba(0, 0, 0, 0.5);
}

/* Section Badge */
.section-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Collapse Icon */
.collapse-icon {
    transition: transform 0.3s ease;
}

.theme-dark .collapse-icon {
    color: rgba(232, 232, 240, 0.5);
}

.theme-light .collapse-icon {
    color: rgba(0, 0, 0, 0.4);
}

.visualizer-section.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

/* ===== Section Content ===== */
.visualizer-section-content {
    padding: 4px 20px 20px 20px;
}

/* ===== Description Block ===== */
.description-block {
    line-height: 1.7;
    font-size: 0.95rem;
}

.theme-dark .description-block {
    color: rgba(232, 232, 240, 0.8);
}

.theme-light .description-block {
    color: rgba(0, 0, 0, 0.7);
}

/* ===== Stat Row ===== */
.stat-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px;
    border-radius: 12px;
    min-width: 120px;
    flex: 1;
    transition: all 0.3s ease;
}

.theme-dark .stat-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.theme-light .stat-item {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-item:hover {
    transform: translateY(-2px);
}

.theme-dark .stat-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.theme-light .stat-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.theme-dark .stat-label {
    color: rgba(232, 232, 240, 0.5);
}

.theme-light .stat-label {
    color: rgba(0, 0, 0, 0.5);
}

.stat-value {
    font-size: 1rem;
    font-weight: 600;
}

.theme-dark .stat-value {
    color: rgba(232, 232, 240, 0.95);
}

.theme-light .stat-value {
    color: rgba(0, 0, 0, 0.85);
}

/* ===== Related Items Grid ===== */
.related-items-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.related-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    opacity: 0;
    transform: translateX(-10px);
    animation: itemSlideIn 0.4s ease-out forwards;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-dark .related-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.theme-light .related-item {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.related-item:hover {
    transform: translateX(4px);
}

.theme-dark .related-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.theme-light .related-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

@keyframes itemSlideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Item Type Colors */
.related-item.item-author .related-item-icon {
    background: color-mix(in srgb, var(--mud-palette-success) 15%, transparent);
    color: var(--mud-palette-success);
}

.related-item.item-artwork .related-item-icon {
    background: rgba(82, 132, 166, 0.15);
    color: var(--mud-palette-tertiary, #5284A6);
}

.related-item.item-datablob .related-item-icon {
    background: color-mix(in srgb, var(--mud-palette-warning) 15%, transparent);
    color: var(--mud-palette-warning);
}

.related-item-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.related-item:hover .related-item-icon {
    transform: scale(1.1);
}

.related-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.related-item-name {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.theme-dark .related-item-name {
    color: rgba(232, 232, 240, 0.9);
}

.theme-light .related-item-name {
    color: rgba(0, 0, 0, 0.8);
}

.related-item-subtitle {
    font-size: 0.75rem;
}

.theme-dark .related-item-subtitle {
    color: rgba(232, 232, 240, 0.5);
}

.theme-light .related-item-subtitle {
    color: rgba(0, 0, 0, 0.5);
}

.related-item-arrow {
    opacity: 0;
    transform: translateX(-8px);
    transition: all 0.3s ease;
}

.theme-dark .related-item-arrow {
    color: rgba(232, 232, 240, 0.4);
}

.theme-light .related-item-arrow {
    color: rgba(0, 0, 0, 0.3);
}

.related-item:hover .related-item-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ===== Empty State ===== */
.empty-items-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    gap: 12px;
    border-radius: 12px;
}

.theme-dark .empty-items-state {
    background: rgba(255, 255, 255, 0.02);
}

.theme-light .empty-items-state {
    background: rgba(0, 0, 0, 0.02);
}

.empty-icon {
    animation: float 3s ease-in-out infinite;
}

.theme-dark .empty-icon {
    color: rgba(232, 232, 240, 0.2);
}

.theme-light .empty-icon {
    color: rgba(0, 0, 0, 0.15);
}

.empty-text {
    font-size: 0.85rem;
}

.theme-dark .empty-text {
    color: rgba(232, 232, 240, 0.4);
}

.theme-light .empty-text {
    color: rgba(0, 0, 0, 0.4);
}

/* ===== Show More Button ===== */
.show-more-container {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

.show-more-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-dark .show-more-button {
    background: rgba(0, 150, 255, 0.1);
    color: rgba(0, 150, 255, 1);
    border: 1px solid rgba(0, 150, 255, 0.2);
}

.theme-light .show-more-button {
    background: rgba(0, 150, 255, 0.08);
    color: rgba(0, 120, 200, 1);
    border: 1px solid rgba(0, 150, 255, 0.2);
}

.show-more-button:hover {
    transform: translateY(-2px);
}

.theme-dark .show-more-button:hover {
    background: rgba(0, 150, 255, 0.2);
    border-color: rgba(0, 150, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 150, 255, 0.2);
}

.theme-light .show-more-button:hover {
    background: rgba(0, 150, 255, 0.15);
    border-color: rgba(0, 150, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 150, 255, 0.15);
}

.show-more-button:active {
    transform: translateY(0);
}

.show-more-button svg {
    font-size: 1rem;
}

/* ===== Tag Chips ===== */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-chip-premium {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.tag-chip-premium:hover {
    transform: translateY(-2px) scale(1.02);
    filter: brightness(1.1);
}

.tag-chip-premium svg {
    font-size: 0.9rem;
}

/* ===== Content Preview ===== */
.content-preview {
    padding: 16px;
    border-radius: 12px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.theme-dark .content-preview {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(232, 232, 240, 0.85);
}

.theme-light .content-preview {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.75);
}

/* Custom Scrollbar */
.content-preview::-webkit-scrollbar {
    width: 6px;
}

.theme-dark .content-preview::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.theme-light .content-preview::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.theme-dark .content-preview::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.theme-light .content-preview::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

.content-preview::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 150, 255, 0.5);
}

/* ===== Image Overlay (Lightbox) ===== */
.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(20px);
    animation: fadeIn 0.3s ease-out;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* ===== Meta Visualizer Premium ===== */
.meta-visualizer-premium {
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.theme-dark .meta-visualizer-premium {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.theme-light .meta-visualizer-premium {
    background: rgba(0, 0, 0, 0.01);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.meta-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.theme-dark .meta-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.theme-light .meta-header:hover {
    background: rgba(0, 0, 0, 0.02);
}

.meta-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.meta-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.theme-dark .meta-icon {
    background: rgba(105, 109, 112, 0.15);
    color: rgba(105, 109, 112, 1);
}

.theme-light .meta-icon {
    background: rgba(105, 109, 112, 0.1);
    color: rgba(105, 109, 112, 0.8);
}

.meta-title {
    font-size: 0.8rem;
    font-weight: 500;
}

.theme-dark .meta-title {
    color: rgba(232, 232, 240, 0.5);
}

.theme-light .meta-title {
    color: rgba(0, 0, 0, 0.5);
}

.meta-expand-icon {
    transition: transform 0.3s ease;
}

.theme-dark .meta-expand-icon {
    color: rgba(232, 232, 240, 0.3);
}

.theme-light .meta-expand-icon {
    color: rgba(0, 0, 0, 0.3);
}

.meta-visualizer-premium.expanded .meta-expand-icon {
    transform: rotate(180deg);
}

.meta-content {
    padding: 12px 16px 16px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-item.full-width {
    grid-column: span 2;
}

.meta-item-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.theme-dark .meta-item-label {
    color: rgba(232, 232, 240, 0.4);
}

.theme-light .meta-item-label {
    color: rgba(0, 0, 0, 0.4);
}

.meta-item-value {
    font-size: 0.85rem;
}

.theme-dark .meta-item-value {
    color: rgba(232, 232, 240, 0.8);
}

.theme-light .meta-item-value {
    color: rgba(0, 0, 0, 0.7);
}

.meta-id {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
    word-break: break-all;
}

.theme-dark .meta-id {
    background: rgba(0, 150, 255, 0.1);
    color: rgba(0, 150, 255, 0.8);
}

.theme-light .meta-id {
    background: rgba(0, 150, 255, 0.08);
    color: rgba(0, 150, 255, 0.9);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .visualizer-hero {
        height: 240px;
    }
    
    .visualizer-content {
        padding: 16px;
        gap: 16px;
    }
    
    .visualizer-section-header {
        padding: 12px 16px;
    }
    
    .visualizer-section-content {
        padding: 4px 16px 16px;
    }
    
    .stat-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .stat-item {
        min-width: 100%;
    }
    
    .meta-content {
        grid-template-columns: 1fr;
    }
    
    .meta-item.full-width {
        grid-column: span 1;
    }
}
