/**
 * SAFE Framework Survey Plugin - Public Styles
 * Modern, clean design based on provided mockups
 */

/* Reset and base styles */
#safe-survey-container * {
    box-sizing: border-box;
}

#safe-survey-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

/* Survey Header */
.survey-header {
    text-align: center;
    margin-bottom: 48px;
    padding: 48px 40px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    color: #2c3e50;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8ecef;
    overflow: hidden;
}

.survey-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #06b6d4 100%);
}

.survey-title {
    font-size: 2.6em;
    font-weight: 800;
    margin-bottom: 20px;
    color: #1a202c;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #1a202c 0%, #4a5568 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.survey-description {
    font-size: 1.15em;
    margin-bottom: 40px;
    color: #718096;
    line-height: 1.7;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
}

/* Progress Container */
.progress-container {
    max-width: 400px;
    margin: 0 auto;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.progress-text {
    text-align: center;
    font-size: 0.9em;
    font-weight: 600;
    color: #4a5568;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    border: 4px solid rgba(0, 115, 170, 0.2);
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.loading-spinner p {
    font-size: 1.1em;
    color: #666;
    margin: 0;
}

/* Survey Content */
.survey-content {
    min-height: 500px;
    margin-bottom: 32px;
}

.step-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 56px 72px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8ecef;
    min-height: 550px;
    position: relative;
    overflow: hidden;
}

.step-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #06b6d4 100%);
}

.step-header {
    margin-bottom: 48px;
    text-align: center;
    padding-bottom: 40px;
    border-bottom: 2px solid #e8ecef;
    position: relative;
}

.step-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 2px;
}

.step-title {
    color: #1a202c;
    font-size: 2.2em;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.3;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #1a202c 0%, #4a5568 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.step-subtitle {
    color: #718096;
    font-size: 1.15em;
    margin: 0;
    line-height: 1.7;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
}

/* Form Fields - Enhanced Layout with 2-Column Support */
.form-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px 32px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: start;
}

/* Force single column for specific layouts */
.form-fields.single-column {
    display: flex;
    flex-direction: column;
    gap: 40px;
    max-width: 900px;
}

/* Special handling for substeps to maintain single column */
.substeps-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Specific handling for different question types in 2-column layout */
.form-group[data-question-type="textarea"],
.form-group[data-question-type="select"] {
    /* These might work better in single column on smaller screens */
    min-width: 100%;
}

@media (max-width: 950px) {

    .form-group[data-question-type="textarea"],
    .form-group[data-question-type="select"] {
        grid-column: 1 / -1;
        /* Span full width */
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    padding: 24px 20px;
    background: #ffffff;
    border: 2px solid #f1f5f9;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    height: fit-content;
}

.form-group:hover {
    border-color: #e2e8f0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.form-group:focus-within {
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1), 0 8px 25px rgba(79, 70, 229, 0.15);
    transform: translateY(-2px);
}

.form-group::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 20px 20px 0 0;
    transition: all 0.3s ease;
}

