/* Upload Page Styles */

.upload-workspace {
    padding: 60px 0;
    min-height: 80vh;
}

.page-title {
    text-align: center;
    font-size: 42px;
    font-weight: 900;
    color: var(--text-white);
    margin-bottom: 50px;
}

.page-title i {
    color: var(--primary-red);
    margin-left: 15px;
}

/* Steps Indicator */
.steps-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 60px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-gray);
    transition: all 0.3s ease;
}

.step-item.active .step-number {
    background: var(--primary-red);
    border-color: var(--primary-red);
    color: var(--text-white);
    box-shadow: 0 4px 20px rgba(220, 20, 60, 0.4);
}

.step-item.completed .step-number {
    background: var(--success-green);
    border-color: var(--success-green);
    color: var(--text-white);
}

.step-label {
    font-size: 14px;
    color: var(--text-gray);
    font-weight: 600;
}

.step-item.active .step-label {
    color: var(--primary-red);
}

.step-line {
    width: 80px;
    height: 3px;
    background: var(--border-color);
    margin: 0 10px;
}

.step-item.active ~ .step-line,
.step-item.completed ~ .step-line {
    background: var(--primary-red);
}

/* Images Section */
.images-section,
.results-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.section-header h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header h2 i {
    color: var(--gold);
}

.header-actions {
    display: flex;
    gap: 15px;
}

.action-btn {
    background: var(--card-bg);
    color: var(--text-white);
    border: 2px solid var(--border-color);
    padding: 12px 25px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Tajawal', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn:hover {
    border-color: var(--primary-red);
    background: rgba(220, 20, 60, 0.1);
    transform: translateY(-2px);
}

.action-btn.primary-btn {
    background: var(--primary-red);
    border-color: var(--primary-red);
}

.action-btn.primary-btn:hover {
    background: var(--hover-red);
}

.action-btn.success-btn {
    background: var(--success-green);
    border-color: var(--success-green);
}

.action-btn.success-btn:hover {
    background: #00e676;
}

/* Images Grid */
.images-grid,
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.image-item {
    position: relative;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    cursor: move;
    transition: all 0.3s ease;
}

.image-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary-red);
    box-shadow: 0 8px 25px rgba(220, 20, 60, 0.3);
}

.image-item.sortable-ghost {
    opacity: 0.4;
}

.image-item.sortable-chosen {
    border-color: var(--gold);
}

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

.image-info {
    padding: 15px;
    background: rgba(13, 13, 13, 0.8);
}

.image-order {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-red);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(220, 20, 60, 0.5);
}

.image-name {
    color: var(--text-white);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.image-action-btn {
    flex: 1;
    background: rgba(220, 20, 60, 0.1);
    color: var(--primary-red);
    border: 1px solid var(--primary-red);
    padding: 8px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Tajawal', sans-serif;
}

.image-action-btn:hover {
    background: var(--primary-red);
    color: white;
}

/* Process Button */
.action-buttons {
    text-align: center;
    margin-top: 40px;
}

.process-btn {
    background: linear-gradient(135deg, var(--primary-red), var(--hover-red));
    color: white;
    border: none;
    padding: 20px 60px;
    font-size: 22px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Tajawal', sans-serif;
    box-shadow: 0 8px 30px rgba(220, 20, 60, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.process-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(220, 20, 60, 0.6);
}

/* Results */
.result-item {
    position: relative;
}

.result-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--success-green);
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(0, 200, 83, 0.4);
}

.result-badge.no-censor {
    background: var(--border-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 100px 20px;
}

.empty-state i {
    font-size: 120px;
    color: var(--border-color);
    margin-bottom: 30px;
}

.empty-state h3 {
    font-size: 32px;
    color: var(--text-white);
    margin-bottom: 15px;
}

.empty-state p {
    font-size: 18px;
    color: var(--text-gray);
    margin-bottom: 30px;
}

.empty-state-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-red);
    color: white;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.empty-state-btn:hover {
    background: var(--hover-red);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(220, 20, 60, 0.4);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 13, 13, 0.95);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 6px solid rgba(220, 20, 60, 0.2);
    border-top: 6px solid var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
}

.loading-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 10px;
}

.loading-subtext {
    font-size: 18px;
    color: var(--gold);
    font-weight: 600;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Processing Status */
.processing-status {
    background: var(--card-bg);
    border: 2px solid var(--primary-red);
    border-radius: 15px;
    margin: 30px auto;
    max-width: 600px;
    padding: 40px;
}

.processing-status.hidden {
    display: none;
}

.processing-content {
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(220, 20, 60, 0.2);
    border-top: 5px solid var(--primary-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

.processing-content h3 {
    font-size: 24px;
    color: var(--text-white);
    margin-bottom: 15px;
}

.progress-text {
    font-size: 18px;
    color: var(--gold);
    font-weight: 600;
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(220, 20, 60, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-red), var(--gold));
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Results Stats */
.results-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--primary-red);
    transform: translateY(-3px);
}

.stat-card i {
    font-size: 40px;
    color: var(--primary-red);
}

.stat-card h4 {
    font-size: 32px;
    font-weight: 800;
    color: var(--gold);
    margin: 0;
}

.stat-card p {
    font-size: 14px;
    color: var(--text-gray);
    margin: 5px 0 0;
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .steps-indicator {
        flex-wrap: wrap;
        gap: 20px;
    }

    .step-line {
        display: none;
    }

    .section-header {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }

    .images-grid,
    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .process-btn {
        font-size: 18px;
        padding: 15px 40px;
    }

    .results-stats {
        grid-template-columns: 1fr;
    }
}