/**
 * Survey Frontend Styles
 * Mobile-first, Telegram-inspired design
 */

.qs-survey-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

#qs-survey-content {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.qs-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Identification Screen */
.qs-identification h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
}

.qs-id-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 30px;
}

.qs-id-btn {
    padding: 20px;
    background: #fff;
    border: 2px solid #0073aa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.qs-id-btn:hover {
    background: #0073aa;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.qs-id-btn .icon {
    display: block;
    font-size: 32px;
    margin-bottom: 10px;
}

.qs-id-btn .label {
    font-size: 16px;
    font-weight: 600;
}

/* SMS button styling */
.qs-id-btn[data-type="sms"] {
    border-color: #FF6B6B;
}

.qs-id-btn[data-type="sms"]:hover {
    background: #FF6B6B;
    border-color: #FF6B6B;
    color: white;
}

/* WhatsApp button styling */
.qs-id-btn[data-type="whatsapp"] {
    border-color: #25D366;
}

.qs-id-btn[data-type="whatsapp"]:hover {
    background: #25D366;
    border-color: #25D366;
    color: white;
}

/* Form inputs */
.qs-input,
.qs-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 15px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.qs-input:focus,
.qs-textarea:focus {
    outline: none;
    border-color: #0073aa;
}

.qs-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Phone input group - country and phone on same line */
.qs-phone-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.qs-country-select {
    flex: 0 0 200px;
    min-width: 200px;
}

.qs-phone-input {
    flex: 1;
}

/* Select dropdown styling */
select.qs-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 12px;
    padding-right: 40px;
}

/* Phone input styling */
input[type="tel"].qs-input {
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

/* Hint text styling */
.qs-hint {
    font-size: 12px;
    color: #666;
    margin-top: -8px;
    margin-bottom: 15px;
    font-style: italic;
}

/* Buttons */
.qs-btn-primary,
.qs-btn-secondary {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.qs-btn-primary {
    background: #0073aa;
    color: #fff;
}

.qs-btn-primary:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.qs-btn-secondary {
    background: #ddd;
    color: #333;
    margin-left: 10px;
}

.qs-btn-secondary:hover {
    background: #ccc;
}

/* Progress bar container */
.qs-progress-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

/* Progress indicator */
.qs-progress {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

/* Back button */
.qs-btn-back {
    background: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.qs-btn-back:hover {
    background: #e8e8e8;
    border-color: #0073aa;
    transform: translateX(-2px);
}

/* Question */
.qs-question-text {
    font-size: 22px;
    margin-bottom: 10px;
    color: #333;
}

.qs-hint {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    font-style: italic;
}

/* Kinks notice */
.qs-kinks-notice {
    background: #fff3cd;
    border-left: 4px solid #ff69b4;
    padding: 12px 18px;
    margin: 15px 0 20px 0;
    border-radius: 4px;
}

.qs-kinks-notice p {
    margin: 0;
    font-size: 14px;
    color: #856404;
    line-height: 1.5;
    font-style: italic;
}

/* Choice buttons (Telegram-style) */
.qs-choice-btn,
.qs-multi-btn {
    display: block;
    width: 100%;
    padding: 15px 20px;
    margin-bottom: 10px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 8px;
    text-align: left;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.qs-choice-btn:hover {
    background: #e8f4f8;
    border-color: #0073aa;
    transform: translateX(5px);
}

.qs-multi-btn {
    position: relative;
}

.qs-multi-btn.selected {
    background: #e8f4f8;
    border-color: #0073aa;
}

.qs-multi-btn .checkmark {
    color: #0073aa;
    font-weight: bold;
    margin-right: 5px;
}

/* Character counter */
.qs-char-count {
    text-align: right;
    font-size: 13px;
    color: #666;
    margin-top: -10px;
    margin-bottom: 10px;
}

/* Answer confirmation */
.qs-confirmation {
    padding: 30px 0;
    text-align: center;
}

.qs-confirmation h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 15px;
}

.qs-selected-answer {
    font-size: 18px;
    color: #0073aa;
    font-weight: 600;
}

/* Welcome/Completion */
.qs-welcome,
.qs-completion {
    text-align: center;
    padding: 20px 0;
}

.qs-message {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 30px;
    white-space: pre-line;
}

/* Info notice */
.qs-info-notice {
    background: #e8f4f8;
    border-left: 4px solid #0073aa;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.qs-info-notice p {
    margin: 0;
    font-size: 15px;
    color: #333;
    line-height: 1.5;
}

/* Resume screen */
.qs-resume {
    text-align: center;
}

.qs-resume h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
}

.qs-resume-buttons {
    margin-top: 30px;
}

/* Error messages */
.qs-error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 8px;
    margin-top: 15px;
    border: 1px solid #f5c6cb;
}

/* Other text input (separate slide, legacy) */
.qs-other-input {
    margin-top: 20px;
}

.qs-other-input h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

/* Inline "other" textarea — morphs in-place from button */
.qs-other-inline {
    position: relative;
    padding: 10px 15px;
    cursor: default;
    box-sizing: border-box;
    transition: border-color 0.2s;
    min-height: 80px;
}

.qs-other-inline-remove {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: #aaa;
    cursor: pointer;
    padding: 2px 5px;
    z-index: 1;
    transition: color 0.2s;
}

.qs-other-inline-remove:hover {
    color: #333;
}

.qs-other-inline-textarea {
    display: block;
    width: 100%;
    height: calc(100% - 20px);
    min-height: 56px;
    border: none;
    background: transparent;
    resize: none;
    font-size: 15px;
    font-family: inherit;
    color: #333;
    outline: none;
    padding: 0;
    margin: 0;
    padding-right: 22px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .qs-survey-wrapper {
        padding: 10px;
    }

    #qs-survey-content {
        padding: 20px;
    }

    .qs-id-buttons {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Stack country and phone vertically on mobile */
    .qs-phone-input-group {
        flex-direction: column;
        gap: 0;
    }

    .qs-country-select {
        flex: 1;
        min-width: 100%;
        margin-bottom: 15px;
    }

    .qs-phone-input {
        flex: 1;
        width: 100%;
    }

    .qs-question-text {
        font-size: 20px;
    }

    .qs-choice-btn,
    .qs-multi-btn {
        font-size: 15px;
        padding: 12px 15px;
    }
}

/* Admin badge styles */
.badge-new {
    display: inline-block;
    background: #d63638;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    margin-left: 8px;
}

.unread-response {
    background-color: #f0f6fc !important;
}