.form-group:focus-within::before {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.question-label {
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 20px;
    font-size: 1.1em;
    line-height: 1.4;
    text-align: left;
    letter-spacing: -0.01em;
}

.required {
    color: #e53e3e;
    margin-left: 4px;
}

.form-control {
    padding: 16px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1em;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    box-shadow: none;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: #ffffff;
}

.form-control.error {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

/* Radio and Checkbox Options */
.radio-option,
.checkbox-option {
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    position: relative;
}

.radio-option:hover,
.checkbox-option:hover {
    border-color: #cbd5e0;
    background-color: #f7fafc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.radio-option input:checked+label,
.checkbox-option input:checked+label {
    color: #2d3748;
    font-weight: 500;
}

.radio-option:has(input:checked),
.checkbox-option:has(input:checked) {
    border-color: #4f46e5;
    background-color: #f0f4ff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.radio-option input,
.checkbox-option input {
    margin: 4px 0 0 0;
    transform: scale(1.25);
    accent-color: #4f46e5;
}

.radio-option label,
.checkbox-option label {
    margin: 0;
    cursor: pointer;
    font-weight: normal;
    flex: 1;
    line-height: 1.5;
    color: #4a5568;
}

/* Range Slider - Enhanced Design */
.range-container {
    padding: 20px 16px;
    background: #ffffff;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    position: relative;
}

.form-range {
    width: 100%;
    height: 8px;
    margin-bottom: 24px;
    background: #e2e8f0;
    border-radius: 8px;
    outline: none;
    -webkit-appearance: none;
    position: relative;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 3px solid white;
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.form-range::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95em;
    color: #4a5568;
    font-weight: 500;
    margin-top: 16px;
}

.range-value {
    font-weight: 700;
    color: #4f46e5;
    font-size: 1.2em;
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid #4f46e5;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
    min-width: 60px;
    text-align: center;
}

/* Star Rating System - Compact Design */
.star-rating {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 16px 12px;
    background: #ffffff;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    margin: 12px 0;
    transition: all 0.2s ease;
    position: relative;
}

.star-rating:hover {
    border-color: #cbd5e0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.star-rating-wrapper {
    text-align: center;
    width: 100%;
}

.star-rating-label {
    display: block;
    font-size: 0.95em;
    color: #4a5568;
    font-weight: 500;
    margin-bottom: 16px;
    text-align: center;
}

.star {
    font-size: 2.2em;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: inline-block;
    line-height: 1;
    user-select: none;
    margin: 0 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    padding: 4px;
}

.star:before {
    content: '★';
    display: block;
}

.star.selected {
    color: #f6ad55;
    filter: drop-shadow(0 2px 8px rgba(246, 173, 85, 0.3));
    transform: scale(1.05);
}

.star.hover-active {
    color: #f6ad55;
    transform: scale(1.1);
}

.star-rating-input {
    display: none;
}

.star-rating-description {
    margin-top: 16px;
    font-size: 1em;
    color: #4f46e5;
    font-weight: 500;
    min-height: 24px;
    background: rgba(79, 70, 229, 0.08);
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid rgba(79, 70, 229, 0.15);
    display: inline-block;
    transition: all 0.2s ease;
}

.star-rating-description:empty {
    opacity: 0;
    transform: translateY(-5px);
}

.star-rating-description:not(:empty) {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive star rating */
@media (max-width: 768px) {
    .star {
        font-size: 1.8em;
        margin: 0 2px;
    }

    .star-rating {
        gap: 4px;
        padding: 16px 12px;
    }

    .star-rating-label {
        margin-bottom: 12px;
        font-size: 0.9em;
    }

    .star-rating-description {
        margin-top: 12px;
        padding: 10px 16px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .star {
        font-size: 1.6em;
        margin: 0 1px;
    }

    .star-rating {
        gap: 2px;
        padding: 12px 8px;
    }
}

/* Likert Scale - Enhanced Design for 0-5 Rating */
.likert-scale {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    padding: 20px 16px;
    background: #ffffff;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    flex-wrap: wrap;
    transition: all 0.2s ease;
}

.likert-scale:hover {
    border-color: #cbd5e0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.likert-option {
    text-align: center;
    padding: 16px 10px;
    border-radius: 10px;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    flex: 1;
    min-width: 70px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.likert-option:hover {
    border-color: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.15);
    background: #f0f4ff;
}

.likert-option.selected {
    border-color: #4f46e5;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);
}

.likert-option.selected .likert-number,
.likert-option.selected .likert-label {
    color: white;
}

.likert-option input {
    display: none;
}

.likert-option label {
    display: block;
    cursor: pointer;
    font-size: 1em;
    width: 100%;
    text-align: center;
}

.likert-number {
    display: block;
    font-weight: 800;
    color: #4f46e5;
    font-size: 2em;
    margin-bottom: 8px;
    line-height: 1;
}

.likert-label {
    display: block;
    color: #4a5568;
    font-size: 0.8em;
    line-height: 1.3;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive likert scale */
@media (max-width: 768px) {
    .likert-scale {
        gap: 6px;
        padding: 24px 16px;
    }

    .likert-option {
        padding: 16px 8px;
        min-width: 60px;
    }

    .likert-number {
        font-size: 1.6em;
    }

    .likert-label {
        font-size: 0.7em;
    }
}

@media (max-width: 480px) {
    .likert-scale {
        flex-direction: column;
        gap: 8px;
    }

    .likert-option {
        min-width: auto;
        flex-direction: row;
        padding: 12px 16px;
        text-align: left;
    }

    .likert-number {
        margin-bottom: 0;
        margin-right: 12px;
        font-size: 1.4em;
    }
}

/* Consent Container */
.consent-container {
    padding: 32px;
    background: #ffffff;
    border-radius: 16px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: relative;
}

.consent-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 16px 0 0 16px;
}

.consent-text {
    margin-bottom: 24px;
    line-height: 1.6;
    font-size: 1em;
    color: #2d3748;
}

.consent-checkbox {
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    background: #f7fafc;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    transition: all 0.2s ease;
}

.consent-checkbox:hover {
    border-color: #cbd5e0;
    background-color: #edf2f7;
}

.consent-checkbox input {
    margin-top: 2px;
    transform: scale(1.4);
    accent-color: #4f46e5;
}

.consent-checkbox label {
    font-weight: 600;
    color: #2d3748;
    cursor: pointer;
    line-height: 1.5;
    flex: 1;
}

.privacy-text {
    font-size: 0.9em;
    color: #718096;
    margin: 0;
    font-style: italic;
    line-height: 1.5;
}

/* Navigation Buttons */
.survey-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 32px 0;
    border-top: 1px solid #e8ecef;
    margin-top: 40px;
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 12px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.35);
}

.btn-secondary {
    background: #718096;
    color: white;
    box-shadow: 0 4px 14px rgba(113, 128, 150, 0.25);
}

.btn-secondary:hover {
    background: #4a5568;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(113, 128, 150, 0.35);
}

.btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(72, 187, 120, 0.25);
}

.btn-success:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.35);
}

.btn-outline {
    background: transparent;
    color: #4f46e5;
    border: 2px solid #4f46e5;
    box-shadow: none;
}

.btn-outline:hover {
    background: #4f46e5;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.25);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Hide Next button on step 6 (results page) */
#safe-survey-container[data-current-step="6"] #next-step {
    display: none !important;
}


/* Survey Messages */
.survey-messages {
    margin-top: 25px;
    padding: 16px 20px;
    border-radius: 8px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.survey-messages.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-left: 5px solid #28a745;
}

.survey-messages.success::before {
    content: '✓';
    font-size: 1.2em;
    font-weight: bold;
}

.survey-messages.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-left: 5px solid #dc3545;
}

