/* Custom Modern System Variables */
:root {
    --bg-dark: #0B0F19;
    --primary-indigo: #6366F1;
    --primary-purple: #8B5CF6;
    --accent-pink: #EC4899;
    --accent-cyan: #06B6D4;
    
    --text-primary: #F9FAFB;
    --text-muted: #9CA3AF;
    --text-dark-muted: #6B7280;
    
    --glass-background: rgba(17, 24, 39, 0.45);
    --glass-border: rgba(255, 255, 255, 0.07);
    --glass-border-hover: rgba(255, 255, 255, 0.15);
    
    --font-stack: 'Inter', system-ui, -apple-system, sans-serif;
    --easing-premium: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Global Reset & Base Layout */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-stack);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Ambient Radial Mesh Background */
.glow-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.15;
    mix-blend-mode: screen;
    animation: floatingMesh 25s infinite alternate var(--easing-premium);
}

.blob-purple {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-purple) 0%, transparent 80%);
    top: -200px;
    left: -100px;
}

.blob-pink {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-pink) 0%, transparent 80%);
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

.blob-cyan {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 80%);
    top: 40%;
    right: 15%;
    animation-delay: -10s;
}

@keyframes floatingMesh {
    0% { transform: translate(0px, 0px) scale(1); }
    50% { transform: translate(40px, -60px) scale(1.1); }
    100% { transform: translate(-20px, 20px) scale(0.95); }
}

/* Base UI Wrapper */
.app-container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 4rem 2rem 2rem 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
}

/* Micro Elements & Typography */
.badge {
    display: inline-flex;
    padding: 0.45rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 100px;
    color: #A5B4FC;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, #FFF 30%, var(--primary-indigo) 70%, var(--accent-pink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Section 1: Hero Configurations */
.hero-section {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 4.5rem auto;
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 1.25rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-weight: 400;
    margin-bottom: 2rem;
}

/* Premium Component Buttons */
.btn {
    font-family: var(--font-stack);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--easing-premium);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-indigo), var(--primary-purple));
    border: none;
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 28px rgba(99, 102, 241, 0.45);
    transform: translateY(-2px);
}

/* Advanced Glassmorphism Cards */
.glass-card {
    background: var(--glass-background);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-indigo);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.card-description {
    font-size: 0.85rem;
    color: var(--text-dark-muted);
    margin-top: 0.15rem;
}

/* Section 2: Poll Layout Architecture */
.poll-question {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
}

.poll-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.poll-pill {
    position: relative;
    cursor: pointer;
}

.poll-pill input {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}

.pill-content {
    display: flex;
    align-items: center;
    padding: 1.15rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    transition: all 0.25s var(--easing-premium);
}

.radio-indicator {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--text-dark-muted);
    margin-right: 1rem;
    position: relative;
    transition: all 0.25s var(--easing-premium);
    flex-shrink: 0;
}

.option-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.25s var(--easing-premium);
}

/* Interactive Pill Selection States */
.poll-pill:hover .pill-content {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border-hover);
    transform: translateY(-1px);
}

.poll-pill input:checked + .pill-content {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

.poll-pill input:checked + .pill-content .radio-indicator {
    border-color: var(--primary-indigo);
}

.poll-pill input:checked + .pill-content .radio-indicator::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary-indigo);
    border-radius: 50%;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}

.poll-pill input:checked + .pill-content .option-text {
    color: var(--text-primary);
}

.submit-vote-btn {
    width: 100%;
    padding: 1.1rem;
}

/* Section 3: High-Fidelity Dashboard Framework */
.dashboard-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.metrics-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.metric-mini-card {
    padding: 1.75rem;
    border-radius: 20px;
}

.mini-card-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.mini-card-val {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-top: 0.5rem;
    background: linear-gradient(135deg, #FFF, #D1D5DB);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Dashboard Specific Charts UI */
.dashboard-card-header {
    justify-content: space-between;
    margin-bottom: 3rem;
}

.live-pulse-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.2);
    padding: 0.4rem 0.85rem;
    border-radius: 100px;
}

.pulse-dot {
    width: 7px;
    height: 7px;
    background-color: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-cyan);
    animation: simplePulse 2s infinite ease-in-out;
}

@keyframes simplePulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.pulse-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: #22D3EE;
    text-transform: uppercase;
}

/* Data Graphic Render Layout */
.chart-engine-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.chart-item-row {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.chart-row-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 500;
}

.chart-row-title {
    color: var(--text-primary);
}

.chart-row-percentage {
    color: var(--text-muted);
    font-weight: 600;
}

.chart-track-bg {
    width: 100%;
    height: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 100px;
    overflow: hidden;
}

.chart-fill-bar {
    height: 100%;
    width: 0%; /* Dynamic assignment via JS engine */
    background: linear-gradient(90deg, var(--primary-indigo), var(--primary-purple));
    border-radius: 100px;
    transition: width 1.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Section 4: Premium Smart Insights */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.insight-card {
    padding: 2.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.insight-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pink-bg { background: rgba(236, 72, 153, 0.1); border: 1px solid rgba(236, 72, 153, 0.2); }
.cyan-bg { background: rgba(6, 182, 212, 0.1); border: 1px solid rgba(6, 182, 212, 0.2); }

.insight-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.insight-body {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Custom Highlight Card Borders */
.border-glow-pink:hover { border-color: rgba(236, 72, 153, 0.3); }
.border-glow-cyan:hover { border-color: rgba(6, 182, 212, 0.3); }

/* Unified Loading Mechanism Styles */
.loader-container {
    text-align: center;
    padding: 4rem 0;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top-color: var(--primary-indigo);
    border-radius: 50%;
    margin: 0 auto 1.5rem auto;
    animation: rotateLoop 0.8s linear infinite;
}

@keyframes rotateLoop {
    to { transform: rotate(360deg); }
}

.loader-container p {
    color: var(--text-dark-muted);
    font-size: 0.95rem;
}

/* Premium Footnotes & Structural Breaks */
.app-footer {
    margin-top: 6rem;
}

.footer-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
    margin-bottom: 2rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-brand {
    font-size: 0.85rem;
    color: var(--text-dark-muted);
}

.developer-credit-tag {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    font-size: 0.85rem;
    color: var(--text-dark-muted);
    transition: color 0.2s var(--easing-premium);
}

.designer-name {
    color: var(--text-muted);
    font-weight: 600;
    transition: color 0.2s var(--easing-premium);
}

.developer-credit-tag:hover .designer-name {
    color: var(--accent-pink);
}

/* Advanced Core Micro-Animations */
.fade-in {
    opacity: 0;
    transform: translateY(14px);
    animation: premiumFadeIn 0.8s var(--easing-premium) forwards;
}

.fade-in-delayed {
    opacity: 0;
    transform: translateY(18px);
    animation: premiumFadeIn 0.8s var(--easing-premium) 0.2s forwards;
}

@keyframes premiumFadeIn {
    to { opacity: 1; transform: translateY(0); }
}

/* Global Switch States Class Utility */
.hidden {
    display: none !important;
}

/* Modern Responsive Intercept Grid Breakpoints */
@media (max-width: 768px) {
    .app-container { padding: 2rem 1rem 1rem 1rem; }
    .hero-title { font-size: 2.75rem; }
    .poll-options-grid, .insights-grid { grid-template-columns: 1fr; }
    .metrics-summary-grid { grid-template-columns: 1fr; gap: 1rem; }
    .glass-card { padding: 2rem 1.5rem; }
    .footer-content { flex-direction: column; gap: 1rem; text-align: center; }
}