/* Content Cleanup Page Styles */

.content-cleanup-page {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.cleanup-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}

.cleanup-title h1 {
    margin: 0;
    font-size: 24px;
    color: #fff;
}

.cleanup-title h1 i {
    margin-right: 10px;
    color: #4a9eff;
}

.cleanup-subtitle {
    color: #888;
    font-size: 14px;
    display: block;
    margin-top: 5px;
}

/* Stage Container */
.cleanup-stage {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 20px;
}

.stage-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}

.stage-number {
    width: 32px;
    height: 32px;
    background: #4a9eff;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.stage-number.complete {
    background: #2e7d32;
}

.stage-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.back-btn {
    margin-left: auto;
}

/* Search Stage */
.search-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-main {
    display: flex;
    gap: 10px;
}

.search-term-input {
    flex: 1;
    padding: 15px 20px;
    background: #252525;
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
}

.search-term-input:focus {
    outline: none;
    border-color: #4a9eff;
}

.search-btn {
    padding: 15px 25px;
    font-size: 14px;
    white-space: nowrap;
}

.search-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.option-group label {
    font-size: 12px;
    color: #888;
}

.option-group select,
.option-group input[type="date"] {
    padding: 8px 12px;
    background: #252525;
    border: 1px solid #333;
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
}

.search-status {
    margin-top: 20px;
}

.searching-indicator,
.no-results,
.error-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    color: #888;
    font-size: 14px;
}

.searching-indicator i {
    color: #4a9eff;
}

.error-message {
    color: #f44336;
}

/* Review Stage */
.results-summary {
    display: flex;
    gap: 20px;
    padding: 12px 15px;
    background: #252525;
    border-radius: 6px;
    margin-bottom: 15px;
}

.results-summary span {
    color: #aaa;
    font-size: 13px;
}

.results-summary i {
    margin-right: 6px;
    color: #4a9eff;
}

.selection-toolbar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: #1e1e1e;
    border-radius: 6px;
    margin-bottom: 15px;
}

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

.selection-actions button {
    padding: 8px 15px;
    font-size: 13px;
}

.selection-summary {
    color: #aaa;
    font-size: 14px;
}

.selection-summary strong {
    color: #fff;
}

.continue-btn {
    margin-left: auto;
    padding: 10px 20px;
}

.continue-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* User List */
.user-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 500px;
    overflow-y: auto;
}

.user-row {
    background: #252525;
    border-radius: 6px;
    border: 1px solid #333;
}

.user-row.selected {
    border-color: #4a9eff;
}

.user-row-main {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
}

.user-checkbox {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    font-size: 18px;
}

.user-checkbox.checked {
    color: #4a9eff;
}

.user-info {
    flex: 1;
    display: flex;
    gap: 8px;
    align-items: center;
}

.user-email {
    color: #fff;
    font-size: 14px;
}

.user-name {
    color: #888;
    font-size: 13px;
}

.image-count {
    color: #aaa;
    font-size: 13px;
    padding: 4px 10px;
    background: #1e1e1e;
    border-radius: 4px;
}

.expand-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 5px 10px;
}

.expand-btn:hover {
    color: #fff;
}

/* Standing Badges */
.standing-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.standing-badge.good {
    background: #1b5e20;
    color: #81c784;
}

.standing-badge.limited {
    background: #f57f17;
    color: #fff8e1;
}

.standing-badge.very-limited {
    background: #e65100;
    color: #fff3e0;
}

.standing-badge.suspended {
    background: #b71c1c;
    color: #ffcdd2;
}

.standing-badge.unknown {
    background: #37474f;
    color: #90a4ae;
}

/* Expanded Row */
.user-row-expanded {
    padding: 15px;
    border-top: 1px solid #333;
    background: #1e1e1e;
}

.image-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.preview-image {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 4px;
    overflow: hidden;
    background: #333;
}

.preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-score {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 3px;
}

.more-images {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #333;
    border-radius: 4px;
    color: #888;
    font-size: 11px;
}

/* Confirm Stage */
.confirm-summary {
    margin-bottom: 20px;
}

.summary-card {
    display: flex;
    gap: 15px;
    padding: 20px;
    border-radius: 8px;
    align-items: flex-start;
}

.summary-card.warning {
    background: #3d2914;
    border: 1px solid #f57c00;
}

.summary-card.warning i {
    color: #f57c00;
    font-size: 24px;
}

.summary-card.success {
    background: #1b3d1e;
    border: 1px solid #4caf50;
}

.summary-card.success i {
    color: #4caf50;
    font-size: 24px;
}

.summary-text {
    color: #fff;
}

.summary-text > strong {
    display: block;
    margin-bottom: 5px;
}

