/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header styles */
header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    font-weight: 300;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.intro {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.intro p {
    margin-bottom: 10px;
    font-size: 1.1em;
    line-height: 1.7;
}

/* Form styles */
.questionnaire-form {
    padding: 40px;
}

.section {
    margin-bottom: 50px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 5px solid #4facfe;
}

.section h2 {
    color: #2c3e50;
    font-size: 1.8em;
    margin-bottom: 10px;
    font-weight: 500;
}

.section-desc {
    color: #7f8c8d;
    font-style: italic;
    margin-bottom: 25px;
    padding: 10px;
    background: rgba(79, 172, 254, 0.1);
    border-radius: 8px;
}

.scale-info {
    background: #e8f4fd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #b3d9ff;
}

.scale-info p {
    font-weight: 500;
    color: #2c3e50;
    text-align: center;
}

/* Question styles */
.question {
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.question:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.question label {
    display: block;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1em;
}

/* Radio and checkbox groups */
.radio-group, .checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-group label, .checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: 400;
    margin-bottom: 0;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.radio-group label:hover, .checkbox-group label:hover {
    background-color: #f0f8ff;
}

.radio-group input[type="radio"], 
.checkbox-group input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    accent-color: #4facfe;
}

/* Select and input styles */
.scale-select, .text-input, .textarea-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: white;
}

.scale-select:focus, .text-input:focus, .textarea-input:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.text-input {
    margin-top: 10px;
}

.frequency-label {
    display: inline-block;
    margin: 15px 0 10px 0;
    font-weight: 500;
    color: #2c3e50;
}

.textarea-input {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

/* Submit section */
.submit-section {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin: 0 -40px -40px -40px;
}

.submit-btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 15px 40px;
    font-size: 1.2em;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: #f8f9fa;
}

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

.thank-you {
    font-size: 1.1em;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 10px;
    }
    
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .questionnaire-form {
        padding: 20px;
    }
    
    .section {
        padding: 20px;
        margin-bottom: 30px;
    }
    
    .submit-section {
        margin: 0 -20px -20px -20px;
        padding: 30px 20px;
    }
    
    .radio-group, .checkbox-group {
        gap: 8px;
    }
    
    .radio-group label, .checkbox-group label {
        padding: 8px;
        font-size: 0.95em;
    }
    
    /* Increase radio button and checkbox size for better mobile usability */
    .radio-group input[type="radio"], 
    .checkbox-group input[type="checkbox"] {
        width: 22px;
        height: 22px;
        margin-right: 14px;
        flex-shrink: 0; /* Prevent radio button from shrinking */
    }
    
    /* Ensure proper text wrapping for long options */
    .radio-group label, .checkbox-group label {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .intro p {
        font-size: 1em;
    }
    
    .section h2 {
        font-size: 1.5em;
    }
    
    .question label {
        font-size: 1em;
    }
    
    .submit-btn {
        padding: 12px 30px;
        font-size: 1.1em;
    }
    
    /* Increase radio button and checkbox size for better mobile usability */
    .radio-group input[type="radio"], 
    .checkbox-group input[type="checkbox"] {
        width: 24px;
        height: 24px;
        margin-right: 15px;
        flex-shrink: 0; /* Prevent radio button from shrinking */
    }
    
    /* Ensure proper text wrapping for long options */
    .radio-group label, .checkbox-group label {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
}

/* Loading and success states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #c3e6cb;
    text-align: center;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #f5c6cb;
    text-align: center;
}

/* Animation for form sections */
.section {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Progress indicator */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #4facfe, #00f2fe);
    transition: width 0.3s ease;
    z-index: 1000;
}
