:root {
    --bg-main: #0c1017;
    --bg-surface: #141b26;
    --bg-elevated: #1c2638;
    --bg-input: #172238;
    --bg-hover: rgba(56, 189, 248, 0.08);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(56, 189, 248, 0.3);
    
    --accent-cyan: #38bdf8;
    --accent-indigo: #818cf8;
    --accent-teal: #2dd4bf;
    --accent-emerald: #34d399;
    --accent-amber: #fbbf24;
    --accent-rose: #f43f5e;

    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.25);
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --bg-elevated: #f1f5f9;
    --bg-input: #e2e8f0;
    --bg-hover: rgba(2, 132, 199, 0.05);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(2, 132, 199, 0.3);

    --accent-cyan: #0284c7;
    --accent-indigo: #4f46e5;
    --accent-teal: #0d9488;
    --accent-emerald: #059669;

    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-dim: #94a3b8;

    --shadow-card: 0 10px 25px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    min-height: 100vh;
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: background 0.3s ease, color 0.3s ease;
}

/* Header & Navbar */
header {
    width: 100%;
    height: 70px;
    padding: 0 2rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 800;
    font-size: 1.25rem;
}
.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.btn-icon:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

/* Survey Page Container */
.container {
    max-width: 800px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}

.survey-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-card);
}
.survey-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.survey-header h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-main), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.survey-header p {
    color: var(--text-muted);
    font-size: 0.98rem;
}

/* Form Groups */
.form-group {
    margin-bottom: 2rem;
}
.form-label {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: var(--text-main);
}
.form-label span.req {
    color: var(--accent-rose);
    margin-left: 4px;
}

/* Options Grid / Radio Pills */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}
.option-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.92rem;
    color: var(--text-muted);
}
.option-pill:hover, .option-pill.active {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    background: var(--bg-hover);
}
.option-pill input[type="radio"],
.option-pill input[type="checkbox"] {
    accent-color: var(--accent-cyan);
    width: 16px;
    height: 16px;
}

/* Star Rating Rating Group */
.rating-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 1rem 0;
}
.star-btn {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 1.3rem;
    font-weight: 800;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.star-btn:hover, .star-btn.active {
    background: rgba(251, 191, 36, 0.15);
    border-color: var(--accent-amber);
    color: var(--accent-amber);
    transform: scale(1.1);
}

/* Inputs & Textarea */
textarea, input[type="text"], input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}
textarea:focus, input[type="text"]:focus, input[type="password"]:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}
textarea {
    height: 110px;
    resize: vertical;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.3);
    transition: var(--transition);
}
.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(56, 189, 248, 0.4);
}

/* Admin Dashboard Specific */
.admin-container {
    max-width: 1200px;
    margin: 2.5rem auto;
    padding: 0 1.5rem;
}
.dash-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.metric-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.8rem;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-card);
}
.metric-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
}
.metric-val {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--text-main);
    font-family: var(--font-mono);
}
.metric-lbl {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Data Table */
.table-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.8rem;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}
.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
}

table.poll-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
table.poll-table th, table.poll-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}
table.poll-table th {
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-weight: 700;
}
table.poll-table tr:hover td {
    background: var(--bg-hover);
}

.badge-rating {
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(251, 191, 36, 0.15);
    color: var(--accent-amber);
    font-weight: 700;
    font-size: 0.85rem;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-overlay.hidden { display: none; }
.login-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-card);
}

/* Toast */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    padding: 12px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border-hover);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
