/* Ensure proper scroll behavior */
html, body {
    scroll-behavior: smooth;
    margin: 0;
    padding: 0;
    height: 100%;
}

/* Questionnaire Specific Styles */

/* Progress Bar */
.progress-container {
    background: linear-gradient(135deg, #f8faff 0%, #ffffff 100%);
    padding: 20px 0;
    border-bottom: 1px solid rgba(0, 102, 204, 0.1);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(0, 102, 204, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0066CC, #FF6600);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 33.33%;
}

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

/* Questionnaire Container */
.questionnaire-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* For iOS smooth scrolling */
    margin-top: 0; /* Ensure it starts at the top */
}

.question-step {
    display: none;
    animation: fadeIn 0.5s ease;
    scroll-margin-top: 20px; /* Ensure proper scroll positioning */
    padding-top: 0; /* Remove any top padding that might affect scroll */
}

.question-step.active {
    display: block;
}

/* Ensure the first question step is properly positioned */
#step1 {
    margin-top: 0;
    padding-top: 0;
}

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

.question-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.question-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #003366 0%, #0066CC 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.question-description {
    font-size: 18px;
    color: #4a5568;
    margin-bottom: 50px;
    line-height: 1.6;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 50px;
}

/* Enhanced Interactive Option Cards */
.option-card {
    background: #ffffff;
    border: 2px solid rgba(0, 102, 204, 0.1);
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.option-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0066CC, #FF6600);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.option-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 102, 204, 0.15);
    border-color: rgba(0, 102, 204, 0.3);
}

.option-card:hover::before {
    transform: scaleX(1);
}

.option-card:active {
    transform: translateY(-4px) scale(1.01);
    transition: all 0.1s ease;
}

.option-card.selected {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.05) 0%, rgba(255, 102, 0, 0.05) 100%);
    border-color: #0066CC;
    box-shadow: 0 8px 32px rgba(0, 102, 204, 0.2);
    transform: translateY(-4px);
}

.option-card.selected::before {
    transform: scaleX(1);
}

/* Remove the conflicting ::after pseudo-element for single-select cards */
.option-card.selected::after {
    display: none;
}

/* Single-select cards don't need ::after indicators - they use the selection-feedback animation instead */

@keyframes checkmarkAppear {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Enhanced Option Icons */
.option-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.1) 0%, rgba(255, 102, 0, 0.1) 100%);
    border-radius: 16px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.option-card:hover .option-icon {
    transform: scale(1.1);
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.15) 0%, rgba(255, 102, 0, 0.15) 100%);
}

.option-card.selected .option-icon {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.2) 0%, rgba(255, 102, 0, 0.2) 100%);
    transform: scale(1.05);
}

.option-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.option-card:hover .option-icon::before {
    transform: translateX(100%);
}

/* Enhanced Typography */
.option-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #003366;
    transition: color 0.3s ease;
}

.option-card:hover .option-title {
    color: #0066CC;
}

.option-description {
    font-size: 14px;
    color: #4a5568;
    line-height: 1.5;
    margin: 0;
    transition: color 0.3s ease;
}

.option-card:hover .option-description {
    color: #2d3748;
}

/* Selection feedback animation */
.option-card.selection-feedback {
    animation: selectionPulse 0.8s ease-out;
}

@keyframes selectionPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(0, 102, 204, 0.05);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 8px 30px rgba(0, 102, 204, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 8px 30px rgba(0, 102, 204, 0.2);
    }
}

/* Navigation */
.questionnaire-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-button {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    border: none;
    position: relative;
    overflow: hidden;
}

.nav-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.nav-button:hover::before {
    left: 100%;
}

.back-button {
    background: transparent;
    color: #4a5568;
    border: 2px solid rgba(0, 102, 204, 0.2);
}

.back-button:hover {
    background: rgba(0, 102, 204, 0.1);
    color: #003366;
    border-color: rgba(0, 102, 204, 0.4);
}

.next-button {
    background: linear-gradient(135deg, #0066CC 0%, #0052a3 100%);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 102, 204, 0.3);
}

.next-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 102, 204, 0.4);
}

