/* Upload Form Redesign - Clean Minimalist Design */
:root {
    --primary-color: #1e40af;
    --secondary-color: #3b82f6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --light-bg: #f8fafc;
    --border-color: #e2e8f0;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #3730a3 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    line-height: 1.6;
}

.upload-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.upload-card {
    background: var(--white);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
}

/* Header with Logo */
.upload-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.upload-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.company-logo {
    background: var(--white);
    color: var(--primary-color);
    width: 80px;
    height: 80px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    font-weight: bold;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-md);
}

.upload-title {
    color: var(--white);
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    position: relative;
    z-index: 1;
}

/* Main Content */
.upload-body {
    padding: 3rem 2rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: left;
}

/* Form Sections */
.form-section {
    background: #f9fafb;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.section-title i {
    color: var(--primary-color);
}

/* Form Controls */
.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-control, .form-select {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    background: var(--white);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(30, 64, 175, 0.1);
    outline: none;
}

.form-control::placeholder {
    color: #9ca3af;
    font-size: 0.875rem;
}

.required {
    color: var(--danger-color);
    font-weight: 600;
}

.invalid-feedback {
    display: block;
    font-size: 0.75rem;
    color: var(--danger-color);
    margin-top: 0.25rem;
}

.is-invalid {
    border-color: var(--danger-color);
}

.is-invalid:focus {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.1);
}

/* File Upload Area */
.file-upload-section {
    margin-bottom: 2rem;
}

.upload-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: block;
}

.upload-label .required {
    color: var(--danger-color);
    margin-left: 0.25rem;
}

.file-drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    background: #fafbfc;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.file-drop-zone:hover {
    border-color: var(--primary-color);
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.file-drop-zone.dragover {
    border-color: var(--primary-color);
    background: #eff6ff;
    border-style: solid;
    transform: scale(1.02);
}

.upload-icon-container {
    margin-bottom: 1.5rem;
}

.upload-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 2rem;
    transition: all 0.3s ease;
}

.file-drop-zone:hover .upload-icon {
    background: var(--primary-color);
    color: var(--white);
    transform: scale(1.1);
}

.upload-text {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.select-files-btn {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.select-files-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.select-files-btn:active {
    transform: translateY(0);
}

/* Hidden file input */
.file-input-hidden {
    display: none;
}

/* Selected Files Display */
.selected-files {
    margin-top: 1.5rem;
    display: none;
}

.selected-files.has-files {
    display: block;
}

.files-list {
    background: #f9fafb;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--white);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-item:hover {
    box-shadow: var(--shadow-sm);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.file-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.file-size {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.file-remove {
    color: var(--danger-color);
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.file-remove:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Submit Button */
.submit-section {
    text-align: center;
    margin-top: 2rem;
}

.submit-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    border: none;
    padding: 1rem 3rem;
    border-radius: 12px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    min-width: 200px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(30, 64, 175, 0.3);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.submit-btn .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

.submit-btn.loading .spinner {
    display: inline-block;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }

    .upload-header {
        padding: 1.5rem 1rem;
    }

    .upload-title {
        font-size: 1.5rem;
    }

    .upload-body {
        padding: 2rem 1rem;
    }

    .page-title {
        font-size: 1.5rem;
        text-align: center;
    }

    .form-section {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
    }

    .section-title {
        font-size: 1.125rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .section-title i {
        font-size: 1.5rem;
    }

    .file-drop-zone {
        padding: 2rem 1rem;
        min-height: 160px;
    }

    .upload-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .upload-text {
        font-size: 1rem;
    }

    .upload-hint {
        font-size: 0.8rem;
    }

    .select-files-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }

    .submit-btn {
        width: 100%;
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
    }

    .file-info {
        width: 100%;
    }

    .file-remove {
        align-self: flex-end;
        margin-top: -2rem;
    }

    /* Form controls mobile optimization */
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.875rem 1rem;
    }

    .form-label {
        font-size: 0.9rem;
        font-weight: 600;
    }

    /* Better touch targets */
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
    }

    /* Improved spacing for mobile */
    .row.g-3 {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: 1rem;
    }
}

/* Extra small devices */
@media (max-width: 576px) {
    .upload-container {
        padding: 0;
    }

    .upload-card {
        border-radius: 0;
        margin: 0;
        min-height: 100vh;
    }

    .upload-header {
        padding: 1rem;
        border-radius: 0;
    }

    .company-logo {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .upload-title {
        font-size: 1.25rem;
    }

    .upload-body {
        padding: 1.5rem 1rem;
    }

    .form-section {
        padding: 1rem;
        border-radius: 12px;
    }

    .section-title {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .file-drop-zone {
        padding: 1.5rem 0.75rem;
        min-height: 140px;
    }

    .upload-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .upload-text {
        font-size: 0.9rem;
    }

    .select-files-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.85rem;
    }
}

/* Success/Error Messages */
.alert {
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: none;
    font-weight: 500;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    border-left: 4px solid var(--warning-color);
}

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

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

.loading-content {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

/* File type specific icons */
.file-icon.pdf { background: #dc2626; }
.file-icon.doc, .file-icon.docx { background: #2563eb; }
.file-icon.xls, .file-icon.xlsx { background: #059669; }
.file-icon.jpg, .file-icon.jpeg, .file-icon.png, .file-icon.gif { background: #7c3aed; }
.file-icon.txt, .file-icon.csv { background: #6b7280; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.file-item {
    animation: fadeIn 0.3s ease-out;
}

/* Improved focus states */
.select-files-btn:focus,
.submit-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Better hover effects */
.file-drop-zone:hover .upload-text {
    color: var(--primary-color);
}

.file-drop-zone:hover .upload-hint {
    color: var(--text-primary);
}

/* Form field focus animations */
.form-control:focus, .form-select:focus {
    transform: translateY(-1px);
}

/* Better visual hierarchy */
.form-section:first-of-type {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 4px solid var(--primary-color);
}

.form-section:nth-of-type(2) {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-left: 4px solid var(--success-color);
}

/* Improved file upload section */
.file-upload-section {
    background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid #fbbf24;
    border-left: 4px solid var(--warning-color);
}

/* Success states */
.form-control.is-valid, .form-select.is-valid {
    border-color: var(--success-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2310b981' d='m2.3 6.73.94-.94 1.44 1.44L7.4 4.5l.94.94L4.66 9.17z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-valid:focus, .form-select.is-valid:focus {
    border-color: var(--success-color);
    box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.1);
}

/* Loading states */
.form-control:disabled, .form-select:disabled {
    background-color: #f9fafb;
    opacity: 0.7;
}

/* Better button states */
.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    transform: none !important;
    cursor: not-allowed;
}

/* Improved alert styling */
.alert {
    border: none;
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.alert i {
    margin-top: 0.125rem;
    flex-shrink: 0;
}

/* Better file item styling */
.file-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Smooth transitions */
* {
    transition: all 0.2s ease;
}

.form-control, .form-select, .btn, .file-item, .alert {
    transition: all 0.3s ease;
}
