/* ======================================================
   AM INTERACTIVE — CORE DESIGN SYSTEM & BASE STYLES
   Professional Dark Conference Interface
   ====================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@400;600;700;800&display=swap');

:root {
    /* Color Palette */
    --bg-base: #08090e;
    --bg-surface: #10121a;
    --bg-card: #151822;
    --bg-card-hover: #1c2130;
    --bg-elevated: #1f2434;
    --bg-input: #0b0c12;
    
    /* Accents */
    --accent-primary: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --accent-purple: #8b5cf6;

    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-highlight: #ffffff;

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-medium: rgba(255, 255, 255, 0.12);
    --border-active: rgba(59, 130, 246, 0.45);

    /* Glass & Shadows */
    --glass-bg: rgba(16, 18, 26, 0.82);
    --glass-blur: blur(16px);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
    --glow-emerald: 0 0 18px rgba(16, 185, 129, 0.35);
    --glow-primary: 0 0 20px rgba(59, 130, 246, 0.35);

    /* Typography */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-display: 'Outfit', var(--font-sans);
    
    /* Radii */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Background Subtle Gradient Mesh */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    background: 
        radial-gradient(circle at 15% 15%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(16, 185, 129, 0.05) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.04) 0%, transparent 60%);
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--text-highlight);
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    border: none;
    outline: none;
    cursor: pointer;
    background: transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

input, textarea, select {
    font-family: inherit;
    outline: none;
}

/* Status Indicators */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-muted);
}

.status-dot.online {
    background-color: var(--accent-emerald);
    box-shadow: 0 0 10px var(--accent-emerald);
}

.status-dot.live {
    background-color: var(--accent-rose);
    box-shadow: 0 0 12px var(--accent-rose);
    animation: pulse 1.8s infinite;
}

.status-dot.warning {
    background-color: var(--accent-amber);
    box-shadow: 0 0 10px var(--accent-amber);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.15); }
}

/* Reconnection banner */
.reconnect-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--accent-amber);
    color: var(--accent-amber);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    font-weight: 600;
}

.reconnect-toast.active {
    display: flex;
}

/* Primary and Secondary Action Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #ffffff;
    color: #090a0f;
    padding: 12px 22px;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.15);
}

.btn-primary:hover:not(:disabled) {
    background: #e2e8f0;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 255, 255, 0.22);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-accent {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--accent-primary), #2563eb);
    color: #ffffff;
    padding: 12px 22px;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 700;
    box-shadow: var(--glow-primary);
}

.btn-accent:hover:not(:disabled) {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(244, 63, 94, 0.12);
    color: #fda4af;
    border: 1px solid rgba(244, 63, 94, 0.25);
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
}

.btn-danger:hover:not(:disabled) {
    background: rgba(244, 63, 94, 0.22);
    border-color: rgba(244, 63, 94, 0.4);
}

.btn-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.14);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.28);
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
}

.btn-success:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.24);
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 5, 8, 0.78);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-backdrop.active {
    display: flex;
}

.modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    width: min(100%, 540px);
    padding: 32px;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ======================================================
   DYNAMIC COLOR THEMES
   ====================================================== */
[data-theme="emerald"] {
    --accent-primary: #059669;
    --accent-cyan: #10b981;
    --border-active: rgba(16, 185, 129, 0.5);
    --glow-primary: 0 0 20px rgba(16, 185, 129, 0.4);
}

[data-theme="purple"] {
    --accent-primary: #7c3aed;
    --accent-cyan: #a855f7;
    --border-active: rgba(168, 85, 247, 0.5);
    --glow-primary: 0 0 20px rgba(168, 85, 247, 0.4);
}

[data-theme="amber"] {
    --accent-primary: #d97706;
    --accent-cyan: #f59e0b;
    --border-active: rgba(245, 158, 11, 0.5);
    --glow-primary: 0 0 20px rgba(245, 158, 11, 0.4);
}

[data-theme="rose"] {
    --accent-primary: #e11d48;
    --accent-cyan: #f43f5e;
    --border-active: rgba(244, 63, 94, 0.5);
    --glow-primary: 0 0 20px rgba(244, 63, 94, 0.4);
}

/* Timer Urgency Pulse */
@keyframes timerPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.85; }
}

.timer-urgent {
    animation: timerPulse 0.9s infinite ease-in-out !important;
}

/* Winning Poll Option Highlight & Celebration */
.winner-option {
    border: 2px solid #f59e0b !important;
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.35) !important;
    position: relative;
    overflow: hidden;
}

.winner-option .option-progress-fill,
.winner-option .stage-bar-fill,
.winner-option .admin-result-fill {
    background: linear-gradient(90deg, #f59e0b, #fbbf24) !important;
}

.winner-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-left: 8px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