.next-button:disabled {
    background: #e2e8f0;
    color: #a0aec0;
    cursor: not-allowed;
    box-shadow: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .question-title {
        font-size: 28px;
    }
    
    .question-description {
        font-size: 16px;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .option-card {
        padding: 24px 16px;
    }
    
    .questionnaire-nav {
        flex-direction: column;
        gap: 16px;
    }
    
    .nav-button {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .question-title {
        font-size: 24px;
    }
    
    .question-description {
        font-size: 14px;
    }
    
    .option-title {
        font-size: 18px;
    }
    
    .option-description {
        font-size: 14px;
    }
    
    .questionnaire-container {
        padding: 40px 0;
    }
}

/* Loading and Success States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.success {
    border-color: #48bb78;
    background: rgba(72, 187, 120, 0.05);
}

.success .option-icon {
    color: #48bb78;
}

.error {
    border-color: #f56565;
    background: rgba(245, 101, 101, 0.05);
}

.error .option-icon {
    color: #f56565;
} 

/* Multi-select functionality */
.multi-select .option-card {
    position: relative;
}

.multi-select .option-card.selected {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.08) 0%, rgba(255, 102, 0, 0.08) 100%);
}

.selection-indicator {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 24px;
    height: 24px;
    border: 2px solid rgba(0, 102, 204, 0.3);
    border-radius: 50%;
    background: transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.multi-select .option-card.selected .selection-indicator {
    background: #0066CC;
    border-color: #0066CC;
    transform: scale(1.2);
}

.multi-select .option-card.selected .selection-indicator::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
}

/* Remove any conflicting radio button styles */
.multi-select .option-card input[type="radio"],
.multi-select .option-card input[type="checkbox"] {
    display: none;
}

/* Ensure no duplicate indicators */
.multi-select .option-card::after {
    display: none;
}

.multi-select .option-card.selected::after {
    display: none;
}

/* Multi-select specific hover effects */
.multi-select .option-card:hover {
    border-color: rgba(0, 102, 204, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 102, 204, 0.15);
}

.multi-select .option-card:hover::before {
    transform: scaleX(1);
}

/* Responsive adjustments for multi-select */
@media (max-width: 768px) {
    .multi-select .options-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 16px;
    }
    
    .selection-indicator {
        width: 18px;
        height: 18px;
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .multi-select .options-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .selection-indicator {
        width: 16px;
        height: 16px;
        top: 8px;
        right: 8px;
    }
} 

/* Skip Button */
.skip-button-container {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 102, 204, 0.1);
}

.skip-button {
    background: none;
    border: 1px solid rgba(0, 102, 204, 0.3);
    color: #0066CC;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.skip-button:hover {
    background: rgba(0, 102, 204, 0.1);
    border-color: rgba(0, 102, 204, 0.5);
    transform: translateY(-1px);
}

.skip-button:active {
    transform: translateY(0);
}

/* Responsive adjustments for skip button */
@media (max-width: 768px) {
    .skip-button-container {
        margin-bottom: 20px;
        padding-bottom: 12px;
    }
    
    .skip-button {
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .skip-button-container {
        margin-bottom: 16px;
        padding-bottom: 8px;
    }
    
    .skip-button {
        padding: 4px 10px;
        font-size: 12px;
    }
} 

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .option-card:hover {
        transform: none;
        box-shadow: 0 4px 20px rgba(0, 102, 204, 0.05);
    }
    
    .option-card:active {
        transform: scale(0.98);
        background: rgba(0, 102, 204, 0.05);
    }
    
    .option-card.selected {
        transform: scale(1.02);
    }
}

/* Focus States for Accessibility */
.option-card:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.3);
}

.option-card:focus-visible {
    outline: 2px solid #0066CC;
    outline-offset: 2px;
} 

/* Mobile-specific scroll fixes */
@media (max-width: 768px) {
    .questionnaire-container {
        padding: 10px;
        min-height: 100vh;
        overflow-x: hidden;
    }
    
    .question-step {
        scroll-margin-top: 10px;
        padding-top: 10px;
    }
    
    /* Force scroll reset on mobile */
    .question-step.active {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .questionnaire-container {
        -webkit-overflow-scrolling: touch;
        position: relative;
    }
    
    .question-step.active {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
} 