/* ==========================================================================
   POLL Feedback Survey & Admin Dashboard Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');
@import url('https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css');

:root {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --bg-glass: rgba(30, 41, 59, 0.85);
    --border-color: #334155;
    --border-focus: #6366f1;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.15);
    
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --accent-sky: #06b6d4;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
    
    --font-head: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="light"] {
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-glass: rgba(255, 255, 255, 0.9);
    --border-color: #e2e8f0;
    --border-focus: #4f46e5;
    
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-dim: #94a3b8;
    
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: rgba(79, 70, 229, 0.1);
    
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.12);
}

/* Top Toolbar & Theme Toggle */
.top-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-icon-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 30px;
}

.btn-icon-text:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.btn-theme-toggle:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
    color: var(--primary);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 60px;
}

/* Base Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 20px;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Header & Banner */
.survey-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 30px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(16, 185, 129, 0.1) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.survey-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.survey-title {
    font-family: var(--font-head);
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .survey-title {
    background: linear-gradient(135deg, #0f172a 0%, #4f46e5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.survey-desc {
    color: var(--text-muted);
    font-size: 15px;
    max-width: 600px;
    margin: 0 auto;
}

/* Progress Bar */
.progress-wrapper {
    margin-bottom: 30px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.progress-track {
    width: 100%;
    height: 8px;
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent-emerald) 100%);
    border-radius: 10px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Question Cards */
.question-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.question-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
}

.question-number {
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.question-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.question-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Option Grids & Controls */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-main);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    user-select: none;
}

.option-label:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

.option-label input[type="radio"],
.option-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-dim);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    display: grid;
    place-content: center;
    flex-shrink: 0;
}

.option-label input[type="radio"] {
    border-radius: 50%;
}

.option-label input[type="radio"]:checked,
.option-label input[type="checkbox"]:checked {
    border-color: var(--primary);
    background-color: var(--primary);
}

.option-label input[type="radio"]:checked::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: white;
}

.option-label input[type="checkbox"]:checked::before {
    content: '✓';
    color: white;
    font-size: 13px;
    font-weight: 800;
}

.option-label.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--text-main);
}

/* Other Input Field */
.other-input-wrapper {
    margin-top: 12px;
    display: none;
}

.other-input-wrapper.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Text Inputs & Textarea */
.form-input,
.form-textarea {
    width: 100%;
    background: var(--bg-main);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
}

.form-input:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-textarea {
    min-height: 110px;
    resize: vertical;
}

/* NPS Rating Selector */
.nps-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nps-grid {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    gap: 8px;
}

@media (max-width: 640px) {
    .nps-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.nps-btn {
    height: 48px;
    background: var(--bg-main);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-head);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nps-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.nps-btn.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

/* NPS Color Rating Themes on Selected */
.nps-btn[data-score="0"].selected,
.nps-btn[data-score="1"].selected,
.nps-btn[data-score="2"].selected,
.nps-btn[data-score="3"].selected,
.nps-btn[data-score="4"].selected,
.nps-btn[data-score="5"].selected,
.nps-btn[data-score="6"].selected {
    background: var(--accent-rose);
    border-color: var(--accent-rose);
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.4);
}

.nps-btn[data-score="7"].selected,
.nps-btn[data-score="8"].selected {
    background: var(--accent-amber);
    border-color: var(--accent-amber);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.nps-btn[data-score="9"].selected,
.nps-btn[data-score="10"].selected {
    background: var(--accent-emerald);
    border-color: var(--accent-emerald);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.nps-legend {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    outline: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

.btn-danger {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: var(--accent-rose);
}

.btn-danger:hover {
    background: var(--accent-rose);
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

/* Submit Footer */
.submit-wrapper {
    margin-top: 30px;
    text-align: center;
}

/* Success Card */
.success-card {
    display: none;
    text-align: center;
    padding: 60px 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.4s ease;
}

.success-icon {
    font-size: 64px;
    color: var(--accent-emerald);
    margin-bottom: 20px;
}

.success-title {
    font-family: var(--font-head);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
}

/* Footer Link */
.footer-admin-link {
    text-align: center;
    margin-top: 40px;
    font-size: 13px;
    color: var(--text-dim);
}

.footer-admin-link a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
}

.footer-admin-link a:hover {
    color: var(--primary);
}

/* ==========================================================================
   Admin Dashboard Layout
   ========================================================================== */

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.admin-title {
    font-family: var(--font-head);
    font-size: 26px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* KPI Cards Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.kpi-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.kpi-value {
    font-family: var(--font-head);
    font-size: 36px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 8px;
}

.kpi-sub {
    font-size: 13px;
    color: var(--text-dim);
}

/* Chart Cards Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.chart-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-container {
    position: relative;
    height: 260px;
    width: 100%;
}

/* Responses Data Table */
.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.table-header-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    max-width: 320px;
    width: 100%;
}

.search-box input {
    padding-left: 38px;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-main);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
}

.data-table tr:hover td {
    background: var(--bg-card-hover);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-emerald {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
}

.badge-amber {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-amber);
}

.badge-rose {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
}

.badge-indigo {
    background: var(--primary-light);
    color: var(--primary);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
}

.page-btns {
    display: flex;
    gap: 6px;
}

/* Modal Window */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: none;
    place-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: grid;
    animation: fadeIn 0.25s ease;
}

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 550px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.modal-title {
    font-family: var(--font-head);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-main);
}

.detail-row {
    margin-bottom: 16px;
}

.detail-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 15px;
    color: var(--text-main);
    background: var(--bg-main);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideUp 0.3s ease;
}

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

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