/**
 * Public styles for RavensTale Questionnaire Wizard
 *
 * @package    RavensTaleQW
 * @subpackage RavensTaleQW/public/css
 */

/* Questionnaire Container */
.rtqw-questionnaire {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background-color: #1a1a1a;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    color: #e0e0e0;
}

/* Header */
.rtqw-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #333;
}

.rtqw-title {
    margin: 0 0 15px 0;
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
}

.rtqw-description {
    font-size: 16px;
    color: #b0b0b0;
    line-height: 1.6;
}

/* Questions */
.rtqw-questions {
    margin-bottom: 30px;
}

.rtqw-question {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #252525;
    border-radius: 6px;
    border: 1px solid #333;
}

.rtqw-question:last-child {
    margin-bottom: 0;
}

.rtqw-question-label {
    display: block;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #e0e0e0;
    cursor: pointer;
}

.rtqw-question-number {
    color: #5b9dd9;
    margin-right: 5px;
}

.rtqw-question-title {
    color: #ffffff;
}

.rtqw-required {
    color: #e74c3c;
    margin-left: 3px;
}

.rtqw-question-description {
    margin-bottom: 15px;
    font-size: 14px;
    color: #999;
    line-height: 1.5;
}

/* Input Fields */
.rtqw-question-input {
    margin-top: 10px;
}

.rtqw-input {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    line-height: 1.4;
    color: #e0e0e0;
    background-color: #1e1e1e;
    border: 1px solid #444;
    border-radius: 4px;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.rtqw-input:focus {
    outline: none;
    border-color: #5b9dd9;
    background-color: #2a2a2a;
    box-shadow: 0 0 0 1px #5b9dd9;
}

.rtqw-input::placeholder {
    color: #666;
}

.rtqw-input-text {
    max-width: 600px;
}

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

/* Multiple Choice */
.rtqw-choices {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rtqw-choice {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background-color: #1e1e1e;
    border: 2px solid #444;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rtqw-choice:hover {
    border-color: #5b9dd9;
    background-color: #2a2a2a;
}

.rtqw-choice input[type="radio"],
.rtqw-choice input[type="checkbox"] {
    margin: 0 12px 0 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #5b9dd9;
}

.rtqw-choice input[type="radio"]:checked + .rtqw-choice-label,
.rtqw-choice input[type="checkbox"]:checked + .rtqw-choice-label {
    font-weight: 600;
    color: #5b9dd9;
}

.rtqw-choice-label {
    flex: 1;
    font-size: 15px;
    color: #e0e0e0;
}

/* Dropdown Select */
.rtqw-input-select {
    max-width: 600px;
    cursor: pointer;
}

.rtqw-input-select option {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

/* Submit Button */
.rtqw-submit-container {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #333;
}

.rtqw-submit-button {
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background-color: #5b9dd9;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.rtqw-submit-button:hover {
    background-color: #4a8bc2;
}

.rtqw-submit-button:active {
    transform: translateY(1px);
}

.rtqw-submit-button:disabled {
    background-color: #444;
    cursor: not-allowed;
}

/* Messages */
.rtqw-messages {
    margin-top: 20px;
}

.rtqw-message {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 15px;
    line-height: 1.5;
}

.rtqw-message-success {
    background-color: #2d5016;
    color: #a8e6a1;
    border: 1px solid #3d6b20;
}

.rtqw-message-error {
    background-color: #5c1f1f;
    color: #f8a9a9;
    border: 1px solid #7a2828;
}

/* Thank You Message */
.rtqw-thank-you {
    text-align: center;
    padding: 60px 20px;
}

.rtqw-thank-you h3 {
    margin: 0 0 15px 0;
    font-size: 32px;
    color: #5b9dd9;
}

.rtqw-thank-you p {
    font-size: 18px;
    color: #b0b0b0;
    margin: 0;
}

/* Loading State */
.rtqw-form.rtqw-loading {
    opacity: 0.6;
    pointer-events: none;
}

.rtqw-form.rtqw-loading .rtqw-submit-button::after {
    content: '...';
    animation: rtqw-dots 1.5s infinite;
}

@keyframes rtqw-dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Error State */
.rtqw-error {
    padding: 20px;
    background-color: #5c1f1f;
    color: #f8a9a9;
    border: 1px solid #7a2828;
    border-radius: 6px;
    text-align: center;
    margin: 20px 0;
}

/* Field Validation */
.rtqw-question.rtqw-has-error .rtqw-input {
    border-color: #e74c3c;
}

.rtqw-question.rtqw-has-error .rtqw-choice {
    border-color: #e74c3c;
}

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

.rtqw-input:invalid {
    border-color: #e74c3c;
}

.rtqw-input:valid {
    border-color: #444;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .rtqw-questionnaire {
        margin: 20px auto;
        padding: 20px 15px;
        border-radius: 0;
    }

    .rtqw-title {
        font-size: 24px;
    }

    .rtqw-question {
        padding: 15px;
    }

    .rtqw-question-label {
        font-size: 15px;
    }

    .rtqw-input {
        padding: 10px;
        font-size: 14px;
    }

    .rtqw-choice {
        padding: 10px 12px;
    }

    .rtqw-choice-label {
        font-size: 14px;
    }

    .rtqw-submit-button {
        width: 100%;
        padding: 12px;
    }
}

@media screen and (max-width: 480px) {
    .rtqw-questionnaire {
        padding: 15px 10px;
    }

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

    .rtqw-question {
        padding: 12px;
    }
}