.survey-messages.error::before {
    content: '⚠';
    font-size: 1.2em;
    font-weight: bold;
}

.survey-messages.info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border-left: 5px solid #17a2b8;
}

.survey-messages.info::before {
    content: 'ℹ';
    font-size: 1.2em;
    font-weight: bold;
}

/* Results Page Styles */
.results-content {
    background: white;
    padding: 48px;
    border-radius: 16px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8ecef;
}

.results-header {
    text-align: center;
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid #e8ecef;
    position: relative;
}

.results-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 2px;
}

.results-header h3 {
    color: #1a202c;
    font-size: 2.4em;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.results-header p {
    color: #718096;
    font-size: 1.1em;
    margin: 0;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.results-section {
    margin-bottom: 48px;
}

.results-section h4 {
    color: #1a202c;
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e8ecef;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.results-section h4::before {
    content: '';
    width: 4px;
    height: 32px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-radius: 2px;
}

.results-section h4::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 16px;
    width: 40px;
    height: 2px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-radius: 1px;
}

.summary-content {
    background: #ffffff;
    padding: 32px;
    border-radius: 16px;
    border-left: 4px solid #48bb78;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #e8ecef;
}

.summary-content p {
    margin: 0;
    font-size: 1.1em;
    line-height: 1.6;
    color: #2d3748;
}

/* Charts Container */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin: 32px 0;
}

.chart-item {
    text-align: center;
    background: white;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8ecef;
    transition: all 0.2s ease;
}

.chart-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.chart-item h5 {
    margin-bottom: 24px;
    color: #1a202c;
    font-size: 1.2em;
    font-weight: 700;
}

.chart-item canvas {
    max-height: 300px;
}

/* Course Cards */
.courses-container {
    display: grid;
    gap: 24px;
}

.course-card {
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 32px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.course-card:hover {
    border-color: #4f46e5;
    box-shadow: 0 12px 35px rgba(79, 70, 229, 0.15);
    transform: translateY(-4px);
}

.course-card:hover::before {
    transform: translateX(0);
}

.course-title {
    color: #1a202c;
    margin-bottom: 16px;
    font-size: 1.3em;
    font-weight: 700;
    line-height: 1.4;
}

.course-excerpt {
    color: #f3f4f5;
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 1em;
}

.recommendation-reason {
    color: #4f46e5;
    font-size: 0.95em;
    margin-bottom: 24px;
    font-style: italic;
    background: rgba(79, 70, 229, 0.1);
    padding: 16px 20px;
    border-radius: 12px;
    border-left: 4px solid #4f46e5;
    line-height: 1.5;
}

.course-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.recommendation-score {
    font-size: 0.9em;
    color: #48bb78;
    font-weight: 700;
    background: rgba(72, 187, 120, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(72, 187, 120, 0.3);
}

/* Form Error States */
.form-group.error .question-label {
    color: #e74c3c;
}

.form-group.error .form-control {
    border-color: #e74c3c;
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1);
}

/* Error Content Styles */
.error-content {
    background: #fff5f5;
    border: 2px solid #fed7d7;
    border-left: 4px solid #e53e3e;
    border-radius: 16px;
}

.error-content .step-title {
    color: #e53e3e;
}

.error-content .step-subtitle {
    color: #c53030;
}

.error-details {
    text-align: left;
    padding: 24px;
    background: white;
    border-radius: 12px;
    margin-top: 24px;
    border: 1px solid #fed7d7;
}

.error-details p {
    margin-bottom: 16px;
    line-height: 1.6;
    color: #2d3748;
}

.error-details ul,
.error-details ol {
    margin: 16px 0 16px 24px;
    color: #4a5568;
}

.error-details li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.error-details strong {
    color: #e53e3e;
    font-weight: 600;
}

/* Completion Content */
.completion-content {
    text-align: center;
    padding: 48px 24px;
}

.completion-content p {
    font-size: 1.1em;
    color: #718096;
    margin-bottom: 32px;
    line-height: 1.6;
}

.completion-summary {
    background: #ffffff;
    padding: 32px;
    border-radius: 16px;
    border: 2px solid #e2e8f0;
    margin: 32px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.completion-summary h4 {
    color: #1a202c;
    margin-bottom: 24px;
    font-size: 1.4em;
    font-weight: 700;
}

.completion-summary ul {
    text-align: left;
    list-style: none;
    padding: 0;
    margin: 0;
}

.completion-summary li {
    padding: 12px 0;
    font-size: 1em;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.5;
}

.completion-summary li::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #48bb78;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Medium screens - maintain 2 columns with smaller min-width */
@media (max-width: 1024px) and (min-width: 769px) {
    .form-fields {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 20px 24px;
    }

    .form-group {
        padding: 20px 16px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    #safe-survey-container {
        padding: 16px;
        margin: 0;
        max-width: 100%;
    }

    .survey-header {
        padding: 32px 24px;
    }

    .survey-title {
        font-size: 2em;
    }

    .survey-description {
        font-size: 1em;
    }

    .step-content {
        padding: 32px 24px;
        min-height: auto;
    }

    .step-title {
        font-size: 1.6em;
    }

    .form-fields {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .survey-navigation {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .btn {
        justify-content: center;
        min-width: 100%;
        padding: 16px 24px;
    }

    .charts-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .likert-scale {
        flex-direction: column;
        gap: 12px;
    }

    .likert-option {
        display: flex;
        align-items: center;
        gap: 15px;
        text-align: left;
        padding: 15px;
        min-width: auto;
    }

    .likert-number {
        font-size: 1.5em;
        margin-bottom: 0;
        flex-shrink: 0;
        width: 40px;
        text-align: center;
    }

    .likert-label {
        flex: 1;
    }

    .course-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .course-actions .btn {
        min-width: 100%;
    }

    .recommendation-score {
        text-align: center;
    }

    .range-container {
        padding: 20px 15px;
    }

    .range-value {
        font-size: 1.2em;
        padding: 6px 16px;
        min-width: 60px;
    }
}

@media (max-width: 480px) {
    .survey-title {
        font-size: 1.8em;
    }

    .step-title {
        font-size: 1.4em;
    }

    .btn {
        padding: 16px 20px;
        font-size: 1em;
    }

    .form-control {
        padding: 14px 16px;
    }

    .results-header h3 {
        font-size: 2em;
    }

    .results-header p {
        font-size: 1em;
    }

    .chart-item {
        padding: 24px 20px;
    }

    .course-card {
        padding: 24px;
    }

    .consent-container {
        padding: 24px;
    }

    .star {
        font-size: 2em;
        margin: 0 1px;
    }

    .star-rating {
        padding: 20px;
        gap: 2px;
    }
}

/* Print Styles */
@media print {

    /* Force browsers to print background colors and images */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    /* Container adjustments for print */
    #safe-survey-container {
        max-width: 100%;
        padding: 20px;
        background: white;
    }

    /* Preserve header styling with colors */
    .survey-header {
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
        box-shadow: none;
        page-break-after: avoid;
        border: 1px solid #e8ecef;
        margin-bottom: 30px;
    }

    .survey-header::before {
        background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #06b6d4 100%) !important;
    }

    .survey-title {
        background: linear-gradient(135deg, #1a202c 0%, #4a5568 100%) !important;
        -webkit-background-clip: text !important;
        -webkit-text-fill-color: transparent !important;
        background-clip: text !important;
    }

    /* Hide navigation buttons and unnecessary elements */
    .btn,
    .survey-navigation,
    .loading-spinner,
    .action-buttons {
        display: none !important;
    }

    /* Results dashboard styling */
    .results-dashboard {
        page-break-inside: avoid;
    }

    .results-header {
        page-break-after: avoid;
        margin-bottom: 30px;
    }

    /* Preserve SAFE scores section with colors */
    .safe-scores-section {
        page-break-inside: avoid;
        margin-bottom: 40px;
    }

    .score-cards-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        page-break-inside: avoid;
    }

    .safe-score-card {
        background: white !important;
        border: 2px solid #e2e8f0 !important;
        border-radius: 12px;
        padding: 20px;
        page-break-inside: avoid;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    }

    /* Preserve score card colors */
    .score-label {
        font-weight: 600 !important;
    }

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

    .progress-bar>div {
        height: 100%;
        border-radius: 4px;
    }

    /* Chart section */
    .chart-section {
        page-break-inside: avoid;
        margin: 40px 0;
        background: white;
        padding: 20px;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
    }

    .chart-container {
        max-width: 100%;
        height: auto !important;
        page-break-inside: avoid;
    }

    #safeScoresChart {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Recommendations section with colors */
    .recommendations-section {
        page-break-inside: avoid;
        margin-top: 40px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        padding: 30px;
        border-radius: 16px;
        color: white !important;
    }

    .recommendations-section .section-title {
        color: white !important;
    }

    .recommendations-content {
        background: rgba(255, 255, 255, 0.95) !important;
        padding: 20px;
        border-radius: 12px;
    }

    .recommendation-item {
        page-break-inside: avoid;
        margin-bottom: 15px;
        padding: 15px;
        background: white !important;
        border: 2px solid #e2e8f0 !important;
        border-radius: 8px;
    }

    .course-link {
        color: #4f46e5 !important;
        text-decoration: none;
        font-weight: 600;
    }

    .course-icon {
        display: inline-block;
        margin-right: 8px;
    }

    .course-excerpt {
        color: #4a5568 !important;
        margin-top: 8px;
        font-size: 0.9em;
    }

    /* Section titles */
    .section-title {
        page-break-after: avoid;
        margin-bottom: 20px;
        color: #1a202c !important;
        font-size: 1.5em;
        font-weight: 700;
    }

    .results-title {
        color: #1a202c !important;
        font-size: 2em;
        font-weight: 800;
        margin-bottom: 10px;
    }

    .results-subtitle {
        color: #718096 !important;
        font-size: 1.1em;
    }

    /* Domain names and scores */
    .domain-name {
        color: #1a202c !important;
        font-weight: 700;
        font-size: 1.1em;
    }

    .score-number {
        color: #4f46e5 !important;
        font-weight: 800;
        font-size: 2em;
    }

    .score-max {
        color: #718096 !important;
    }

    .score-description {
        color: #4a5568 !important;
        font-size: 0.9em;
        margin-top: 8px;
    }

    /* Page break controls */
    .step-content,
    .results-content {
        page-break-inside: avoid;
        box-shadow: none;
    }

    /* Ensure proper spacing */
    h2,
    h3,
    h4 {
        page-break-after: avoid;
    }

    /* Hide WordPress admin bar if present */
    #wpadminbar {
        display: none !important;
    }

    /* Optimize for print */
    body {
        background: white !important;
    }

    /* Ensure charts print properly */
    canvas {
        max-width: 100% !important;
        height: auto !important;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .spinner {
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-control {
        border-width: 3px;
    }

    .btn {
        border: 3px solid currentColor;
    }

    .survey-messages {
        border-width: 3px;
    }
}

/* Focus indicators */
.btn:focus-visible,
.form-control:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #0073aa;
    outline-offset: 2px;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

.loading-content .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
}

.loading-content p {
    color: #718096;
    font-size: 1.1em;
    margin: 0;
}

/* Select Dropdown Styling */
select.form-control {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="%234a5568" viewBox="0 0 16 16"><path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px;
    padding-right: 48px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Textarea Styling */
textarea.form-control {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
    line-height: 1.5;
}

/* Focus States Enhancement */
.radio-option:focus-within,
.checkbox-option:focus-within {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.consent-checkbox:focus-within {
    border-color: #4f46e5;
    background-color: #f0f4ff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Animation Utilities */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

/* Modern Step Progress Indicator */
.step-progress-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    padding: 0 20px;
}

.step-progress {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
    max-width: 800px;
    width: 100%;
}

.step-item {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex: 1;
    min-height: 40px;
    background: #e2e8f0;
    color: #718096;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 0 100%, 15px 50%);
    transition: all 0.3s ease;
    z-index: 1;
}

.step-item:first-child {
    clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 0 100%);
    padding-left: 16px;
}

.step-item:last-child {
    clip-path: polygon(15px 0, 100% 0, 100% 100%, 0 100%, 15px 50%);
    padding-right: 16px;
}

.step-item.active {
    background: #4f46e5;
    color: white;
    z-index: 2;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.step-item.completed {
    background: #48bb78;
    color: white;
    z-index: 2;
}

.step-item.future {
    background: #f1f5f9;
    color: #a0aec0;
}

/* Sub-step progress for Step 4 */
.substep-progress-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 20px;
}

.substep-progress {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
    max-width: 600px;
    width: 100%;
}

.substep-item {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex: 1;
    min-height: 32px;
    background: #f1f5f9;
    color: #718096;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
    transition: all 0.3s ease;
    z-index: 1;
}

.substep-item:first-child {
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
    padding-left: 12px;
}

.substep-item:last-child {
    clip-path: polygon(12px 0, 100% 0, 100% 100%, 0 100%, 12px 50%);
    padding-right: 12px;
}

.substep-item.active {
    background: #4f46e5;
    color: white;
    z-index: 2;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.substep-item.completed {
    background: #48bb78;
    color: white;
    z-index: 2;
}

.substep-item.future {
    background: #f8fafc;
    color: #cbd5e0;
}

/* Responsive adjustments */
@media (max-width: 768px) {

    .step-item,
    .substep-item {
        font-size: 0.7rem;
        min-height: 32px;
        letter-spacing: 0.2px;
    }

    .step-item {
        clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%);
    }

    .step-item:first-child {
        clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);
        padding-left: 12px;
    }

    .step-item:last-child {
        clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 10px 50%);
        padding-right: 12px;
    }

    .substep-item {
        clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%);
    }

    .substep-item:first-child {
        clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%);
        padding-left: 8px;
    }

    .substep-item:last-child {
        clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 8px 50%);
        padding-right: 8px;
    }
}

