/**
 * PEDS Dissertation Survey Styles
 */

.dissertation-survey-wrapper {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.dissertation-survey-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

/* Progress Indicator */
.survey-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    padding: 0;
    list-style: none;
    position: relative;
}

.survey-progress::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.survey-progress li {
    position: relative;
    z-index: 1;
    text-align: center;
    flex: 1;
}

.survey-progress .step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.survey-progress li.completed .step-number {
    background: #28a745;
    color: #fff;
}

.survey-progress li.active .step-number {
    background: #007bff;
    color: #fff;
    transform: scale(1.1);
}

.survey-progress .step-label {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

.survey-progress li.active .step-label {
    color: #007bff;
    font-weight: 600;
}

.survey-progress li.completed .step-label {
    color: #28a745;
}

/* Survey Header */
.survey-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.survey-header h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 10px;
}

.survey-header p {
    color: #666;
    font-size: 16px;
}

/* Survey Content */
.survey-content {
    margin-bottom: 30px;
}

.survey-section-title {
    font-size: 20px;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
}

/* Consent Form */
.consent-text {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 6px;
    margin-bottom: 30px;
    max-height: 400px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.8;
}

.consent-text h2 {
    font-size: 18px;
    margin-bottom: 15px;
}

.consent-text p {
    margin-bottom: 15px;
}

.consent-text strong {
    color: #333;
}

/* Form Elements */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.form-group label.required::after {
    content: ' *';
    color: #dc3545;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Radio and Checkbox Groups */
.radio-group,
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 10px;
}

.radio-option,
.checkbox-option {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.radio-option input[type="radio"],
.checkbox-option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 50%;
    margin-right: 10px;
    cursor: pointer;
    position: relative;
    top: 0;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.radio-option input[type="radio"]:checked {
    border-color: #007bff;
    background-color: #007bff;
}

.radio-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
}

.radio-option input[type="radio"]:hover,
.checkbox-option input[type="checkbox"]:hover {
    border-color: #007bff;
}

.radio-option label,
.checkbox-option label {
    display: inline;
    cursor: pointer;
    font-weight: 400;
    margin: 0;
    margin-bottom: 0;
    line-height: 1.4;
}

.form-group .radio-group label,
.form-group .checkbox-group label {
    display: inline;
    margin-bottom: 0;
}

/* Likert Scale */
.likert-scale {
    margin-top: 10px;
}

.likert-question {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.likert-question .question-text {
    font-weight: 500;
    margin-bottom: 15px;
    color: #333;
}

.likert-options {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.likert-option {
    flex: 1;
    text-align: center;
}

.likert-option input {
    display: none;
}

.likert-option label {
    display: block;
    padding: 12px 8px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
}

.likert-option input:checked + label {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
}

.likert-option label:hover {
    border-color: #007bff;
}

/* Survey Navigation */
.survey-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.btn {
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    border: none;
}

.btn-primary {
    background: #007bff;
    color: #fff;
}

.btn-primary:hover {
    background: #0056b3;
}

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

.btn-secondary:hover {
    background: #545b62;
}

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

.btn-success:hover {
    background: #1e7e34;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background: #bd2130;
}

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

/* Consent Options */
.consent-options {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.consent-option {
    flex: 1;
    max-width: 200px;
}

.consent-option input {
    display: none;
}

.consent-option label {
    display: block;
    padding: 15px 30px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.consent-option input[value="yes"] + label:hover,
.consent-option input[value="yes"]:checked + label {
    background: #28a745;
    border-color: #28a745;
    color: #fff;
}

.consent-option input[value="no"] + label:hover,
.consent-option input[value="no"]:checked + label {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

/* Participant Info Form */
.participant-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.participant-info .form-group.full-width {
    grid-column: span 2;
}

/* Conditional Fields */
.conditional-fields {
    display: none;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin-top: 15px;
}

.conditional-fields.visible {
    display: block;
}

/* Training Access */
.training-access {
    text-align: center;
    padding: 40px;
}

.training-access h2 {
    margin-bottom: 20px;
}

.training-access p {
    margin-bottom: 30px;
    color: #666;
}

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

/* Completion Screen */
.survey-complete {
    text-align: center;
    padding: 60px 40px;
}

.survey-complete .checkmark {
    width: 80px;
    height: 80px;
    background: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
}

.survey-complete .checkmark svg {
    width: 40px;
    height: 40px;
    fill: #fff;
}

.survey-complete h2 {
    font-size: 28px;
    margin-bottom: 15px;
}

.survey-complete p {
    color: #666;
    font-size: 16px;
    max-width: 500px;
    margin: 0 auto;
}

/* Loading State */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

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

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error Messages */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: none;
}

.error-message.visible {
    display: block;
}

/* Success Messages */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: none;
}

.success-message.visible {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .dissertation-survey-container {
        padding: 20px;
    }

    .participant-info {
        grid-template-columns: 1fr;
    }

    .participant-info .form-group.full-width {
        grid-column: span 1;
    }

    .likert-options {
        flex-direction: column;
    }

    .survey-progress .step-label {
        display: none;
    }

    .consent-options {
        flex-direction: column;
        align-items: center;
    }

    .consent-option {
        max-width: 100%;
        width: 100%;
    }
}

/* Section Headers for IMI */
.section-category {
    font-size: 14px;
    color: #007bff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* Anonymous Note */
.anonymous-note {
    background: #fff3cd;
    color: #856404;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.anonymous-note strong {
    display: block;
    margin-bottom: 5px;
}
