/**
 * UIU Survey System - Survey Form Styles
 * Mobile-first responsive design
 */

/* Survey Container */
.survey-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 15px;
}

/* Survey Header */
.survey-header {
    text-align: center;
    margin-bottom: 30px;
}

.survey-header h1 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.survey-header p {
    color: var(--text-light);
    font-size: 0.9375rem;
}

/* Statement block (per-program intro) */
.survey-statement {
    background: var(--bg-white);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 18px 22px;
    margin-bottom: 25px;
}

.survey-statement h2 {
    font-size: 1.125rem;
    margin: 0 0 8px 0;
    color: var(--primary-color);
}

.survey-statement p {
    margin: 0 0 8px 0;
    line-height: 1.55;
    color: var(--text-color, #333);
    font-size: 0.95rem;
}

.survey-statement p:last-child {
    margin-bottom: 0;
}

/* Closing thank-you note */
.survey-thanks {
    text-align: center;
    margin: 30px 0 20px 0;
}

.survey-thanks p {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
    letter-spacing: 0.3px;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 30px;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--success-color));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Survey Sections */
.survey-section {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    overflow: hidden;
}

.section-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: 15px 20px;
}

.section-header h2 {
    color: white;
    font-size: 1.125rem;
    margin: 0;
}

.section-header p {
    font-size: 0.875rem;
    opacity: 0.9;
    margin: 5px 0 0 0;
}

.section-body {
    padding: 20px;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-color);
    font-size: 0.9375rem;
}

.form-label .required {
    color: var(--error-color);
    margin-left: 4px;
}

.form-hint {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Form Inputs */
.form-control {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-white);
    color: var(--text-color);
    transition: var(--transition);
    min-height: 44px;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.form-control:disabled {
    background: var(--bg-color);
    cursor: not-allowed;
}

.form-control.is-invalid {
    border-color: var(--error-color);
}

.form-control.is-valid {
    border-color: var(--success-color);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* Input Row (for side-by-side inputs) */
.input-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

/* Location Dropdowns */
.location-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

/* Radio & Checkbox Groups */
.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-item,
.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 15px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.radio-item:hover,
.checkbox-item:hover {
    background: #e5e7eb;
}

.radio-item.selected,
.checkbox-item.selected {
    background: #fef3c7;
    border-color: var(--secondary-color);
}

.radio-item input[type="radio"],
.checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.radio-label,
.checkbox-label {
    font-size: 0.9375rem;
    line-height: 1.4;
    cursor: pointer;
}

/* Likert Scale */
.likert-group {
    margin-bottom: 20px;
}

.likert-question {
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text-color);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.likert-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.likert-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.likert-option:hover {
    background: #e5e7eb;
}

.likert-option.selected {
    background: #fef3c7;
    border-color: var(--secondary-color);
}

.likert-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.likert-option label {
    cursor: pointer;
    font-size: 0.875rem;
}

/* Rating Scale */
.rating-group {
    margin-bottom: 20px;
}

.rating-question {
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text-color);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.rating-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rating-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.rating-option:hover {
    background: #e5e7eb;
}

.rating-option.selected {
    background: #d1fae5;
    border-color: var(--success-color);
}

.rating-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.rating-option label {
    cursor: pointer;
    font-size: 0.875rem;
}

/* Other Option with Text */
.other-option {
    margin-top: 10px;
}

.other-text {
    margin-top: 10px;
    display: none;
}

.other-text.show {
    display: block;
}

/* Form Actions */
.form-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.form-actions .btn {
    width: 100%;
}

/* Validation Messages */
.invalid-feedback {
    display: none;
    color: var(--error-color);
    font-size: 0.8125rem;
    margin-top: 5px;
}

.form-control.is-invalid + .invalid-feedback,
.was-validated .form-control:invalid + .invalid-feedback {
    display: block;
}

/* Question Numbers */
.question-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--secondary-color);
    color: white;
    border-radius: 50%;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-right: 10px;
    flex-shrink: 0;
}

/* Survey Divider */
.survey-divider {
    height: 1px;
    background: var(--border-color);
    margin: 20px 0;
}

/* Thank You Page */
.thankyou-container {
    text-align: center;
    padding: 60px 20px;
    max-width: 600px;
    margin: 0 auto;
}

.thankyou-icon {
    width: 80px;
    height: 80px;
    background: #d1fae5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
}

.thankyou-icon svg {
    width: 40px;
    height: 40px;
    color: var(--success-color);
}

.thankyou-container h1 {
    font-size: 1.75rem;
    margin-bottom: 15px;
    color: var(--success-color);
}

.thankyou-container p {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 25px;
}

/* Error Messages */
.form-errors {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: var(--border-radius);
    padding: 15px 20px;
    margin-bottom: 20px;
}

.form-errors h4 {
    color: #991b1b;
    font-size: 0.9375rem;
    margin-bottom: 10px;
}

.form-errors ul {
    color: #991b1b;
    font-size: 0.875rem;
    padding-left: 20px;
    margin: 0;
}

.form-errors li {
    margin-bottom: 5px;
}

/* Responsive - Tablet */
@media (min-width: 576px) {
    .input-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .location-group {
        grid-template-columns: repeat(3, 1fr);
    }

    .likert-options,
    .rating-options {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .likert-option,
    .rating-option {
        flex: 1;
        min-width: calc(50% - 4px);
        text-align: center;
        flex-direction: column;
        padding: 15px 10px;
    }

    .likert-option label,
    .rating-option label {
        font-size: 0.8125rem;
    }
}

@media (min-width: 768px) {
    .survey-container {
        padding: 30px 20px;
    }

    .survey-header h1 {
        font-size: 1.75rem;
    }

    .section-header h2 {
        font-size: 1.25rem;
    }

    .section-body {
        padding: 25px;
    }

    .form-actions {
        flex-direction: row;
        justify-content: flex-end;
    }

    .form-actions .btn {
        width: auto;
    }

    .likert-option,
    .rating-option {
        min-width: calc(20% - 8px);
    }
}

@media (min-width: 992px) {
    .radio-group.horizontal,
    .checkbox-group.horizontal {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .radio-group.horizontal .radio-item,
    .checkbox-group.horizontal .checkbox-item {
        flex: 1;
        min-width: 150px;
    }
}

/* Print Styles */
@media print {
    .survey-section {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .form-actions,
    .progress-container {
        display: none;
    }

    .form-control {
        border: 1px solid #ddd;
    }

    .radio-item,
    .checkbox-item,
    .likert-option,
    .rating-option {
        background: none;
        border: 1px solid #ddd;
    }
}
