/**
 * Enhanced Application Forms CSS
 * Styles for multi-step forms and document uploads
 */

.sams-enhanced-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.sams-enhanced-form h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
}

/* Progress Bar */
.sams-form-progress {
    margin-bottom: 40px;
}

.sams-progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.sams-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #005a87);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.sams-progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sams-progress-steps .step {
    flex: 1;
    text-align: center;
    padding: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    position: relative;
}

.sams-progress-steps .step.active {
    color: #0073aa;
    font-weight: 600;
}

.sams-progress-steps .step.completed {
    color: #00a32a;
}

.sams-progress-steps .step.completed::after {
    content: "✓";
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    color: #00a32a;
    font-weight: bold;
}

/* Form Steps */
.sams-form-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.sams-form-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.sams-form-step h3 {
    color: #333;
    font-size: 24px;
    margin-bottom: 25px;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

/* Form Layout */
.sams-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.sams-form-group {
    flex: 1;
    margin-bottom: 20px;
}

.sams-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.sams-form-group label.required::after {
    content: " *";
    color: #d63638;
}

.sams-form-group input,
.sams-form-group select,
.sams-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.sams-form-group input:focus,
.sams-form-group select:focus,
.sams-form-group textarea:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
    outline: none;
}

.sams-form-group input.error,
.sams-form-group select.error {
    border-color: #d63638;
    box-shadow: 0 0 0 3px rgba(214, 54, 56, 0.1);
}

/* Document Upload */
.sams-document-sets {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.sams-document-sets h4 {
    margin: 0 0 15px 0;
    color: #495057;
}

.sams-document-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.sams-document-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ddd;
}

.sams-document-divider span {
    background: #fff;
    padding: 0 15px;
    color: #666;
    font-weight: 500;
}

.sams-document-upload-section h4 {
    margin-bottom: 20px;
    color: #333;
}

.sams-document-group {
    margin-bottom: 25px;
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    background: #fafbfc;
}

.sams-document-input {
    border: 2px dashed #ccc !important;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.sams-document-input:hover {
    border-color: #0073aa !important;
    background: #f8f9fa;
}

.sams-document-preview {
    margin-top: 10px;
}

.file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: #e8f4fd;
    border: 1px solid #b8e6ff;
    border-radius: 4px;
    margin-top: 10px;
}

.file-preview .file-name {
    font-weight: 500;
    color: #0066cc;
}

.file-preview .file-size {
    color: #666;
    font-size: 14px;
}

.file-preview .remove-file {
    background: #d63638;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.file-preview .remove-file:hover {
    background: #a23235;
}

.sams-document-save-option {
    margin-top: 20px;
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
}

.sams-document-save-option label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.sams-document-save-option input[type="checkbox"] {
    margin-right: 10px;
    width: auto;
}

.sams-document-save-option input[type="text"] {
    margin-top: 10px;
}

/* Document Upload Styles */
.sams-document-upload-area {
    margin-top: 20px;
    padding: 20px;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}

.document-section {
    margin-bottom: 30px;
}

.document-section h4,
.document-section h5 {
    margin-bottom: 15px;
    color: #333;
    font-weight: 600;
}

.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.document-upload-field {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    transition: border-color 0.3s ease;
}

.document-upload-field:hover {
    border-color: #0073aa;
}

.document-upload-field.required {
    border-left: 4px solid #e74c3c;
}

.document-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.file-upload-container {
    position: relative;
}

.sams-document-input {
    display: none;
}

.file-upload-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: 2px dashed #ccc;
    border-radius: 6px;
    background: #f9f9f9;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.file-upload-button:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.file-upload-button.file-selected {
    border-color: #28a745;
    background: #f0fff0;
    border-style: solid;
}

.upload-icon {
    margin-right: 8px;
    font-size: 18px;
}

.upload-text {
    font-weight: 500;
    color: #555;
}

.file-preview-area {
    margin-top: 10px;
}

.file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #e8f5e8;
    border: 1px solid #28a745;
    border-radius: 4px;
    font-size: 14px;
}

.file-name {
    font-weight: 500;
    color: #333;
    flex: 1;
    margin-right: 10px;
    word-break: break-word;
}

.file-size {
    color: #666;
    font-size: 12px;
    margin-right: 10px;
}

.remove-file {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.remove-file:hover {
    background: #c82333;
}

/* Loading and Message Styles */
.sams-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #f0f8ff;
    border: 1px solid #0073aa;
    border-radius: 6px;
    margin-bottom: 15px;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #0073aa;
    font-weight: 500;
}

.sams-error {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    margin-bottom: 15px;
    color: #721c24;
}

.sams-success {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    margin-bottom: 15px;
    color: #155724;
}