/* Results Dashboard Styles */
.results-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.results-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f2f5;
}

.results-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 12px;
    line-height: 1.2;
}

.results-subtitle {
    font-size: 1.25rem;
    color: #6c757d;
    margin-bottom: 0;
    line-height: 1.4;
}

/* Recommendations Section */
.recommendations-section {
    margin-bottom: 50px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
}

.recommendations-section .section-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: white;
}

.recommendations-content {
    display: grid;
    gap: 12px;
}

.recommendation-item {
    background: rgba(255, 255, 255, 0.15);
    padding: 16px 20px;
    border-radius: 8px;
    font-size: 1.1rem;
    line-height: 1.5;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* SAFE Scores Section */
.safe-scores-section {
    margin-bottom: 40px;
}

.safe-scores-section .section-title {
    font-size: 2rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
}

.score-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.safe-score-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-left: 4px solid #e0e6ed;
}

.safe-score-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.score-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.domain-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    line-height: 1.3;
    flex: 1;
    margin-right: 16px;
}

.score-display {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.score-number {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
}

.score-max {
    font-size: 1.2rem;
    color: #6c757d;
    font-weight: 500;
}

.score-label {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.score-description {
    font-size: 0.95rem;
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 16px;
}

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

.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Chart Section */
.chart-section {
    margin-bottom: 40px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
}

.chart-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

.chart-container {
    position: relative;
    height: 400px;
    margin: 0 auto;
    max-width: 800px;
}

/* Scale Legend */
.scale-legend {
    margin-bottom: 40px;
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.legend-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 16px;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.legend-item {
    font-size: 0.9rem;
    color: #6c757d;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 40px;
}

.action-buttons .btn {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
}

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

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-2px);
}

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

.btn-success:hover {
    background: #1e7e34;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .results-dashboard {
        padding: 20px 16px;
    }

    .results-title {
        font-size: 2rem;
    }

    .results-subtitle {
        font-size: 1.1rem;
    }

    .score-cards-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .safe-score-card {
        padding: 20px;
    }

    .domain-name {
        font-size: 1.1rem;
    }

    .score-number {
        font-size: 1.75rem;
    }

    .chart-container {
        height: 300px;
    }

    .action-buttons {
        flex-direction: column;
        align-items: center;
    }

    .action-buttons .btn {
        width: 100%;
        max-width: 300px;
    }

    .legend-items {
        gap: 8px;
    }

    .legend-item {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
}

/* Step 4 Sub-steps Styling */
.step-4-with-substeps,
.step-4-substep {
    max-width: 1200px;
    margin: 0 auto;
}

.step-4-substep .sub-step-title {
    color: #4f46e5;
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
}

.substeps-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.sub-step-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 2px solid #e8ecef;
    position: relative;
    overflow: hidden;
}

