/**
 * Dynamic Form Renderer Styles
 * Styles for participant application forms
 */

/* Container */
.application-form-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Header */
.application-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.application-header h2 {
    margin: 0 0 10px 0;
    color: #1F437B;
    font-size: 24px;
}

.programme-description {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Quill content styling in programme description */
.programme-description p {
    margin: 0 0 10px 0;
}

.programme-description ul,
.programme-description ol {
    margin: 0 0 10px 0;
    padding-left: 20px;
}

.programme-description li {
    margin-bottom: 4px;
}

.programme-description strong {
    font-weight: 600;
}

.programme-description h1,
.programme-description h2,
.programme-description h3 {
    color: #1F437B;
    margin: 16px 0 8px 0;
}

.programme-description h1 {
    font-size: 20px;
}

.programme-description h2 {
    font-size: 18px;
}

.programme-description h3 {
    font-size: 16px;
}

.programme-description a {
    color: #1F437B;
    text-decoration: underline;
}

.header-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-draft {
    background: #ffc107;
    color: #856404;
}

.status-submitted {
    background: #28a745;
    color: #fff;
}

.status-under-review {
    background: #17a2b8;
    color: #fff;
}

.status-accepted {
    background: #28a745;
    color: #fff;
}

.status-rejected {
    background: #dc3545;
    color: #fff;
}

.last-saved {
    font-size: 12px;
    color: #888;
}

/* Progress Indicator */
.form-progress {
    margin-bottom: 30px;
}

.progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1F437B, #67C7D1);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-sections {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 12px;
    color: #666;
}

/* Alerts */
.form-alerts {
    margin-bottom: 20px;
}

.alert {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
    padding: 0 5px;
}

.alert-close:hover {
    opacity: 1;
}

/* Form Sections */
.form-section {
    display: none;
}

.form-section.active {
    display: block;
}

.section-title {
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
    color: #1F437B;
    font-size: 20px;
}

/* Form Fields */
.form-fields-container {
    min-height: 200px;
}

.form-field {
    margin-bottom: 25px;
}

.form-field.has-error .field-label {
    color: #dc3545;
}

.form-field.has-error .form-input,
.form-field.has-error .form-select,
.form-field.has-error .form-textarea {
    border-color: #dc3545;
}

.field-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.required-indicator {
    color: #dc3545;
    margin-left: 3px;
}

.field-help {
    margin-top: 6px;
    font-size: 12px;
    color: #888;
    line-height: 1.4;
}

.field-error {
    margin-top: 6px;
    font-size: 12px;
    color: #dc3545;
    min-height: 18px;
}

/* Input Styles */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #1F437B;
    box-shadow: 0 0 0 3px rgba(31, 67, 123, 0.1);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
    background: #f8f9fa;
    cursor: not-allowed;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Input Groups */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-prefix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: #e9ecef;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 6px 0 0 6px;
    font-size: 14px;
    color: #666;
}

.input-group .form-input {
    border-radius: 0 6px 6px 0;
}

/* Radio & Checkbox Groups */
.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-item,
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    transition: background 0.2s, border-color 0.2s;
}

.radio-item:hover,
.checkbox-item:hover {
    background: #f8f9fa;
    border-color: #1F437B;
}

.radio-item input,
.checkbox-item input {
    margin: 0;
    cursor: pointer;
}

/* Name & Contact Fields */
.name-fields,
.contact-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 576px) {
    .name-fields,
    .contact-fields {
        grid-template-columns: 1fr;
    }
}

/* Rating Scales */
.rating-scale,
.nps-scale {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rating-item,
.nps-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 40px;
}

.rating-item:hover,
.nps-item:hover {
    background: #f8f9fa;
    border-color: #1F437B;
}

.rating-item input,
.nps-item input {
    margin-bottom: 4px;
}

.nps-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 10px;
    font-size: 12px;
    color: #888;
}

