/* upload.css - Upload page specific styles WITH USER INFO */

/* ============================================
   ANIMATIONS - ADD AT THE TOP
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================
   PAGE HEADER
   ============================================ */

/* Same light background as the other pages */
body {
    background: var(--light);
    color: #2f3a3d;
}

/* Main Content */
.main-content {
    padding: 2rem 0 3rem;
    background: var(--light);
    min-height: 100vh;
}

.upload-container {
    max-width: 900px;
    margin: 0 auto;
}

/* Progress Steps */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 25px;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 0;
}

.progress-line {
    position: absolute;
    top: 25px;
    left: 0;
    height: 3px;
    background: var(--primary);
    transition: width 0.3s ease;
    z-index: 1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 2;
    flex: 1;
}

.step-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 19px; /* Recommended: 19px - matches h3 */
    transition: all 0.3s;
}

.step.active .step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    box-shadow: 0 3px 10px rgba(18, 67, 109, 0.3);
}

.step.completed .step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.step-label {
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    color: rgba(49, 66, 71, 0.7);
}

.step.active .step-label {
    color: var(--primary);
}

/* Form Card */
.form-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(18, 67, 109, 0.08);
    box-shadow: none;
    margin-bottom: 2rem;
}

.form-section {
    display: none;
    animation: fadeInUp 0.5s;
}

.form-section.active {
    display: block;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 0.45rem;
    color: var(--primary);
    text-align: left;
}

.section-description {
    color: #5f666a;
    margin-bottom: 2rem;
    line-height: 1.6;
    font-size: 15px;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
    font-size: 16px; /* Recommended: 16px */
}

.form-label.required::after {
    content: ' *';
    color: #dc3545;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px; /* Recommended: 16px */
    font-family: inherit;
    transition: all 0.3s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(29, 53, 46, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.form-hint {
    font-size: 16px; /* Recommended: 16px */
    color: #666;
    margin-top: 0.3rem;
}

/* Custom Organization/Category Containers */
#customOrgContainer,
#customCatContainer {
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Upload Zone */
.upload-zone {
    border: 3px dashed var(--border);
    border-radius: 10px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--light);
}

.upload-zone:hover {
    border-color: var(--primary);
    background: #f0f8f4;
    transform: translateY(-2px);
}

.upload-zone.dragover {
    border-color: var(--primary);
    background: #e6f4ed;
    border-style: solid;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.upload-text {
    font-size: 17px; /* Recommended: 17px - body text weight */
    margin-bottom: 0.5rem;
    color: var(--dark);
    font-weight: 600;
}

.upload-hint {
    font-size: 16px; /* Recommended: 16px */
    color: #666;
}

/* ============================================
   FILE LIST WITH USER INFORMATION
   ============================================ */

.file-list {
    margin-top: 1.5rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1rem;
    background: white;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    transition: box-shadow 0.2s, border-color 0.2s;
    border: 1px solid rgba(18, 67, 109, 0.15);
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.file-item:hover {
    border-color: var(--primary);
    box-shadow: 0 3px 10px rgba(18, 67, 109, 0.1);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 200px;
}

.file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--light);
    border-radius: 8px;
    flex-shrink: 0;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: var(--dark);
    word-break: break-word;
    font-size: 16px; /* Recommended: 16px */
}

.file-size {
    font-size: 16px; /* Recommended: 16px */
    color: #666;
}

/* USER INFO IN FILE LIST */
.file-user-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    flex: 1;
    min-width: 250px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px; /* Recommended: 16px */
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(18, 67, 109, 0.2);
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 16px; /* Recommended: 16px */
    color: var(--dark);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-org {
    font-size: 16px; /* Recommended: 16px */
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    flex-shrink: 0;
}

.file-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    color: #aaa;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
    padding: 0;
}

.file-remove:hover {
    background: #fde8e8;
    color: #e74c3c;
    border-color: #e74c3c;
    transform: none;
    box-shadow: none;
}

/* Tag Input */
.tag-input-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    min-height: 50px;
    cursor: text;
    transition: border-color 0.3s;
}

.tag-input-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(29, 53, 46, 0.1);
}

.tag-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: var(--primary);
    color: var(--white);
    border-radius: 20px;
    font-size: 16px; /* Recommended: 16px */
    font-weight: 600;
    animation: fadeInUp 0.3s;
}

.tag-remove {
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}

.tag-remove:hover {
    transform: scale(1.2);
}

.tag-input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 150px;
    padding: 0.4rem;
    font-size: 16px; /* Recommended: 16px */
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    background: var(--light);
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.checkbox-group:hover {
    background: #f0f8f4;
    border-color: var(--primary);
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-group label {
    cursor: pointer;
    flex: 1;
    font-size: 16px; /* Recommended: 16px */
    color: var(--dark);
}

/* Multiple choice lists (extra categories, islands) */
.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.5rem 1rem;
}