.summary-item {
    display: block;
    color: #ddd;
    margin-left: 5px;
}

/* Config Form */
.config-form {
    background: #252525;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.config-form h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #fff;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.form-group label {
    font-size: 13px;
    color: #aaa;
}

.form-group select,
.form-group input[type="number"],
.form-group textarea {
    padding: 10px 12px;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4a9eff;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.form-hint {
    font-size: 11px;
    color: #666;
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #ddd;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #4a9eff;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
}

.execute-btn {
    padding: 12px 30px;
    font-size: 15px;
}

/* Executing Stage */
.progress-section {
    margin-bottom: 20px;
}

.progress-text {
    color: #aaa;
    font-size: 14px;
    margin-bottom: 10px;
}

.progress-bar-container {
    height: 24px;
    background: #252525;
    border-radius: 12px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4a9eff, #2196f3);
    border-radius: 12px;
    transition: width 0.3s ease;
}

.progress-percent {
    text-align: right;
    color: #fff;
    font-size: 14px;
    margin-top: 5px;
}

.execution-log {
    background: #0d0d0d;
    border-radius: 6px;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 13px;
}

.log-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #1e1e1e;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry.success {
    color: #81c784;
}

.log-entry.success i {
    color: #4caf50;
}

.log-entry.error {
    color: #ef9a9a;
}

.log-entry.error i {
    color: #f44336;
}

/* Complete Stage */
.complete-summary {
    margin-bottom: 20px;
}

.summary-stats {
    color: #fff;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    color: #aaa;
}

.stat-value {
    font-weight: 600;
}

.stat-row.error .stat-value {
    color: #f44336;
}

.error-details {
    background: #2d1515;
    border: 1px solid #f44336;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.error-details h4 {
    margin: 0 0 10px 0;
    color: #f44336;
    font-size: 14px;
}

.error-details ul {
    margin: 0;
    padding-left: 20px;
    color: #ef9a9a;
    font-size: 13px;
}

.complete-actions {
    display: flex;
    justify-content: center;
}

/* Buttons */
.btn-primary {
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    padding: 10px 20px;
}

.btn-primary:hover {
    background: #1565c0;
}

.btn-secondary {
    background: #424242;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    padding: 10px 20px;
}

.btn-secondary:hover {
    background: #616161;
}

.btn-danger {
    background: #c62828;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    padding: 10px 20px;
}

.btn-danger:hover {
    background: #b71c1c;
}

/* Responsive */
@media (max-width: 768px) {
    .search-main {
        flex-direction: column;
    }

    .search-options {
        flex-direction: column;
    }

    .selection-toolbar {
        flex-direction: column;
        gap: 10px;
    }

    .continue-btn {
        margin-left: 0;
        width: 100%;
    }

    .form-row {
        flex-direction: column;
    }

    .results-summary {
        flex-direction: column;
        gap: 10px;
    }
}

/* Image Preview Modal */
.image-preview-modal,
.all-images-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
}

.preview-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.preview-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    padding: 5px 10px;
    z-index: 10;
}

.preview-modal-close:hover {
    color: #4a9eff;
}

.preview-modal-image {
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-modal-image img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
}

.preview-modal-prompt {
    margin-top: 15px;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    color: #ccc;
    font-size: 13px;
    max-width: 600px;
    max-height: 100px;
    overflow-y: auto;
}

.preview-modal-prompt strong {
    color: #fff;
}

/* All Images Modal */
.all-images-modal-content {
    position: relative;
    background: #1a1a1a;
    border-radius: 8px;
    width: 90vw;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.all-images-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #252525;
    border-bottom: 1px solid #333;
}

.all-images-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #fff;
}

.all-images-modal-header .preview-modal-close {
    position: static;
    font-size: 24px;
}

.all-images-grid {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: calc(90vh - 60px);
}

.all-images-grid .preview-image {
    width: 100px;
    height: 100px;
}

/* Make preview images clickable */
.preview-image {
    cursor: pointer;
}

.preview-image:hover {
    opacity: 0.8;
}

.more-images {
    cursor: pointer;
}

.more-images:hover {
    background: #4a9eff;
    color: #fff;
}

/* Selected Users Table (Confirm Stage) */
.selected-users-list {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 10px;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.users-table th {
    text-align: left;
    padding: 10px 12px;
    background: #1e1e1e;
    color: #888;
    font-weight: 500;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
}

.users-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #2a2a2a;
    color: #ddd;
}

.users-table tr:hover td {
    background: #2a2a2a;
}

.users-table .user-email {
    color: #fff;
    font-weight: 500;
}

.users-table .user-name {
    color: #888;
    font-size: 12px;
    margin-left: 5px;
}

.users-table .standing-badge {
    font-size: 10px;
    padding: 3px 8px;
}