.error-icon,
.success-icon {
    margin-right: 10px;
    font-size: 16px;
}

.error-text,
.success-text {
    flex: 1;
    font-weight: 500;
}

.error-close,
.success-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
    color: inherit;
}

.error-close:hover,
.success-close:hover {
    opacity: 0.7;
}

/* Navigation */
.sams-form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.sams-btn-prev,
.sams-btn-next,
.sams-btn-submit {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.sams-btn-prev {
    background: #6c757d;
    color: white;
}

.sams-btn-prev:hover {
    background: #545b62;
}

.sams-btn-next,
.sams-btn-submit {
    background: #0073aa;
    color: white;
    margin-left: auto;
}

.sams-btn-next:hover,
.sams-btn-submit:hover {
    background: #005a87;
}

.sams-btn-submit {
    background: #00a32a;
}

.sams-btn-submit:hover {
    background: #007c20;
}

/* Program Selection */
.sams-program-search {
    position: relative;
    margin-bottom: 20px;
}

.sams-program-results {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-top: 10px;
}

.sams-program-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.sams-program-item:hover {
    background: #f8f9fa;
}

.sams-program-item.selected {
    background: #e8f4fd;
    border-color: #0073aa;
}

.sams-program-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.sams-program-details {
    font-size: 14px;
    color: #666;
}

/* Review Step */
.sams-review-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.sams-review-section h4 {
    margin: 0 0 15px 0;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 10px;
}

.sams-review-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.sams-review-item:last-child {
    border-bottom: none;
}

.sams-review-label {
    font-weight: 500;
    color: #495057;
}

.sams-review-value {
    color: #212529;
}

/* Error and Success Messages */
.sams-error-message,
.sams-success-message {
    padding: 12px;
    border-radius: 6px;
    margin: 15px 0;
    font-weight: 500;
}

.sams-error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.sams-success-message {
    background: #d1f2eb;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Login Required */
.sams-login-required {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.sams-login-required .button {
    background: #0073aa;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 6px;
    margin-top: 15px;
    display: inline-block;
}

/* Upload Progress Styles */
.upload-progress {
    padding: 10px;
    background: #f0f8ff;
    border: 1px solid #0073aa;
    border-radius: 4px;
    text-align: center;
}

.progress-bar {
    width: 0%;
    height: 4px;
    background: #0073aa;
    border-radius: 2px;
    transition: width 0.3s ease;
    margin-bottom: 5px;
}

.file-preview.success {
    background: #e8f5e8;
    border-color: #28a745;
}

.file-preview.success .file-name::before {
    content: "✅ ";
    color: #28a745;
}

/* Application Success Styles */
.application-success {
    text-align: center;
    padding: 40px 20px;
    background: #f0fff0;
    border: 2px solid #28a745;
    border-radius: 10px;
    margin: 20px 0;
}

.application-success h3 {
    color: #28a745;
    margin-bottom: 20px;
    font-size: 24px;
}

.application-success p {
    margin-bottom: 15px;
    font-size: 16px;
    line-height: 1.5;
}

.application-success strong {
    color: #333;
    font-weight: 600;
}

/* Selected Program Notice */
.sams-selected-program-notice {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.sams-selected-program-notice h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
}

.selected-program-info {
    background: rgba(255, 255, 255, 0.15);
    padding: 15px;
    border-radius: 6px;
    backdrop-filter: blur(10px);
}

.selected-program-info strong {
    display: block;
    font-size: 16px;
    margin-bottom: 8px;
}

.selected-program-info .course-code {
    color: #fff;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 8px;
}

/* Program Summary for Pre-selected Program */
.sams-program-summary {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.sams-program-summary h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
}

.program-summary-details {
    background: rgba(255, 255, 255, 0.15);
    padding: 15px;
    border-radius: 6px;
    backdrop-filter: blur(10px);
}

.program-summary-details strong {
    display: block;
    font-size: 16px;
    margin-bottom: 8px;
}

.program-summary-details .institute-name {
    color: #f0fff4;
    font-size: 14px;
    display: block;
    margin-bottom: 5px;
}

.program-summary-details .program-level {
    color: #e8f5e8;
    font-size: 13px;
    display: block;
    margin-bottom: 5px;
}

.program-summary-details .course-code {
    color: #fff;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 8px;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

/* Nationality Exemption Note */
.nationality-exemption-note {
    margin-bottom: 20px;
}

.nationality-exemption-note .info-message {
    background: #e7f3ff;
    border: 1px solid #b8d4ed;
    border-radius: 6px;
    padding: 15px;
    color: #2c5aa0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nationality-exemption-note .info-icon {
    font-size: 18px;
    flex-shrink: 0;
}