/**
 * Single-Page Survey Styles
 *
 * @package WP_Dynamic_Survey
 */

/* Main Container */
.wp-dynamic-survey-single-page {
    background-color: white;
    padding: 28px;
}

/* Container */
.wp-dynamic-survey-sp-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Survey Title */
.sp-survey-title-container {
    margin-bottom: 20px;
}

.sp-survey-title {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 2.3;
    text-align: center;
}

/* Sections */
.sp-section {
    display: block;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.sp-section.hidden {
    display: none;
    opacity: 0;
}

/* Loading Overlay */
#sp-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 400px;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#sp-loading-overlay.hidden {
    display: none;
}

.sp-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Questions Section */
#sp-questions-section {
    min-height: 300px;
}

.question-container {
    background: #fff;
    border-radius: 8px;
}

.question-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
    text-align: center;
}

.question-description {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

.question-extra-message {
    font-size: 14px;
    color: #999;
    margin-bottom: 20px;
    font-style: italic;
}

/* Answer Options */
.question-answers {
    margin-top: 20px;
}

.answer-option {
    margin-bottom: 12px;
}

.answer-input {
    display: none;
}

.answer-label {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}

.answer-label:hover {
    border-color: #3498db;
    background: #f8f9fa;
}

.answer-input:checked + .answer-label {
    border-color: #3498db;
    background: #e3f2fd;
}

.answer-label.selected {
    border-color: #3498db;
    background: #e3f2fd;
}

.answer-indicator {
    width: 20px;
    height: 20px;
    border: 2px solid #999;
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
    flex-shrink: 0;
}

.answer-input:checked + .answer-label .answer-indicator {
    border-color: #3498db;
}

.answer-input:checked + .answer-label .answer-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #3498db;
    border-radius: 50%;
}

.answer-text {
    font-size: 16px;
    color: #333;
}

/* User Info Forms */
#sp-userinfo-section {
    min-height: 400px;
}

.sp-form-stage.hidden {
    display: none;
}

.sp-stage-header {
    margin-bottom: 25px;
}

.sp-stage-title {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.sp-stage-description {
    font-size: 15px;
    color: #666;
}

.sp-form-group {
    margin-bottom: 20px;
}

.sp-form-label {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.sp-form-label .required {
    color: #e74c3c;
}

.sp-form-control {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s ease;
}

.sp-form-control:focus {
    outline: none;
    border-color: #3498db;
}

.sp-form-control.error {
    border-color: #e74c3c;
}

.sp-error-message {
    display: block;
    font-size: 13px;
    color: #e74c3c;
    margin-top: 5px;
}

.sp-checkbox-group {
    display: flex;
    align-items: start;
}

.sp-checkbox-group input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
}

.sp-checkbox-group label {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* Error Container */
#sp-form-error-container {
    background: #fee;
    border: 1px solid #e74c3c;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

#sp-form-error-container.hidden {
    display: none;
}

.sp-error-text {
    color: #c0392b;
    font-size: 14px;
}

/* Buttons */
.sp-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
}

.sp-btn {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sp-btn-primary {
    background: #3498db;
    color: #fff;
}

.sp-btn-primary:hover {
    background: #2980b9;
}

.sp-btn-primary:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.sp-btn-secondary {
    background: transparent;
    color: #7f8c8d;
    text-decoration: underline;
}

.sp-btn-secondary:hover {
    color: #2c3e50;
}

.sp-btn-loading {
    display: none;
}

.sp-btn-loading.active {
    display: inline-block;
}

/* Completion Section */
#sp-completion-section {
    text-align: center;
    padding: 60px 20px;
}

#sp-completion-section.hidden {
    display: none;
}

.sp-completion-icon {
    font-size: 64px;
    color: #27ae60;
    margin-bottom: 20px;
}

.sp-completion-title {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.sp-completion-message {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .wp-dynamic-survey-single-page {
        padding: 20px;
    }

    .wp-dynamic-survey-sp-container {
        padding: 15px;
    }

    .sp-survey-title {
        font-size: 22px;
    }

    .question-title {
        font-size: 20px;
    }

    .sp-stage-title {
        font-size: 19px;
    }

    .answer-label {
        padding: 12px 15px;
    }

    .sp-form-actions {
        flex-direction: column;
        gap: 15px;
    }

    .sp-btn {
        width: 100%;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

.mb-0 {
    margin-bottom: 0;
}

.mt-0 {
    margin-top: 0;
}
