/* ========================================
   FOLDER METADATA STYLES
   ======================================== */

/* Folder Metadata Container */
.folder-metadata-container {
    margin: 1rem 0;
    border-radius: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

/* Folder Metadata Toggle Button */
.folder-metadata-toggle {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.2s ease;
    font-size: 0.95rem;
    color: var(--text-color);
    position: relative;
    z-index: 10;
    outline: none;
}

.folder-metadata-toggle:hover {
    background: var(--button-hover);
    color: white;
}

.folder-metadata-toggle:focus {
    outline: 2px solid var(--link-color);
    outline-offset: 2px;
}

.folder-metadata-icon {
    margin-right: 0.5rem;
}

.folder-metadata-label {
    flex: 1;
    text-align: left;
    font-weight: 500;
}

.folder-metadata-arrow {
    transition: transform 0.2s ease;
    font-size: 0.8rem;
}

.folder-metadata-container.expanded .folder-metadata-arrow {
    transform: rotate(180deg);
}

/* Folder Metadata Content - HIDDEN BY DEFAULT */
.folder-metadata-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    background: var(--bg-color);
    opacity: 0;
    display: none; /* Force hide initially */
}

/* Show content when expanded */
.folder-metadata-container.expanded .folder-metadata-content {
    max-height: 1000px;
    border-top: 1px solid var(--border-color);
    opacity: 1;
    display: block; /* Show when expanded */
}

/* Folder Metadata Grid */
.folder-metadata-grid {
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem 1rem;
}

/* Folder Metadata Items */
.folder-metadata-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

.folder-metadata-key {
    font-weight: 600;
    color: var(--link-color);
    white-space: nowrap;
    min-width: fit-content;
}

.folder-metadata-value {
    color: var(--text-color);
    word-break: break-word;
    flex: 1;
}

/* Tags for list items */
.folder-metadata-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.folder-metadata-tag {
    background: var(--link-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Nested metadata */
.folder-metadata-nested {
    background: var(--card-bg);
    padding: 0.5rem;
    border-radius: 4px;
    border-left: 3px solid var(--link-color);
}

.folder-metadata-nested-item {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

/* Long text handling */
.folder-metadata-expand {
    background: none;
    border: none;
    color: var(--link-color);
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    margin-left: 0.5rem;
    font-size: 0.85rem;
}

.folder-metadata-expand:hover {
    color: var(--link-hover);
}

/* Links */
.folder-metadata-value a {
    color: var(--link-color);
    text-decoration: none;
}

.folder-metadata-value a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    .folder-metadata-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .folder-metadata-item {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .folder-metadata-key {
        white-space: normal;
    }
}