.sub-step-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #06b6d4 100%);
}

.sub-step-section[data-sub-step="a"]::before {
    background: linear-gradient(135deg, #ff8c42 0%, #ff6b35 100%);
    /* Sustained Leadership */
}

.sub-step-section[data-sub-step="b"]::before {
    background: linear-gradient(135deg, #4a90e2 0%, #357ae8 100%);
    /* Adult Self-Regulation */
}

.sub-step-section[data-sub-step="c"]::before {
    background: linear-gradient(135deg, #b83dba 0%, #a621a8 100%);
    /* Foster Community */
}

.sub-step-section[data-sub-step="d"]::before {
    background: linear-gradient(135deg, #27ae60 0%, #219a52 100%);
    /* Engaged Classrooms */
}

.sub-step-header {
    margin-bottom: 24px;
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #e8ecef;
}

.sub-step-title {
    font-size: 1.5em;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.sub-step-description {
    font-size: 1em;
    color: #718096;
    margin: 0;
    line-height: 1.5;
}

.sub-step-questions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sub-step-questions .form-group {
    margin-bottom: 0;
}

/* Responsive for sub-steps */
@media (max-width: 768px) {
    .step-4-with-substeps {
        max-width: 100%;
    }

    .substeps-container {
        gap: 24px;
    }

    .sub-step-section {
        padding: 20px;
        border-radius: 12px;
    }

    .sub-step-title {
        font-size: 1.3em;
    }

    .sub-step-questions {
        gap: 16px;
    }
}

/* Action Buttons Styles */
.action-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.action-buttons .btn {
    min-width: 160px;
    padding: 12px 24px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.action-buttons .btn:active {
    transform: translateY(0);
}

/* Button Color Variants */
.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

/* Completion Message Styles */
.completion-message {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 16px;
    border: 1px solid #bae6fd;
}

.completion-icon {
    margin-bottom: 20px;
    color: #0ea5e9;
}

.completion-message h2 {
    font-size: 2em;
    font-weight: 700;
    color: #0c4a6e;
    margin-bottom: 16px;
}

.completion-message p {
    font-size: 1.1em;
    color: #0c4a6e;
    margin-bottom: 30px;
    line-height: 1.6;
}

.completion-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Course Links Styles */
.course-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    color: #1e293b;
    transition: all 0.2s ease;
    margin: 8px 0;
}

.course-link:hover {
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
    border-color: #0ea5e9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
    text-decoration: none;
    color: #0c4a6e;
}

.course-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.course-title {
    font-weight: 600;
    font-size: 16px;
    flex-grow: 1;
}

.course-arrow {
    font-size: 18px;
    color: #0ea5e9;
    transition: transform 0.2s ease;
}

.course-link:hover .course-arrow {
    transform: translateX(4px);
}

.course-excerpt {
    margin-top: 8px;
    font-size: 14px;
    color: #f3f4f5;
    line-height: 1.5;
    font-style: italic;
}

.recommendation-item {
    margin: 12px 0;
}

/* Responsive for action buttons */
@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
        align-items: center;
        padding: 20px;
    }

    .action-buttons .btn {
        width: 100%;
        max-width: 280px;
    }

    .completion-actions {
        flex-direction: column;
        align-items: center;
    }

    .completion-actions .btn {
        width: 100%;
        max-width: 280px;
    }

    .course-link {
        padding: 12px 16px;
        gap: 8px;
    }

    .course-title {
        font-size: 14px;
    }
}

/* High Specificity Overrides for Plugin Conflicts */
#safe-survey-container .btn,
#safe-survey-container .survey-navigation .btn,
#safe-survey-container .action-buttons .btn,
#safe-survey-container .completion-actions .btn {
    color: white !important;
    background: #044E7C !important;
    border: none !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    padding: 14px 32px !important;
    border-radius: 12px !important;
    font-size: 1em !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    overflow: hidden !important;
    box-shadow: 0 4px 14px rgba(4, 78, 124, 0.25) !important;
}

#safe-survey-container .btn:hover,
#safe-survey-container .survey-navigation .btn:hover,
#safe-survey-container .action-buttons .btn:hover,
#safe-survey-container .completion-actions .btn:hover {
    background: #033A5C !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(4, 78, 124, 0.35) !important;
    color: white !important;
}

#safe-survey-container .btn-secondary,
#safe-survey-container .survey-navigation .btn-secondary,
#safe-survey-container .action-buttons .btn-secondary,
#safe-survey-container .completion-actions .btn-secondary {
    background: #6B7280 !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(107, 114, 128, 0.25) !important;
}