.choice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 15px;
    color: var(--dark);
    cursor: pointer;
}

.choice input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.choice.is-main {
    opacity: 0.45;
    cursor: default;
}

/* ============================================
   PREVIEW SECTION WITH USER INFO
   ============================================ */

.preview-section {
    background: var(--light);
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.preview-title {
    font-size: 19px; /* Recommended: 19px - matches h3 */
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary);
}

.preview-item {
    display: flex;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
}

.preview-item:last-child {
    border-bottom: none;
}

.preview-label {
    font-weight: 600;
    width: 200px;
    color: #666;
    flex-shrink: 0;
    font-size: 16px; /* Recommended: 16px */
}

.preview-value {
    flex: 1;
    color: var(--dark);
    line-height: 1.6;
    font-size: 16px; /* Recommended: 16px */
}

/* Preview File Item with User Info */
.preview-file-item {
    padding: 1rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 0.8rem;
    border: 1px solid #e0e0e0;
}

.preview-file-item:last-child {
    margin-bottom: 0;
}

.preview-file-main {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.preview-file-main .preview-label {
    width: auto;
    font-size: 1.5rem;
}

.preview-user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 16px; /* Recommended: 16px */
    color: #666;
}

.preview-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.preview-user-text strong {
    color: var(--dark);
    font-weight: 600;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: start;
    gap: 1rem;
    line-height: 1.6;
    font-size: 16px; /* Recommended: 16px */
}

.alert span:first-child {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.alert-info {
    background: #d1ecf1;
    border: 1px solid rgba(12, 84, 96, 0.25);
    color: #0c5460;
}

.alert-warning {
    background: #fff3cd;
    border: 1px solid rgba(133, 100, 4, 0.3);
    color: #856404;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-top: 2rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-size: 0.96rem;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: none;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: none;
}

.btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-secondary:hover {
    background: rgba(18, 67, 109, 0.05);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn:disabled:hover {
    transform: none;
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 3rem 2rem;
}

.success-icon {
    font-size: 5rem;
    color: #28a745;
    margin-bottom: 1rem;
    animation: scaleIn 0.5s ease-out;
}

.success-title {
    font-size: 34px; /* Recommended: 34px - matches section titles */
    font-weight: 700;
    color: #28a745;
    margin-bottom: 1rem;
}

.success-text {
    color: #666;
    font-size: 17px; /* Recommended: 17px - body text */
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {

    .form-card {
        padding: 1.5rem;
    }

    .progress-steps {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .progress-steps::before,
    .progress-line {
        display: none;
    }

    .step {
        flex-direction: row;
        justify-content: flex-start;
        width: 100%;
    }

    .step-circle {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .step-label {
        text-align: left;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .preview-label {
        width: 120px;
    }

    .preview-item {
        flex-direction: column;
        gap: 0.3rem;
    }

    .preview-label {
        width: 100%;
    }

    .upload-zone {
        padding: 2rem 1rem;
    }

    .upload-icon {
        font-size: 3rem;
    }

    .section-title {
        font-size: 28px; /* Matches responsive section titles */
    }

    .success-message {
        padding: 2rem 1rem;
    }

    .success-icon {
        font-size: 4rem;
    }

    .success-title {
        font-size: 28px; /* Matches responsive section titles */
    }

    .success-text {
        font-size: 16px;
    }

    /* File item responsive */
    .file-item {
        flex-direction: column;
        align-items: stretch;
    }

    .file-info {
        width: 100%;
    }

    .file-user-info {
        width: 100%;
        min-width: 0;
    }

    .user-name,
    .user-org {
        white-space: normal;
    }

    .upload-date {
        margin-top: 0.3rem;
        width: 100%;
    }
}

@media (max-width: 480px) {
    
    .form-card {
        padding: 1.2rem;
    }

    .section-title {
        font-size: 24px;
    }

    .upload-text {
        font-size: 16px;
    }

    .file-item {
        padding: 0.8rem;
    }

    .file-info {
        gap: 0.5rem;
    }

    .file-icon {
        font-size: 1.5rem;
    }

    .tag-input-container {
        padding: 0.4rem;
    }

    .tag-item {
        font-size: 16px;
        padding: 0.3rem 0.6rem;
    }

    .file-user-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

/* ============================================
   UPLOAD PROGRESS BAR
   ============================================ */

.upload-progress-container {
    margin: 2rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    animation: fadeInUp 0.5s;
}

.upload-progress-bar {
    width: 100%;
    height: 30px;
    background: #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    margin-bottom: 1rem;
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #00a854 100%);
    border-radius: 15px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.upload-progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #666;
}

#uploadProgressPercent {
    font-weight: 600;
    font-size: 18px;
    color: var(--primary);
}

#uploadProgressStatus {
    color: #888;
    font-style: italic;
}