/* ── Admin Page Styles ─────────────────────────────────────── */

/* Dark base for all form surfaces */
.admin-access-denied {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

/* Tab bar */
.admin-tab-bar {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid rgba(212, 164, 65, 0.3);
    overflow-x: auto;
}

.admin-tab {
    padding: 0.6rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-family: var(--font-body, 'Montserrat', sans-serif);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}

.admin-tab:hover { color: #d4a441; }

.admin-tab.active {
    color: #d4a441;
    border-bottom-color: #d4a441;
    font-weight: 600;
}

/* Panels */
.admin-panel { animation: fadeIn 0.2s ease; }

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

.admin-panel-title {
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.admin-panel-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* Form blocks */
.admin-form-block {
    padding: 1.5rem;
    border: 1px solid rgba(212, 164, 65, 0.2);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    background: rgba(6, 20, 14, 0.6);
}

.admin-list-block { margin-top: 1.5rem; }

.admin-form-heading {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.admin-field { margin-bottom: 1rem; }

.admin-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(212, 164, 65, 0.8);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Inputs */
.admin-input,
.admin-select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(212, 164, 65, 0.25);
    border-radius: 6px;
    font-family: var(--font-body, 'Montserrat', sans-serif);
    font-size: 0.9rem;
    background: rgba(6, 24, 18, 0.8);
    color: var(--text-primary, #e8dfc0);
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.admin-input:focus,
.admin-select:focus {
    outline: none;
    border-color: #d4a441;
    background: rgba(6, 24, 18, 0.95);
}

.admin-input::placeholder { color: rgba(200, 180, 130, 0.4); }

.admin-select option {
    background: #0a2018;
    color: #e8dfc0;
}

.admin-textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(212, 164, 65, 0.25);
    border-radius: 6px;
    font-family: var(--font-body, 'Montserrat', sans-serif);
    font-size: 0.9rem;
    background: rgba(6, 24, 18, 0.8);
    color: var(--text-primary, #e8dfc0);
    resize: vertical;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.admin-textarea:focus {
    outline: none;
    border-color: #d4a441;
    background: rgba(6, 24, 18, 0.95);
}

.admin-textarea::placeholder { color: rgba(200, 180, 130, 0.4); }

/* Buttons */
.admin-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.admin-btn {
    padding: 0.55rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-family: var(--font-body, 'Montserrat', sans-serif);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, background 0.2s;
}

.admin-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.admin-btn-primary {
    background: #a0832a;
    color: #fff;
}
.admin-btn-primary:hover:not(:disabled) { background: #c9a43a; }

.admin-btn-secondary {
    background: transparent;
    color: #d4a441;
    border: 1.5px solid rgba(212, 164, 65, 0.5);
}
.admin-btn-secondary:hover:not(:disabled) {
    border-color: #d4a441;
    background: rgba(212, 164, 65, 0.08);
}

.admin-btn-sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; }

.admin-btn-danger {
    background: transparent;
    color: #e07070;
    border: 1.5px solid rgba(220, 80, 80, 0.5);
    padding: 0.3rem 0.7rem;
    font-size: 0.78rem;
}
.admin-btn-danger:hover:not(:disabled) {
    background: rgba(220, 80, 80, 0.12);
    border-color: #e07070;
}

.admin-btn-icon {
    background: none;
    border: none;
    color: rgba(212, 164, 65, 0.5);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    line-height: 1;
    flex-shrink: 0;
}
.admin-btn-icon:hover { color: #e07070; background: rgba(220, 80, 80, 0.1); }

/* Status feedback */
.admin-status { font-size: 0.85rem; font-weight: 500; }
.admin-status.success { color: #5cb87a; }
.admin-status.error   { color: #e07070; }

/* ── FAQ list ────────────────────────────────────────────────── */
.faq-admin-item {
    border: 1px solid rgba(212, 164, 65, 0.2);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    background: rgba(6, 20, 14, 0.5);
    transition: border-color 0.2s;
}

.faq-admin-item.editing {
    border-color: rgba(212, 164, 65, 0.55);
    background: rgba(10, 32, 20, 0.7);
}

.faq-admin-header { display: flex; align-items: flex-start; gap: 0.75rem; }

.faq-admin-text { flex: 1; min-width: 0; }

.faq-admin-question {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary, #e8dfc0);
    margin-bottom: 0.25rem;
}

.faq-admin-answer {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

.faq-admin-btns { display: flex; gap: 0.4rem; flex-shrink: 0; }

.faq-admin-edit-form {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.faq-edit-actions { display: flex; gap: 0.5rem; }

/* ── Survey list ─────────────────────────────────────────────── */
.survey-admin-item {
    border: 1px solid rgba(212, 164, 65, 0.2);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    background: rgba(6, 20, 14, 0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.survey-admin-info { flex: 1; min-width: 0; }

.survey-admin-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary, #e8dfc0);
}

.survey-admin-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.survey-admin-active {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(92, 184, 122, 0.18);
    color: #5cb87a;
    border: 1px solid rgba(92, 184, 122, 0.35);
    margin-left: 0.5rem;
}

/* ── Survey question builder ─────────────────────────────────── */
.survey-q-row {
    border: 1px solid rgba(212, 164, 65, 0.18);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: rgba(4, 16, 10, 0.5);
}

.survey-q-top {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.survey-q-top .admin-input { flex: 1; min-width: 180px; }

.survey-q-type-select {
    width: auto;
    min-width: 160px;
    flex-shrink: 0;
}

.survey-q-options,
.survey-q-rating {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(212, 164, 65, 0.12);
}

.survey-option-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.4rem;
}

.survey-option-row .admin-input { flex: 1; }

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

.survey-rating-config label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    white-space: nowrap;
}

.survey-rating-max { width: auto; min-width: 80px; }

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

.survey-results-block {
    border-top: 1px solid rgba(212, 164, 65, 0.2);
    padding-top: 1.5rem;
}

.survey-results-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.survey-results-summary {
    margin: -0.45rem 0 0;
    color: var(--text-secondary);
    font-size: 0.86rem;
}

.survey-results-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.survey-results-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.survey-metric {
    border: 1px solid rgba(212, 164, 65, 0.2);
    border-radius: 8px;
    padding: 0.9rem 1rem;
    background: rgba(6, 20, 14, 0.52);
}

.survey-metric-value {
    display: block;
    font-size: 1.45rem;
    font-weight: 700;
    color: #d4a441;
    line-height: 1;
}

.survey-metric-label {
    display: block;
    margin-top: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.survey-results-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.survey-result-card {
    border: 1px solid rgba(212, 164, 65, 0.18);
    border-radius: 8px;
    padding: 1rem;
    background: rgba(4, 16, 10, 0.52);
}

.survey-result-question {
    font-weight: 700;
    color: var(--text-primary, #e8dfc0);
    margin-bottom: 0.3rem;
}

.survey-result-meta {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.8rem;
}

.survey-result-row {
    display: grid;
    grid-template-columns: minmax(110px, 0.85fr) minmax(120px, 1.4fr) auto;
    gap: 0.65rem;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-primary, #e8dfc0);
    margin-bottom: 0.55rem;
}

.survey-result-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.survey-result-bar {
    height: 0.55rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(212, 164, 65, 0.12);
}

.survey-result-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #9d7a21, #d4a441);
}

.survey-result-count {
    color: var(--text-secondary);
    font-size: 0.78rem;
    text-align: right;
    white-space: nowrap;
}

.survey-text-responses {
    display: grid;
    gap: 0.5rem;
    max-height: 280px;
    overflow: auto;
    padding-right: 0.2rem;
}

.survey-text-response {
    border-left: 3px solid rgba(212, 164, 65, 0.45);
    padding: 0.5rem 0.65rem;
    background: rgba(212, 164, 65, 0.06);
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

.survey-responses-detail {
    margin-top: 1rem;
    border: 1px solid rgba(212, 164, 65, 0.18);
    border-radius: 8px;
    background: rgba(6, 20, 14, 0.45);
}

.survey-responses-detail summary {
    cursor: pointer;
    padding: 0.85rem 1rem;
    color: #d4a441;
    font-weight: 700;
}

.survey-response-table-wrap {
    overflow-x: auto;
    border-top: 1px solid rgba(212, 164, 65, 0.16);
}

.survey-response-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    color: var(--text-primary, #e8dfc0);
    font-size: 0.84rem;
}

.survey-response-table th,
.survey-response-table td {
    border-bottom: 1px solid rgba(212, 164, 65, 0.12);
    padding: 0.65rem 0.75rem;
    text-align: left;
    vertical-align: top;
}

.survey-response-table th {
    color: rgba(212, 164, 65, 0.86);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(4, 16, 10, 0.75);
}

.survey-response-answer {
    white-space: pre-wrap;
    color: var(--text-secondary);
}

/* ── Empty state ─────────────────────────────────────────────── */
.admin-empty {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 1rem 0;
    font-style: italic;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
    .admin-tab { padding: 0.5rem 0.85rem; font-size: 0.82rem; }
    .faq-admin-header { flex-direction: column; }
    .faq-admin-btns { align-self: flex-end; }
    .survey-admin-item,
    .survey-results-header {
        flex-direction: column;
        align-items: stretch;
    }
    .survey-admin-actions,
    .survey-results-actions {
        justify-content: flex-start;
    }
    .survey-results-metrics,
    .survey-results-grid {
        grid-template-columns: 1fr;
    }
    .survey-result-row {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }
    .survey-result-count {
        text-align: left;
    }
    .survey-q-top { flex-direction: column; align-items: stretch; }
    .survey-q-type-select { width: 100%; }
}