#safe-survey-container .btn-secondary:hover,
#safe-survey-container .survey-navigation .btn-secondary:hover,
#safe-survey-container .action-buttons .btn-secondary:hover,
#safe-survey-container .completion-actions .btn-secondary:hover {
    background: #4B5563 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(107, 114, 128, 0.35) !important;
    color: white !important;
}

#safe-survey-container .btn-success,
#safe-survey-container .survey-navigation .btn-success,
#safe-survey-container .action-buttons .btn-success,
#safe-survey-container .completion-actions .btn-success {
    background: #044E7C !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(4, 78, 124, 0.25) !important;
}

#safe-survey-container .btn-success:hover,
#safe-survey-container .survey-navigation .btn-success:hover,
#safe-survey-container .action-buttons .btn-success:hover,
#safe-survey-container .completion-actions .btn-success:hover {
    background: #033A5C !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(4, 78, 124, 0.35) !important;
    color: white !important;
}

#safe-survey-container .btn-outline,
#safe-survey-container .survey-navigation .btn-outline,
#safe-survey-container .action-buttons .btn-outline,
#safe-survey-container .completion-actions .btn-outline {
    background: transparent !important;
    color: #044E7C !important;
    border: 2px solid #044E7C !important;
    box-shadow: none !important;
}

#safe-survey-container .btn-outline:hover,
#safe-survey-container .survey-navigation .btn-outline:hover,
#safe-survey-container .action-buttons .btn-outline:hover,
#safe-survey-container .completion-actions .btn-outline:hover {
    background: #044E7C !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(4, 78, 124, 0.25) !important;
}