/* Star Rating */
.star-rating {
    display: flex;
    gap: 5px;
    font-size: 24px;
}

.star-rating .star {
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
}

.star-rating .star:hover,
.star-rating .star.filled {
    color: #ffc107;
}

/* Slider */
.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.form-slider {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    background: #e9ecef;
    border-radius: 4px;
    outline: none;
}

.form-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #1F437B;
    border-radius: 50%;
    cursor: pointer;
}

.slider-value {
    font-weight: 600;
    color: #1F437B;
    min-width: 30px;
    text-align: center;
}

/* File Upload */
.file-upload-container {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
}

.file-upload-container:hover {
    border-color: #1F437B;
    background: #f8f9fa;
}

.file-upload-area {
    cursor: pointer;
    padding: 20px;
}

.file-upload-area i {
    font-size: 40px;
    color: #ccc;
    margin-bottom: 10px;
}

.file-upload-area span {
    display: block;
    color: #666;
    font-size: 14px;
}

.uploaded-files {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.uploaded-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #e9ecef;
    border-radius: 4px;
    font-size: 13px;
}

.uploaded-file i {
    color: #1F437B;
}

.uploaded-file .remove-file {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    margin-left: 5px;
}

.uploaded-file .remove-file:hover {
    color: #a71d2a;
}

/* Signature Field */
.signature-field {
    font-family: 'Brush Script MT', cursive;
    font-size: 20px;
    text-align: center;
}

/* Heading & Page Break */
.field-heading {
    font-size: 18px;
    font-weight: 600;
    color: #1F437B;
    margin: 10px 0;
}

.page-break {
    border: none;
    border-top: 2px dashed #e9ecef;
    margin: 30px 0;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.actions-left,
.actions-right {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn i {
    font-size: 14px;
}

.btn-primary {
    background: #1F437B;
    color: #fff;
}

.btn-primary:hover {
    background: #163157;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: #fff;
}

.btn-success:hover {
    background: #218838;
}

.btn-outline {
    background: transparent;
    border: 1px solid #ddd;
    color: #333;
}

.btn-outline:hover {
    background: #f8f9fa;
    border-color: #1F437B;
}

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

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e9ecef;
    border-top-color: #1F437B;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-spinner p {
    margin-top: 15px;
    color: #666;
}

.error-text {
    color: #dc3545;
}

.error-text i {
    margin-right: 5px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
    animation: modalSlideIn 0.3s ease;
}

.modal-small {
    max-width: 400px;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
    padding: 0;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
}

/* File Drop Zone */
.file-drop-zone {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: #1F437B;
    background: #f8f9fa;
}

.file-drop-zone i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 15px;
}

.file-drop-zone p {
    margin: 0;
    color: #666;
}

.file-preview {
    margin-top: 15px;
}

.upload-progress {
    margin-top: 15px;
}

.upload-progress .progress-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
}

.upload-progress .progress-fill {
    background: #28a745;
}

#upload-progress-text {
    display: block;
    text-align: center;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .application-form-container {
        padding: 15px;
        border-radius: 0;
        box-shadow: none;
    }

    .application-header {
        flex-direction: column;
        gap: 15px;
    }

    .header-actions {
        align-items: flex-start;
    }

    .form-actions {
        flex-direction: column;
        gap: 15px;
    }

    .actions-left,
    .actions-right {
        width: 100%;
        justify-content: center;
    }

    .btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .radio-item,
    .checkbox-item {
        padding: 10px;
    }

    .nps-scale {
        justify-content: center;
    }

    .nps-item {
        min-width: 35px;
        padding: 6px 8px;
    }
}

/* Print Styles */
@media print {
    .application-form-container {
        box-shadow: none;
        max-width: 100%;
    }

    .form-actions,
    .header-actions {
        display: none;
    }

    .form-section {
        display: block !important;
        page-break-inside: avoid;
    }

    .form-field {
        page-break-inside: avoid;
    }
}