/* ─── Survey Cards ─────────────────────────────────────────────────── */
.survey-card {
    background: linear-gradient(135deg, #1a0f05 0%, #2d1a0a 100%);
    border: 1px solid #8b4513;
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.survey-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ffd700, #8b4513, #ffd700);
}

.survey-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.survey-badge {
    background: linear-gradient(135deg, #8b4513, #a0522d);
    color: #ffd700;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.survey-responded-badge {
    background: rgba(80, 180, 80, 0.2);
    color: #5cb85c;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px solid #5cb85c44;
}


.survey-card-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* ─── Survey Modal ────────────────────────────────────────────────── */
.survey-modal-desc {
    color: #c8a882;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.survey-close-notice {
    color: #8b6b4a;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.survey-question {
    margin-bottom: 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #2d1a0a;
}

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

.survey-question-text {
    color: #a0522d;
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.survey-question-error .survey-question-text {
    color: #e74c3c;
}

.survey-question-error .survey-input,
.survey-question-error .survey-textarea {
    border-color: #e74c3c;
}

.survey-input {
    width: 100%;
    padding: 0.6rem 1rem;
    background: #1a0f05;
    border: 1px solid #4a2c0a;
    border-radius: 8px;
    color: #e8d5b7;
    font-size: 1.1rem;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.survey-input:focus {
    outline: none;
    border-color: #8b4513;
}

.survey-textarea {
    width: 100%;
    padding: 0.6rem 1rem;
    background: #1a0f05;
    border: 1px solid #4a2c0a;
    border-radius: 8px;
    color: #e8d5b7;
    font-size: 1.1rem;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.2s;
}

.survey-textarea:focus {
    outline: none;
    border-color: #8b4513;
}

.survey-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.survey-option-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #e8d5b7;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: background 0.15s;
}

.survey-option-label:hover {
    background: rgba(139, 69, 19, 0.2);
}

.survey-option-label input[type="radio"],
.survey-option-label input[type="checkbox"] {
    accent-color: #8b4513;
    width: 1rem;
    height: 1rem;
}

.survey-rating {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.rating-star {
    background: none;
    border: none;
    color: #4a2c0a;
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s, transform 0.1s;
}

.rating-star:hover,
.rating-star.active {
    color: #ffd700;
}

.rating-star:hover {
    transform: scale(1.15);
}

.rating-label {
    color: #8b6b4a;
    font-size: 1.1rem;
    margin-left: 0.5rem;
}

.required-mark {
    color: #e74c3c;
    margin-left: 2px;
}

/* ─── Survey Results Modal ───────────────────────────────────────── */
.results-summary-bar {
    display: flex;
    gap: 1.5rem;
    background: rgba(139, 69, 19, 0.15);
    border: 1px solid #4a2c0a;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    color: #c8a882;
    font-size: 0.95rem;
}

.results-summary-bar strong {
    color: #c8a882;
}

.result-question-block {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #2d1a0a;
}

.result-question-text {
    color: #a0522d;
    font-size: 1.05rem;
    margin: 0 0 0.5rem 0;
}

.result-type-badge {
    display: inline-block;
    background: rgba(139, 69, 19, 0.3);
    color: #c8a882;
    font-size: 0.85rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    margin-right: 0.5rem;
    margin-bottom: 0.75rem;
}

.result-response-count {
    color: #8b6b4a;
    font-size: 0.95rem;
}

.result-bars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.result-bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.result-bar-label {
    color: #c8a882;
    font-size: 1rem;
    min-width: 100px;
    flex-shrink: 0;
}

.result-bar-track {
    flex: 1;
    height: 20px;
    background: #1a0f05;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #2d1a0a;
}

.result-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b4513, #ffd700);
    border-radius: 10px;
    transition: width 0.4s ease;
    min-width: 2px;
}

.result-bar-yes { background: linear-gradient(90deg, #27ae60, #2ecc71); }
.result-bar-no  { background: linear-gradient(90deg, #c0392b, #e74c3c); }

.result-bar-count {
    color: #8b6b4a;
    font-size: 0.95rem;
    min-width: 60px;
    text-align: right;
}

.result-rating-summary {
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
}

.result-rating-avg {
    color: #a0522d;
    font-size: 1.5rem;
    font-weight: bold;
}

.result-rating-count {
    color: #8b6b4a;
    font-size: 1rem;
    margin-left: 0.5rem;
}

.text-responses-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.text-response-item {
    background: #1a0f05;
    border: 1px solid #2d1a0a;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.response-username {
    color: #8b4513;
    font-weight: 600;
    font-size: 0.95rem;
    display: block;
    margin-bottom: 0.4rem;
}

.response-text {
    color: #c8a882;
    font-size: 1rem;
    margin: 0;
    line-height: 1.5;
    white-space: pre-wrap;
}

.no-answers {
    color: #8b6b4a;
    font-style: italic;
}

/* ─── Survey Admin List ──────────────────────────────────────────── */
.survey-admin-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #2d1a0a;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    background: #1a0f05;
}

.survey-admin-row.survey-closed {
    opacity: 0.7;
}

.survey-admin-info {
    flex: 1;
}

.survey-admin-info strong {
    color: #ffd700;
    display: block;
    margin-bottom: 0.3rem;
}

.survey-admin-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: #8b6b4a;
    font-size: 0.95rem;
    margin-top: 0.4rem;
}

.survey-admin-meta i { color: #8b4513; margin-right: 0.25rem; }

.survey-admin-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.survey-status-badge {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    margin-left: 0.5rem;
}

.badge-open   { background: rgba(80, 180, 80, 0.2); color: #5cb85c; border: 1px solid #5cb85c44; }
.badge-closed { background: rgba(180, 80, 80, 0.2); color: #e74c3c; border: 1px solid #e74c3c44; }

/* ─── Create Survey Modal ────────────────────────────────────────── */
.form-section {
    margin-bottom: 1.75rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid #2d1a0a;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section-title {
    color: #c8a882;
    font-size: 1rem;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #4a2c0a;
}

.lang-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.lang-field-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.lang-tag {
    flex-shrink: 0;
    width: 2rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #8b6b4a;
    background: #2d1a0a;
    border: 1px solid #4a2c0a;
    border-radius: 4px;
    padding: 0.35rem 0;
    margin-top: 0.15rem;
    letter-spacing: 0.03em;
}

.lang-field-row .survey-input,
.lang-field-row .survey-textarea {
    flex: 1;
}

.question-lang-fields {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.question-lang-fields .lang-field-row .survey-input {
    font-size: 0.95rem;
}

/* Survey modal overrides for dark background */
#create-survey-modal .form-group {
    margin-bottom: 1rem;
}

#create-survey-modal .form-group label {
    color: #c8a882;
    font-size: 1rem;
    margin-bottom: 0.4rem;
}

.input-hint {
    color: #8b6b4a;
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

.reward-customization-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.reward-customization-row .form-group {
    flex: 1;
    min-width: 150px;
}

.color-input {
    width: 60px;
    height: 36px;
    padding: 2px;
    border: 1px solid #4a2c0a;
    border-radius: 6px;
    background: #1a0f05;
    cursor: pointer;
}

.reward-preview-container {
    margin-top: 0.75rem;
}

.survey-question-builder {
    background: #1a0f05;
    border: 1px solid #2d1a0a;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.question-builder-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.question-number {
    color: #c8a882;
    font-weight: 600;
    min-width: 20px;
    flex-shrink: 0;
}

.question-text-input {
    flex: 1;
    min-width: 160px;
}

.question-type-select {
    padding: 0.5rem;
    background: #1a0f05;
    border: 1px solid #4a2c0a;
    border-radius: 6px;
    color: #e8d5b7;
    font-size: 0.9rem;
}

.required-check-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: #c8a882;
    font-size: 0.85rem;
    cursor: pointer;
    flex-shrink: 0;
}

.options-builder {
    margin-top: 0.75rem;
}

.options-label {
    color: #8b6b4a;
    font-size: 0.85rem;
    margin: 0 0 0.4rem 0;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.option-row .survey-input {
    width: 100%;
}

.empty-state,
.error-state {
    text-align: center;
    padding: 2rem;
    color: #8b6b4a;
    font-style: italic;
}

.error-state { color: #e74c3c; }

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-input {
    color: #e8d5b7;
    font-size: 0.9rem;
}