/* Ensure outline button text and icons are blue (not white) */
#safe-survey-container .btn-outline .btn-text,
#safe-survey-container .survey-navigation .btn-outline .btn-text,
#safe-survey-container .action-buttons .btn-outline .btn-text,
#safe-survey-container .completion-actions .btn-outline .btn-text {
    color: #044E7C !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#safe-survey-container .btn-outline svg,
#safe-survey-container .survey-navigation .btn-outline svg,
#safe-survey-container .action-buttons .btn-outline svg,
#safe-survey-container .completion-actions .btn-outline svg {
    stroke: #044E7C !important;
    fill: none !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* On hover, make text and icons white */
#safe-survey-container .btn-outline:hover .btn-text,
#safe-survey-container .survey-navigation .btn-outline:hover .btn-text,
#safe-survey-container .action-buttons .btn-outline:hover .btn-text,
#safe-survey-container .completion-actions .btn-outline:hover .btn-text {
    color: white !important;
}

#safe-survey-container .btn-outline:hover svg,
#safe-survey-container .survey-navigation .btn-outline:hover svg,
#safe-survey-container .action-buttons .btn-outline:hover svg,
#safe-survey-container .completion-actions .btn-outline:hover svg {
    stroke: white !important;
}

#safe-survey-container .btn:disabled,
#safe-survey-container .survey-navigation .btn:disabled,
#safe-survey-container .action-buttons .btn:disabled,
#safe-survey-container .completion-actions .btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    color: white !important;
}

