/* Advanced Quiz Builder - Frontend Styles */

.aqb-quiz-container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.aqb-quiz-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 40px 30px;
    text-align: center;
}

.aqb-quiz-title {
    margin: 0 0 15px 0;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
}

.aqb-quiz-description {
    font-size: 16px;
    opacity: 0.9;
    line-height: 1.5;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.aqb-quiz-description p {
    margin: 0;
}

/* Progress Bar */
.aqb-progress-container {
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.aqb-progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.aqb-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.aqb-progress-text {
    text-align: center;
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

/* Contact Section */
.aqb-contact-section {
    padding: 40px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.aqb-section-header {
    text-align: center;
    margin-bottom: 30px;
}

.aqb-section-header h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #2c3e50;
    font-weight: 600;
}

.aqb-section-header p {
    margin: 0;
    color: #6c757d;
    font-size: 16px;
}

.aqb-contact-fields {
    max-width: 600px;
    margin: 0 auto;
}

.aqb-field-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.aqb-field-col {
    flex: 1;
}

.aqb-field-col label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.aqb-contact-fields input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fff;
}

.aqb-contact-fields input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.aqb-contact-footer {
    text-align: center;
    margin-top: 30px;
}

.aqb-start-quiz-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 16px 40px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.aqb-start-quiz-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Questions Section */
.aqb-questions-section {
    padding: 0;
}

.aqb-quiz-form {
    padding: 0;
}

.aqb-question-wrapper {
    padding: 30px;
    border-bottom: 1px solid #f0f2f5;
    transition: background-color 0.3s ease;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.aqb-question-wrapper:hover {
    background-color: #fafbfc;
}

.aqb-question-wrapper:last-child {
    border-bottom: none;
}

.aqb-question-title {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.4;
}

.aqb-required {
    color: #e74c3c;
    font-weight: bold;
    margin-left: 4px;
}

.aqb-question-input {
    margin-top: 15px;
    flex: 1;
}

/* Navigation Buttons */
.aqb-question-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.aqb-prev-button,
.aqb-next-button {
    background: #fff;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.aqb-prev-button:hover,
.aqb-next-button:hover {
    background: #667eea;
    color: #fff;
    transform: translateY(-1px);
}

.aqb-prev-button:disabled,
.aqb-next-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Text Inputs */
.aqb-text-input,
.aqb-textarea-input,
.aqb-select-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fff;
}

.aqb-text-input:focus,
.aqb-textarea-input:focus,
.aqb-select-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.aqb-textarea-input {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

/* Radio Buttons */
.aqb-radio-label {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 8px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}

.aqb-radio-label:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.aqb-radio-label:last-child {
    margin-bottom: 0;
}

.aqb-radio-label input[type="radio"] {
    margin: 0 12px 0 0;
    transform: scale(1.2);
    accent-color: #667eea;
}

.aqb-radio-text {
    font-size: 16px;
    color: #2c3e50;
    line-height: 1.4;
}

.aqb-radio-label input[type="radio"]:checked + .aqb-radio-text {
    font-weight: 600;
    color: #667eea;
}

.aqb-radio-label.selected {
    border-color: #667eea;
    background: #f8f9ff;
}

/* Checkboxes */
.aqb-checkbox-label {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 8px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}

.aqb-checkbox-label:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.aqb-checkbox-label:last-child {
    margin-bottom: 0;
}

.aqb-checkbox-label input[type="checkbox"] {
    margin: 0 12px 0 0;
    transform: scale(1.2);
    accent-color: #667eea;
}

.aqb-checkbox-text {
    font-size: 16px;
    color: #2c3e50;
    line-height: 1.4;
}

.aqb-checkbox-label input[type="checkbox"]:checked + .aqb-checkbox-text {
    font-weight: 600;
    color: #667eea;
}

.aqb-checkbox-label.selected {
    border-color: #667eea;
    background: #f8f9ff;
}

/* Select Dropdown */
.aqb-select-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

/* Submit Button */
.aqb-quiz-footer {
    padding: 30px;
    background: #f8f9fa;
    text-align: center;
}

.aqb-submit-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 16px 40px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    min-width: 200px;
}

.aqb-submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

.aqb-submit-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.aqb-loading {
    display: inline-block;
}

/* Results */
.aqb-quiz-result {
    padding: 40px 30px;
    text-align: center;
    background: #f8f9fa;
}

.aqb-result-content h3 {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #27ae60;
    font-weight: 600;
}

.aqb-result-content p {
    margin: 0;
    font-size: 16px;
    color: #7f8c8d;
    line-height: 1.5;
}

/* No Questions */
.aqb-no-questions {
    padding: 60px 30px;
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
}

/* Error States */
.aqb-error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

.aqb-error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 8px;
    font-weight: 500;
}

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

.aqb-submit-button .aqb-loading::after {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .aqb-quiz-container {
        margin: 10px;
        border-radius: 8px;
    }

    .aqb-quiz-header {
        padding: 30px 20px;
    }

    .aqb-quiz-title {
        font-size: 24px;
    }

    .aqb-question-wrapper {
        padding: 20px;
        min-height: 300px;
    }

    .aqb-question-title {
        font-size: 18px;
    }

    .aqb-field-row {
        flex-direction: column;
        gap: 15px;
    }

    .aqb-question-navigation {
        flex-direction: column;
        gap: 15px;
    }

    .aqb-prev-button,
    .aqb-next-button {
        width: 100%;
    }

    .aqb-text-input,
    .aqb-textarea-input,
    .aqb-select-input,
    .aqb-contact-fields input {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .aqb-radio-label,
    .aqb-checkbox-label {
        padding: 10px 12px;
    }

    .aqb-submit-button,
    .aqb-start-quiz-button {
        width: 100%;
        padding: 14px 20px;
        font-size: 16px;
    }

    .aqb-quiz-footer,
    .aqb-contact-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .aqb-quiz-header {
        padding: 20px 15px;
    }

    .aqb-question-wrapper {
        padding: 15px;
    }

    .aqb-radio-label,
    .aqb-checkbox-label {
        padding: 8px 10px;
        font-size: 14px;
    }

    .aqb-progress-container {
        padding: 15px 20px;
    }
}

/* Animation for question transitions */
.aqb-question-fade-in {
    animation: fadeIn 0.5s ease-in;
}

.aqb-question-fade-out {
    animation: fadeOut 0.3s ease-out;
}

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

@keyframes fadeOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-20px); }
}

.aqb-contact-field input {
    padding: 10px;
}
