/* Batch details panel */
.sqmedia-batch-details-panel.sqmedia-hidden { display: none; }
.sqmedia-batch-details-panel { display: block; }
.sqmedia-batch-history-list .sqmedia-expand-icon.sqmedia-rotated { transform: rotate(90deg); }
.sqmedia-batch-history-list .sqmedia-batch-summary:hover { background: #f9f9f9; }

/* Orphan detection */
.sqmedia-orphan-group .sqmedia-orphan-details { display: none; }
.sqmedia-orphan-group.sqmedia-expanded .sqmedia-orphan-details { display: block !important; }
.sqmedia-orphan-group.sqmedia-expanded .sqmedia-toggle-icon { transform: rotate(180deg); }
.sqmedia-toggle-icon { transition: transform 0.2s; }

.sqmedia-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #c3c4c7;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: sqmedia-spin 0.8s linear infinite;
}
@keyframes sqmedia-spin {
    to { transform: rotate(360deg); }
}

.sqmedia-orphan-scanning .sqmedia-quarantine-orphans,
.sqmedia-orphan-scanning .sqmedia-orphan-checkbox,
.sqmedia-orphan-scanning .sqmedia-orphan-select-all {
    pointer-events: none;
    opacity: 0.5;
}

/* Folder tree */
.sqmedia-folder-tree-container { margin-bottom: 20px; border: 1px solid #ddd; border-radius: 4px; background: #fafafa; }
.sqmedia-folder-tree-header { padding: 10px 15px; background: #f0f0f1; border-bottom: 1px solid #ddd; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.sqmedia-folder-tree-header:hover { background: #e8e8e8; }
.sqmedia-tree-node { padding-left: 20px; }
.sqmedia-tree-item { display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-bottom: 1px solid #f0f0f1; font-size: 13px; }
.sqmedia-tree-item:hover { background: #f0f6fc; }
.sqmedia-tree-toggle { cursor: pointer; transition: transform 0.2s; display: inline-block; width: 16px; text-align: center; flex-shrink: 0; }
.sqmedia-tree-toggle.sqmedia-rotated { transform: rotate(90deg); }
.sqmedia-tree-children { display: none; }
.sqmedia-tree-expanded > .sqmedia-tree-children { display: block; }
.sqmedia-tree-badge { background: #dba617; color: white; padding: 1px 6px; border-radius: 8px; font-size: 11px; }
.sqmedia-tree-size { color: #646970; font-size: 12px; }
.sqmedia-whitelist-folder { font-size: 11px !important; padding: 2px 8px !important; min-height: auto !important; }
.sqmedia-whitelist-folder.sqmedia-whitelisted { background: #d4edda !important; border-color: #c3e6cb !important; color: #155724 !important; cursor: default; }

/* Media Manager layout */
.sqmedia-media-manager { max-width: 1200px; }
.sqmedia-section {
    background: #fff;
    border: 1px solid #ccd0d4;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
}
.sqmedia-section h2 { margin-top: 0; padding-bottom: 10px; border-bottom: 1px solid #eee; }
.sqmedia-section-description { color: #666; margin-bottom: 15px; }

.sqmedia-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}
.sqmedia-stat-card {
    background: #f6f7f7;
    padding: 20px;
    text-align: center;
    border-radius: 4px;
    border-left: 4px solid #ccc;
}
.sqmedia-stat-card.sqmedia-stat-success { border-left-color: #00a32a; }
.sqmedia-stat-card.sqmedia-stat-warning { border-left-color: #dba617; }
.sqmedia-stat-number { font-size: 28px; font-weight: 600; color: #1d2327; }
.sqmedia-stat-label { color: #666; margin-top: 5px; }

.sqmedia-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}
.sqmedia-setting-item { padding: 8px; background: #f6f7f7; border-radius: 4px; }

.sqmedia-registration-status { padding: 12px; border-radius: 4px; margin-bottom: 15px; }
.sqmedia-registration-status.sqmedia-status-warning { background: #fcf9e8; border-left: 4px solid #dba617; }
.sqmedia-registration-status.sqmedia-status-success { background: #edfaef; border-left: 4px solid #00a32a; }

.sqmedia-registration-actions { display: flex; gap: 10px; }

.sqmedia-batch-history-list {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.sqmedia-batch-item {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    display: flex;
    gap: 15px;
}
.sqmedia-batch-item:last-child { border-bottom: none; }
.sqmedia-batch-item.incomplete { background: #fcf9e8; }
.sqmedia-batch-date { color: #666; }
.sqmedia-batch-status { color: #dba617; }

.sqmedia-scanning-disabled .sqmedia-fix-action,
.sqmedia-scanning-disabled .sqmedia-fix-single,
.sqmedia-scanning-disabled .sqmedia-fix-selected,
.sqmedia-scanning-disabled .sqmedia-item-checkbox,
.sqmedia-scanning-disabled .sqmedia-select-all {
    pointer-events: none;
    opacity: 0.5;
}

/* Show footer when group is expanded */
.sqmedia-issue-group.sqmedia-expanded .sqmedia-issue-footer {
    display: block !important;
}

.sqmedia-progress-bar-container {
    background: #e0e0e0;
    border-radius: 4px;
    height: 24px !important;
    min-height: 24px !important;
    overflow: visible;
    position: relative;
    margin: 10px 0;
}
.sqmedia-progress-bar {
    background: linear-gradient(90deg, #0073aa, #005a87);
    height: 24px !important;
    min-height: 24px !important;
    width: 0%;
    border-radius: 4px;
    transition: width 0.3s ease;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
}
.sqmedia-progress-text { margin-top: 8px; color: #666; }

.sqmedia-issues-table { margin-top: 15px; }

.sqmedia-action-detail { margin-bottom: 15px; }
.sqmedia-action-detail h5 { margin-bottom: 5px; }
.sqmedia-action-detail ul { margin: 0; padding-left: 20px; }
.sqmedia-action-detail li { margin-bottom: 3px; }

.sqmedia-actions-list {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0;
    list-style: none;
    margin: 15px 0;
}
.sqmedia-actions-list li {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}
.sqmedia-actions-list li:last-child { border-bottom: none; }
.sqmedia-action-description { color: #666; font-size: 13px; margin-top: 3px; }

/* Issue group expand/collapse */
.sqmedia-issue-group .sqmedia-issue-details { display: none; }
.sqmedia-issue-group.sqmedia-expanded .sqmedia-issue-details { display: block !important; }
.sqmedia-issue-group.sqmedia-expanded .sqmedia-toggle-icon { transform: rotate(180deg); }