/* Additional specificity for Elementor conflicts */
body #safe-survey-container .btn,
body #safe-survey-container .survey-navigation .btn,
body #safe-survey-container .action-buttons .btn,
body #safe-survey-container .completion-actions .btn {
    color: white !important;
}

body #safe-survey-container .btn:hover,
body #safe-survey-container .survey-navigation .btn:hover,
body #safe-survey-container .action-buttons .btn:hover,
body #safe-survey-container .completion-actions .btn:hover {
    color: white !important;
}

/* Ensure button content is visible */
#safe-survey-container .btn svg,
#safe-survey-container .survey-navigation .btn svg,
#safe-survey-container .action-buttons .btn svg,
#safe-survey-container .completion-actions .btn svg {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#safe-survey-container .btn .btn-text,
#safe-survey-container .survey-navigation .btn .btn-text,
#safe-survey-container .action-buttons .btn .btn-text,
#safe-survey-container .completion-actions .btn .btn-text {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}


/* Force content visibility for all buttons */
#safe-survey-container .btn *,
#safe-survey-container .survey-navigation .btn *,
#safe-survey-container .action-buttons .btn *,
#safe-survey-container .completion-actions .btn * {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure button text is not hidden by external CSS */
#safe-survey-container .btn span,
#safe-survey-container .survey-navigation .btn span,
#safe-survey-container .action-buttons .btn span,
#safe-survey-container .completion-actions .btn span {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: inherit !important;
}

/* Button Loading Styles */
.btn-loading {
    position: relative !important;
    pointer-events: none !important;
}

.btn-spinner {
    display: inline-block !important;
    width: 16px !important;
    height: 16px !important;
    border: 2px solid transparent !important;
    border-top: 2px solid currentColor !important;
    border-radius: 50% !important;
    animation: btn-spin 1s linear infinite !important;
    margin-right: 8px !important;
}

@keyframes btn-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.btn-loading .btn-text {
    opacity: 0.8 !important;
}