/* ========================================
   METADATA POPUP STYLES
   ======================================== */

/* Metadata button on thumbnails */
.metadata-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.grid-item:hover .metadata-btn {
    opacity: 1;
}

.metadata-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.metadata-btn:active {
    transform: scale(0.95);
}

/* Grid item positioning for metadata button */
.grid-item {
    position: relative;
}

/* Metadata popup */
.metadata-popup {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 320px;
    min-width: 250px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.metadata-popup.show {
    opacity: 1;
    transform: translateY(0);
}

.metadata-popup-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--header-background);
    border-radius: 8px 8px 0 0;
}

.metadata-popup-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    word-break: break-word;
}

.metadata-popup-content {
    padding: 12px 16px;
    max-height: 300px;
    overflow-y: auto;
}

.metadata-field {
    display: flex;
    margin-bottom: 8px;
    gap: 8px;
    align-items: flex-start;
}

.metadata-field:last-child {
    margin-bottom: 0;
}

.metadata-key {
    font-weight: 500;
    color: var(--accent-color);
    font-size: 12px;
    min-width: 80px;
    flex-shrink: 0;
}

.metadata-value {
    font-size: 12px;
    color: var(--text-color);
    word-break: break-word;
    flex: 1;
}

.metadata-value code {
    background: var(--code-background);
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 11px;
    font-family: 'Courier New', monospace;
}

.metadata-tag {
    background: var(--accent-color);
    color: var(--background-color);
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    margin-right: 4px;
    display: inline-block;
}

.metadata-more {
    color: var(--breadcrumb-color);
    font-style: italic;
    font-size: 11px;
}

.no-metadata {
    color: var(--breadcrumb-color);
    font-style: italic;
    margin: 0;
    text-align: center;
    padding: 20px 0;
}

/* Custom scrollbar for metadata popup */
.metadata-popup-content::-webkit-scrollbar {
    width: 6px;
}

.metadata-popup-content::-webkit-scrollbar-track {
    background: transparent;
}

.metadata-popup-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.metadata-popup-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .metadata-popup {
        max-width: calc(100vw - 32px);
        min-width: 200px;
    }
    
    .metadata-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
        top: 6px;
        right: 6px;
    }
}
