/* ========================================
   BlazingBeard Poll - Premium Design System
   ======================================== */

/* CSS Variables */
:root {
    --primary: #f97316;
    --primary-light: #fb923c;
    --primary-dark: #ea580c;
    --secondary: #8b5cf6;
    --secondary-light: #a78bfa;
    --success: #22c55e;
    --warning: #eab308;
    --danger: #ef4444;
    
    --bg-dark: #0a0a0f;
    --bg-card: rgba(255, 255, 255, 0.03);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    
    --shadow-glow: 0 0 60px rgba(249, 115, 22, 0.3);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

/* Base */
html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    /* Safe area for notched devices */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Aurora Background */
.aurora-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
}

.aurora {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: aurora 20s ease-in-out infinite;
}

.aurora-1 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    top: -200px;
    left: -100px;
    animation-delay: 0s;
}

.aurora-2 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    bottom: -150px;
    right: -100px;
    animation-delay: -7s;
}

.aurora-3 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes aurora {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.4; }
    25% { transform: translate(50px, -30px) scale(1.1); opacity: 0.6; }
    50% { transform: translate(-30px, 50px) scale(0.9); opacity: 0.5; }
    75% { transform: translate(-50px, -20px) scale(1.05); opacity: 0.55; }
}

/* Particles */
.particles {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: rgba(249, 115, 22, 0.6);
    border-radius: 50%;
    bottom: -10px;
    animation: float-up linear infinite;
}

@keyframes float-up {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

/* Glass Morphism */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

/* Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* ========================================
   Navigation
   ======================================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 0;
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    border-bottom: 1px solid var(--glass-border);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.admin-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
}

.admin-badge .admin-icon {
    font-size: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-family: 'Space Grotesk', sans-serif;
}

.logo-icon {
    font-size: 2rem;
    animation: flame 1.5s ease-in-out infinite;
}

@keyframes flame {
    0%, 100% { transform: scale(1) rotate(-5deg); }
    50% { transform: scale(1.1) rotate(5deg); }
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-accent {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    min-height: 44px; /* Touch-friendly minimum */
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

/* Active state for touch devices */
.btn:active {
    transform: scale(0.98);
}

.btn-icon {
    font-size: 1.1rem;
}

.btn-glow {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.4);
}

.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(249, 115, 22, 0.5);
}

.btn-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-glow:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.4);
}

.btn-shine {
    position: relative;
    overflow: hidden;
}

.btn-shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0) 40%,
        rgba(255,255,255,0.3) 50%,
        rgba(255,255,255,0) 60%,
        rgba(255,255,255,0) 100%
    );
    transform: rotate(-45deg);
    animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) rotate(-45deg); }
    100% { transform: translateX(100%) rotate(-45deg); }
}

.btn-arrow {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-fast);
}

.btn:hover .btn-arrow {
    transform: translateX(4px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

.btn-ghost:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #16a34a 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #ca8a04 100%);
    color: #1a1a1a;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.05rem;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    flex: 1;
    padding: 40px 0 60px;
    padding-top: calc(40px + env(safe-area-inset-top, 0px));
}

@media (max-width: 480px) {
    .main-content {
        padding: 24px 0 40px;
    }
}

/* Alerts */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.alert-icon {
    font-size: 1.2rem;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    text-align: center;
    padding: 60px 0 80px;
}

.hero-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 24px;
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 20px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.stat-item {
    padding: 20px 32px;
    border-radius: var(--radius-lg);
    text-align: center;
}

.stat-number {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ========================================
   Section Header
   ======================================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
}

.section-icon {
    font-size: 1.3rem;
}

.filter-pills {
    display: flex;
    gap: 8px;
}

.pill {
    padding: 8px 20px;
    border-radius: 50px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pill:hover {
    background: rgba(255, 255, 255, 0.1);
}

.pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ========================================
   Poll Cards Grid
   ======================================== */
.polls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.poll-card {
    position: relative;
    padding: 28px;
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    overflow: hidden;
}

/* Desktop hover effect */
@media (hover: hover) {
    .poll-card:hover {
        transform: translateY(-8px);
        box-shadow: var(--shadow-card);
    }
    
    .poll-card:hover .card-glow {
        opacity: 1;
    }
}

/* Touch feedback for mobile */
.poll-card:active {
    transform: scale(0.98);
}

.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--primary));
    background-size: 200% 100%;
    animation: gradient-shift 3s linear infinite;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.poll-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.poll-badges-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.poll-lock-badge {
    font-size: 0.9rem;
    opacity: 0.7;
}

.poll-type-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.poll-type-badge.single {
    background: rgba(139, 92, 246, 0.2);
    color: var(--secondary-light);
}

.poll-type-badge.multi {
    background: rgba(6, 182, 212, 0.2);
    color: #22d3ee;
}

.poll-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.poll-status.active {
    color: var(--success);
}

.poll-status.active .status-dot {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: pulse 2s ease-in-out infinite;
}

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

.poll-status.closed {
    color: var(--text-muted);
}

.poll-status.closed .status-dot {
    background: var(--text-muted);
}

.poll-question {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 16px;
    line-height: 1.4;
}

.poll-preview {
    margin-bottom: 16px;
}

.preview-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.preview-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
}

.preview-more {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.poll-meta {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--glass-border);
    margin-bottom: 16px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.meta-item.voted-badge {
    color: var(--success);
    font-weight: 600;
}

.meta-icon {
    font-size: 0.9rem;
}

.poll-actions {
    display: flex;
    gap: 12px;
}

.poll-actions .btn {
    flex: 1;
}

/* ========================================
   Empty State
   ======================================== */
.empty-state {
    text-align: center;
    padding: 80px 40px;
    border-radius: var(--radius-xl);
    max-width: 500px;
    margin: 0 auto;
}

.empty-illustration {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 32px;
}

.empty-circle {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    opacity: 0.2;
    animation: pulse-scale 3s ease-in-out infinite;
}

@keyframes pulse-scale {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.empty-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
}

.empty-state h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* ========================================
   Access Code Entry Page
   ======================================== */
.code-entry-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.code-entry-container {
    max-width: 480px;
    width: 100%;
    padding: 48px 40px;
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}

.code-header {
    text-align: center;
    margin-bottom: 32px;
}

.lock-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    display: block;
    animation: lock-bounce 2s ease-in-out infinite;
}

@keyframes lock-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.code-header h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.code-header p {
    color: var(--text-secondary);
}

/* ========================================
   Login Page
   ======================================== */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-container {
    max-width: 420px;
    width: 100%;
    padding: 48px 40px;
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    display: block;
}

.login-header h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .form-actions {
    margin-top: 28px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--glass-border);
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color var(--transition-fast);
}

.back-link:hover {
    color: var(--primary);
}

.back-link span {
    margin-right: 6px;
}

.poll-preview-card {
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 32px;
    text-align: center;
}

.preview-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.poll-preview-card h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    line-height: 1.4;
}

.preview-meta {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.preview-meta .meta-chip {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.code-form .form-group {
    margin-bottom: 24px;
}

.code-input {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 2px;
}

.code-form .form-actions {
    flex-direction: column;
    gap: 12px;
}

.btn-full {
    width: 100%;
}

/* ========================================
   Forms
   ======================================== */
.page-header {
    text-align: center;
    margin-bottom: 48px;
}

.page-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary-light);
    margin-bottom: 16px;
}

.page-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.form-container {
    max-width: 650px;
    margin: 0 auto;
    padding: 40px;
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}

.form-glow {
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.form-section {
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.label-icon {
    font-size: 1.1rem;
}

.label-hint {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.input-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.input-wrapper {
    position: relative;
    flex: 1;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border: 2px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    font-size: 16px; /* Prevents iOS zoom on focus */
    transition: all var(--transition-fast);
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.5);
}

.form-input:focus + .input-glow {
    opacity: 1;
}

.input-glow {
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    opacity: 0;
    z-index: -1;
    filter: blur(8px);
    transition: opacity var(--transition-fast);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.char-counter {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Checkbox Option (Allow Other) */
.checkbox-option {
    display: block;
    cursor: pointer;
}

.checkbox-option input {
    display: none;
}

.checkbox-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: var(--radius-md);
    border: 2px solid var(--glass-border);
    transition: all var(--transition-fast);
}

.checkbox-option:hover .checkbox-card {
    border-color: rgba(139, 92, 246, 0.5);
    background: rgba(139, 92, 246, 0.05);
}

.checkbox-option input:checked + .checkbox-card {
    border-color: var(--secondary);
    background: rgba(139, 92, 246, 0.1);
}

.checkbox-indicator {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.checkbox-option input:checked + .checkbox-card .checkbox-indicator {
    background: var(--secondary);
    border-color: var(--secondary);
}

.checkbox-inner {
    color: white;
    font-size: 0.8rem;
    opacity: 0;
    transform: scale(0);
    transition: all var(--transition-fast);
}

.checkbox-option input:checked + .checkbox-card .checkbox-inner {
    opacity: 1;
    transform: scale(1);
}

.checkbox-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.checkbox-icon {
    font-size: 1.5rem;
}

.checkbox-text {
    display: flex;
    flex-direction: column;
}

.checkbox-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.checkbox-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Poll Type Selector */
.poll-type-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.type-option {
    cursor: pointer;
}

.type-option input {
    display: none;
}

.type-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: var(--radius-md);
    border: 2px solid var(--glass-border);
    transition: all var(--transition-fast);
    min-height: 72px; /* Touch-friendly */
}

.type-option:active .type-card {
    transform: scale(0.98);
}

.type-option input:checked + .type-card {
    border-color: var(--primary);
    background: rgba(249, 115, 22, 0.1);
}

.type-option input:checked + .type-card .type-check {
    opacity: 1;
    transform: scale(1);
}

.type-icon {
    font-size: 1.5rem;
}

.type-info {
    flex: 1;
}

.type-name {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.type-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.type-check {
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: white;
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--transition-fast);
}

/* Options Container */
.options-container {
    margin-bottom: 16px;
}

.option-input {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    animation: slide-in 0.3s ease forwards;
    animation-delay: calc(var(--delay, 0) * 0.1s);
    opacity: 0;
}

@keyframes slide-in {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.option-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.btn-remove {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.btn-remove:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-remove svg {
    width: 18px;
    height: 18px;
}

.btn-add {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-md);
    border: 2px dashed var(--glass-border);
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-add:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(249, 115, 22, 0.05);
}

.add-icon {
    font-size: 1.2rem;
    margin-right: 8px;
}

.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 40px;
}

.btn-submit {
    flex: 1;
}

/* ========================================
   Poll Detail Pages
   ======================================== */
.poll-detail {
    max-width: 700px;
    margin: 0 auto;
}

.poll-header {
    position: relative;
    padding: 40px;
    border-radius: var(--radius-xl);
    text-align: center;
    margin-bottom: 32px;
    overflow: hidden;
}

.poll-header-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
}

.poll-badges {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    position: relative;
}

.poll-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    line-height: 1.3;
    margin-bottom: 20px;
    position: relative;
}

.poll-meta-row {
    display: flex;
    justify-content: center;
    gap: 16px;
    position: relative;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
}

/* Vote Form */
.vote-form {
    position: relative;
    padding: 32px;
    border-radius: var(--radius-xl);
    margin-bottom: 24px;
    overflow: hidden;
}

.vote-header {
    text-align: center;
    margin-bottom: 28px;
}

.vote-header h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.vote-header p {
    color: var(--text-secondary);
}

.options-list {
    margin-bottom: 28px;
}

.vote-option {
    display: block;
    cursor: pointer;
    margin-bottom: 12px;
    animation: slide-in 0.4s ease forwards;
    animation-delay: calc(var(--delay) * 0.1s);
    opacity: 0;
}

.vote-option input {
    display: none;
}

.option-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-radius: var(--radius-md);
    border: 2px solid var(--glass-border);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-fast);
    min-height: 56px; /* Touch-friendly */
}

/* Touch feedback */
.vote-option:active .option-card {
    transform: scale(0.98);
}

.vote-option:hover .option-card {
    border-color: rgba(249, 115, 22, 0.5);
    background: rgba(249, 115, 22, 0.05);
}

.vote-option input:checked + .option-card {
    border-color: var(--primary);
    background: rgba(249, 115, 22, 0.1);
}

.vote-option input:checked + .option-card .option-indicator {
    border-color: var(--primary);
    background: var(--primary);
}

.vote-option input:checked + .option-card .indicator-inner {
    transform: scale(1);
}

.option-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.vote-option input[type="checkbox"] + .option-card .option-indicator {
    border-radius: 6px;
}

.indicator-inner {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    transform: scale(0);
    transition: transform var(--transition-fast);
}

.vote-option input[type="checkbox"] + .option-card .indicator-inner {
    border-radius: 2px;
    width: 10px;
    height: 10px;
}

.option-text {
    font-size: 1.05rem;
    flex: 1;
}

.option-ripple {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(249, 115, 22, 0.3), transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.vote-option:active .option-ripple {
    opacity: 1;
}

/* Other Option */
.other-option .other-card {
    border-style: dashed;
}

.other-input-wrapper {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    margin-top: -8px;
    margin-bottom: 12px;
    padding-left: 40px;
}

.other-input-wrapper.show {
    max-height: 120px;
    opacity: 1;
    margin-top: 0;
}

.other-text-input {
    font-size: 0.95rem;
}

.btn-vote {
    width: 100%;
}

/* Poll Closed */
.poll-closed {
    text-align: center;
    padding: 60px 40px;
    border-radius: var(--radius-xl);
    margin-bottom: 24px;
}

.closed-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.poll-closed h2 {
    font-family: 'Space Grotesk', sans-serif;
    margin-bottom: 12px;
}

.poll-closed p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Share Section */
.share-section {
    padding: 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.share-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.share-icon {
    font-size: 1.3rem;
}

.share-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.share-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.share-link-container {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.share-link-input {
    flex: 1;
    min-width: 0; /* Prevent overflow on mobile */
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 2px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    font-size: 16px; /* Prevent iOS zoom */
    font-family: 'Space Grotesk', monospace;
}

.share-link-input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-copy {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--secondary) 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: 44px; /* Touch-friendly */
    white-space: nowrap;
}

.btn-copy:active {
    transform: scale(0.98);
}

@media (hover: hover) {
    .btn-copy:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    }
}

.btn-copy.copied {
    background: linear-gradient(135deg, var(--success) 0%, #16a34a 100%);
}

.copy-icon {
    font-size: 1rem;
}

.share-info {
    padding: 16px;
    background: rgba(249, 115, 22, 0.1);
    border-radius: var(--radius-md);
    border: 1px solid rgba(249, 115, 22, 0.2);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.info-item strong {
    color: var(--primary);
    font-family: 'Space Grotesk', monospace;
    letter-spacing: 1px;
}

.btn-copy-small {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background var(--transition-fast);
}

.btn-copy-small:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Poll Admin */
.poll-admin {
    padding: 24px;
    border-radius: var(--radius-lg);
}

.admin-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.admin-icon {
    font-size: 1.2rem;
}

.admin-header h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.inline-form {
    display: inline;
}

.btn-admin {
    padding: 10px 18px;
    font-size: 0.9rem;
}

/* ========================================
   Results Page
   ======================================== */
.results-summary {
    display: flex;
    justify-content: center;
    gap: 20px;
    position: relative;
}

.summary-stat {
    padding: 16px 28px;
    border-radius: var(--radius-md);
    text-align: center;
}

.summary-stat .stat-value {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

.summary-stat .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.results-container {
    position: relative;
    padding: 32px;
    border-radius: var(--radius-xl);
    margin-bottom: 24px;
    overflow: hidden;
}

.results-header {
    margin-bottom: 28px;
}

.results-header h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-item {
    position: relative;
    animation: slide-in 0.4s ease forwards;
    animation-delay: calc(var(--delay) * 0.1s);
    opacity: 0;
}

.result-item.winner {
    padding-top: 8px;
}

.result-item.other-result {
    padding-top: 8px;
}

.winner-badge {
    position: absolute;
    top: -8px;
    left: 16px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1a1a1a;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 1;
}

.other-badge {
    position: absolute;
    top: -8px;
    right: 16px;
    background: linear-gradient(135deg, var(--secondary), #7c3aed);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 1;
}

.result-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.result-rank {
    width: 32px;
    height: 32px;
    background: var(--glass-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
}

.result-item.winner .result-rank {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.result-text {
    font-weight: 600;
    font-size: 1rem;
}

.result-stats {
    display: flex;
    align-items: center;
    gap: 16px;
}

.result-votes {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.result-percentage {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}

.progress-container {
    position: relative;
}

.progress-bar {
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 6px;
    width: 0;
    transition: width 1s ease-out;
    position: relative;
}

.result-item.winner .progress-fill {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.progress-glow {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    filter: blur(10px);
    opacity: 0.5;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    padding: 24px 0;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    text-align: center;
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
}

.footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.heart {
    display: inline-block;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ========================================
   Animations
   ======================================== */
.animate-fade-in {
    animation: fade-in 0.6s ease forwards;
}

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

.animate-slide-up {
    animation: slide-up 0.5s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

@keyframes slide-up {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-slide-in {
    animation: slide-in 0.4s ease forwards;
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.animate-on-scroll.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.animate-out {
    animation: slide-out 0.3s ease forwards;
}

@keyframes slide-out {
    to { opacity: 0; transform: translateX(20px) scale(0.9); }
}

/* ========================================
   Responsive
   ======================================== */

/* Tablet and smaller */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }
    
    .nav-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .admin-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        padding: 0 8px;
    }
    
    .hero-stats {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .stat-item {
        width: 100%;
        max-width: 200px;
    }
    
    .section-header {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .polls-grid {
        grid-template-columns: 1fr;
    }
    
    .poll-type-selector {
        grid-template-columns: 1fr;
    }
    
    .form-container {
        padding: 24px 16px;
        margin: 0 8px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .poll-header {
        padding: 24px 16px;
    }
    
    .poll-title {
        font-size: 1.5rem;
        word-break: break-word;
    }
    
    .poll-meta-row {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .vote-form,
    .results-container {
        padding: 20px 16px;
    }
    
    .vote-header h2 {
        font-size: 1.3rem;
    }
    
    .option-card {
        padding: 14px 16px;
    }
    
    .option-text {
        font-size: 0.95rem;
    }
    
    .admin-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .admin-actions .btn-admin {
        width: 100%;
    }
    
    .result-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .result-actions .btn {
        width: 100%;
    }
    
    .results-summary {
        flex-direction: column;
        gap: 12px;
    }
    
    .summary-stat {
        width: 100%;
        max-width: 180px;
    }
    
    .result-item {
        padding: 16px;
    }
    
    .result-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .result-stats {
        width: 100%;
        justify-content: space-between;
    }
    
    /* Share section mobile */
    .share-section {
        padding: 20px 16px;
    }
    
    .share-link-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .share-link-input {
        font-size: 0.85rem;
    }
    
    .btn-copy {
        width: 100%;
    }
    
    /* Word cloud mobile */
    .wordcloud-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .wordcloud-container,
    .wordcloud-results-container {
        min-height: 200px;
        padding: 20px;
    }
    
    .word-cloud-words {
        gap: 8px 12px;
    }
    
    .cloud-word {
        padding: 3px 6px;
    }
    
    .words-table {
        gap: 6px;
    }
    
    .word-row {
        padding: 10px 12px;
        gap: 10px;
    }
    
    /* Login form */
    .login-container {
        padding: 24px 20px;
        margin: 0 16px;
    }
    
    /* Enter code page */
    .code-container {
        padding: 24px 20px;
        margin: 0 16px;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .navbar {
        padding: 12px 0;
    }
    
    .logo-text {
        font-size: 1.25rem;
    }
    
    .logo-icon {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .btn-large {
        padding: 14px 20px;
    }
    
    .hero {
        padding: 30px 0 50px;
    }
    
    .hero-badge {
        font-size: 0.8rem;
        padding: 8px 16px;
    }
    
    .hero-title {
        font-size: 1.6rem;
    }
    
    .page-title {
        font-size: 1.8rem;
    }
    
    .poll-card {
        padding: 16px;
    }
    
    .poll-question {
        font-size: 1.1rem;
    }
    
    .poll-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .poll-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .filter-pills {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .pill {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    .form-label {
        font-size: 0.95rem;
    }
    
    .form-input {
        padding: 12px 14px;
        font-size: 0.95rem;
    }
    
    .option-input {
        gap: 10px;
    }
    
    .option-number {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }
    
    .type-card {
        padding: 14px;
    }
    
    .type-icon {
        font-size: 1.3rem;
    }
    
    .type-name {
        font-size: 0.9rem;
    }
    
    .type-desc {
        font-size: 0.75rem;
    }
    
    /* Checkbox option mobile */
    .checkbox-card {
        padding: 14px;
    }
    
    .checkbox-name {
        font-size: 0.9rem;
    }
    
    .checkbox-desc {
        font-size: 0.75rem;
    }
    
    /* Poll badges */
    .poll-badges {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .poll-type-badge {
        font-size: 0.75rem;
        padding: 4px 10px;
    }
    
    /* Vote options */
    .vote-option {
        margin-bottom: 10px;
    }
    
    /* Results page */
    .winner-badge,
    .other-badge {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
    
    .result-rank {
        font-size: 0.85rem;
    }
    
    .result-text {
        font-size: 0.95rem;
    }
    
    .result-votes,
    .result-percentage {
        font-size: 0.85rem;
    }
    
    /* Word cloud mobile small */
    .word-cloud-input {
        font-size: 1.1rem;
    }
    
    .wordcloud-preview,
    .share-section,
    .poll-admin {
        margin-top: 16px;
    }
    
    .top-words-list h3 {
        font-size: 1rem;
    }
    
    .word-rank {
        font-size: 0.8rem;
        min-width: 25px;
    }
    
    .word-text {
        font-size: 0.9rem;
    }
    
    .word-votes {
        font-size: 0.8rem;
        padding: 3px 8px;
    }
    
    /* Admin section */
    .admin-header,
    .share-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .share-description {
        text-align: center;
        font-size: 0.9rem;
    }
    
    .share-info {
        flex-direction: column;
        align-items: center;
    }
    
    .info-item {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Very small phones */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.4rem;
    }
    
    .poll-title {
        font-size: 1.3rem;
    }
    
    .btn {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .poll-card {
        padding: 14px;
    }
    
    .meta-chip {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}
/* ========================================
   Word Cloud Styles
   ======================================== */

/* Word Cloud Badge */
.poll-type-badge.wordcloud {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.2));
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #c4b5fd;
}

/* Word Input Section */
.wordcloud-input-section {
    margin: 24px 0;
}

.word-input-wrapper {
    max-width: 400px;
    margin: 0 auto;
}

.word-cloud-input {
    text-align: center;
    font-size: 1.3rem;
    letter-spacing: 0.05em;
    text-transform: lowercase;
}

.input-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 12px;
}

/* Word Cloud Preview */
.wordcloud-preview {
    padding: 32px;
    margin-top: 24px;
}

.wordcloud-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.wordcloud-header h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--success);
    background: rgba(34, 197, 94, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse-live 2s ease-in-out infinite;
}

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

.wordcloud-container,
.wordcloud-results-container {
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 16px;
}

.wordcloud-loading,
.wordcloud-empty {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.word-cloud-words {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 20px;
    line-height: 1.4;
}

.cloud-word {
    display: inline-flex;
    align-items: flex-start;
    font-weight: 600;
    transition: all var(--transition-fast);
    cursor: default;
    animation: fadeInWord 0.5s ease-out forwards;
    opacity: 0;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
}

.cloud-word:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.1);
}

@keyframes fadeInWord {
    from { 
        opacity: 0; 
        transform: scale(0.8) translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    }
}

.word-count {
    font-size: 0.5em;
    opacity: 0.7;
    margin-left: 2px;
    font-weight: 400;
}

.wordcloud-stats {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Word Cloud Results Page */
.wordcloud-results-container {
    min-height: 300px;
}

.top-words-list {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--glass-border);
}

.top-words-list h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.words-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.word-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    animation: slideInRow 0.4s ease-out forwards;
    opacity: 0;
    animation-delay: calc(var(--delay) * 0.1s);
}

@keyframes slideInRow {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.word-row:hover {
    background: rgba(255, 255, 255, 0.06);
}

.word-rank {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    min-width: 30px;
}

.word-row:first-child .word-rank {
    color: var(--warning);
}

.word-text {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.word-votes {
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 12px;
    border-radius: 12px;
}

.no-words {
    text-align: center;
    color: var(--text-muted);
    padding: 24px;
}

/* Word Cloud Preview in Poll Card */
.preview-wordcloud {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--secondary-light);
    font-weight: 500;
    padding: 8px 0;
}

.wordcloud-icon {
    font-size: 1.5rem;
}

/* ========================================
   Enhanced Login Page
   ======================================== */
.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
    padding: 20px 0 60px;
}

.login-hero {
    text-align: center;
    max-width: 700px;
}

.login-hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.login-hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
}

.feature-highlights {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.feature-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.feature-chip:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
}

.feature-chip span {
    font-size: 1.1rem;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: var(--radius-xl);
    position: relative;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
}

.login-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.btn-full {
    width: 100%;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--glass-border);
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.back-link:hover {
    color: var(--primary);
}

/* Testimonials Section */
.testimonials-section {
    width: 100%;
    max-width: 1000px;
    padding: 0 20px;
}

.testimonials-title {
    text-align: center;
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 32px;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.testimonial-card {
    padding: 28px;
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}

.testimonial-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.08);
}

.testimonial-stars {
    margin-bottom: 16px;
    font-size: 1rem;
    letter-spacing: 2px;
}

.testimonial-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.author-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Stats Banner */
.stats-banner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 48px;
    padding: 32px 48px;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(249, 115, 22, 0.2);
}

.stat-item-large {
    text-align: center;
}

.stat-number-large {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label-large {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.stat-divider {
    width: 1px;
    height: 50px;
    background: var(--glass-border);
}

/* Login Page Responsive */
@media (max-width: 768px) {
    .login-hero-title {
        font-size: 2rem;
    }
    
    .login-hero-subtitle {
        font-size: 1rem;
    }
    
    .feature-highlights {
        gap: 8px;
    }
    
    .feature-chip {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    .login-container {
        max-width: 100%;
        margin: 0 16px;
        padding: 28px 24px;
    }
    
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-banner {
        flex-direction: column;
        gap: 24px;
        padding: 28px 24px;
    }
    
    .stat-divider {
        width: 60px;
        height: 1px;
    }
    
    .stat-number-large {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .login-page {
        gap: 32px;
        padding: 10px 0 40px;
    }
    
    .login-hero-title {
        font-size: 1.7rem;
    }
    
    .feature-chip {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .feature-chip span {
        font-size: 1rem;
    }
    
    .testimonial-card {
        padding: 20px;
    }
    
    .testimonial-text {
        font-size: 0.9rem;
    }
    
    .author-avatar {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}

/* ============================================
   ADMIN EDIT & STATS STYLES
   ============================================ */

/* Admin Edit Overlay on Poll Cards */
.admin-edit-overlay {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: rgba(139, 92, 246, 0.9);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-edit-overlay .edit-icon {
    font-size: 1.1rem;
}

.poll-card:hover .admin-edit-overlay {
    opacity: 1;
    transform: scale(1);
}

.admin-edit-overlay:hover {
    background: rgba(139, 92, 246, 1);
    transform: scale(1.1) !important;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 4px;
    padding: 6px;
    border-radius: 16px;
    margin-bottom: 24px;
    max-width: 500px;
}

.admin-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    transition: all 0.3s ease;
}

.admin-tab:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.admin-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.admin-tab .tab-icon {
    font-size: 1.1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    padding: 24px 16px;
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.stat-card-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.stat-card-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Stats Section */
.stats-section {
    padding: 24px;
    border-radius: 20px;
    margin-bottom: 24px;
}

.stats-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: white;
}

.stats-section-title .section-icon {
    font-size: 1.4rem;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.info-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 1rem;
    color: white;
    font-weight: 500;
}

.info-value.code-value {
    font-family: 'Fira Code', monospace;
    color: var(--accent);
}

/* Voting Breakdown */
.voting-breakdown {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.breakdown-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    animation: slideIn 0.4s ease-out forwards;
    animation-delay: calc(var(--delay) * 0.05s);
    opacity: 0;
    transform: translateX(-20px);
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.breakdown-rank {
    font-size: 1.4rem;
    min-width: 40px;
    text-align: center;
}

.breakdown-content {
    flex: 1;
}

.breakdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.breakdown-text {
    color: white;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.other-tag {
    font-size: 0.7rem;
    padding: 2px 8px;
    background: rgba(245, 158, 11, 0.3);
    color: #f59e0b;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.breakdown-votes {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.breakdown-bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.breakdown-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

.breakdown-footer {
    margin-top: 4px;
}

.breakdown-percentage {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
}

/* Other Responses */
.other-responses {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.other-response-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border-left: 3px solid #f59e0b;
}

.response-text {
    color: white;
    font-style: italic;
}

.response-votes {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* Word Cloud Preview */
.wordcloud-preview {
    padding: 30px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    text-align: center;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Empty Stats */
.empty-stats {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.empty-stats .empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
}

/* Danger Zone */
.danger-zone {
    padding: 24px;
    border-radius: 20px;
    border: 2px solid rgba(239, 68, 68, 0.3);
    margin-bottom: 24px;
}

.danger-title {
    font-size: 1.1rem;
    color: #ef4444;
    margin-bottom: 8px;
}

.danger-desc {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

/* Poll Type Display (Edit page) */
.poll-type-display {
    padding: 16px;
    border-radius: 12px;
}

.poll-type-display .type-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    border: 2px solid rgba(139, 92, 246, 0.5);
}

.poll-type-display .type-icon {
    font-size: 2rem;
}

.poll-type-display .type-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.poll-type-display .type-name {
    font-weight: 600;
    color: white;
    font-size: 1.1rem;
}

.poll-type-display .type-desc {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* Option Votes Display */
.option-votes {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    background: rgba(139, 92, 246, 0.2);
    border-radius: 8px;
    min-width: 60px;
}

.option-votes .vote-count {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.option-votes .vote-label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

/* Mobile Responsive for Admin Features */
@media (max-width: 768px) {
    .admin-tabs {
        max-width: 100%;
        padding: 4px;
    }
    
    .admin-tab {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .admin-tab span:not(.tab-icon) {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px 12px;
    }
    
    .stat-card-value {
        font-size: 1.4rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .breakdown-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .breakdown-rank {
        text-align: left;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .quick-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .admin-edit-overlay {
        opacity: 1;
        transform: scale(1);
        width: 36px;
        height: 36px;
    }
    
    .option-input {
        flex-wrap: wrap;
    }
    
    .option-votes {
        flex-direction: row;
        gap: 6px;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .stats-section {
        padding: 16px;
    }
    
    .stats-section-title {
        font-size: 1.1rem;
    }
    
    .danger-zone {
        padding: 16px;
    }
}

/* ========================================
   Public Landing Page - Polls Served Counter
   ======================================== */

.polls-served-counter {
    text-align: center;
    padding: 40px 60px;
    margin: 40px auto;
    max-width: 500px;
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.polls-served-counter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--primary));
    background-size: 200% 100%;
    animation: gradient-shift 3s ease infinite;
}

.polls-served-counter .big-number {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.polls-served-counter .counter-icon {
    font-size: 3rem;
    animation: pulse 2s ease-in-out infinite;
}

.polls-served-counter .served-label {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.polls-served-counter .served-tagline {
    font-size: 1rem;
    color: var(--text-secondary);
}

.cta-section {
    margin-top: 40px;
    text-align: center;
}

.cta-section .cta-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* ========================================
   Testimonials Section
   ======================================== */

.testimonials-section {
    margin-top: 80px;
    padding-bottom: 60px;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.testimonial-card {
    padding: 28px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 5rem;
    font-family: Georgia, serif;
    color: rgba(249, 115, 22, 0.1);
    line-height: 1;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    border-color: rgba(249, 115, 22, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.testimonial-stars {
    font-size: 1.1rem;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.testimonial-text {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 20px;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.testimonial-author .author-avatar {
    font-size: 2rem;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(249, 115, 22, 0.15);
    border-radius: 50%;
}

.testimonial-author .author-name {
    font-weight: 600;
    color: var(--text-primary);
}

.testimonial-author .author-role {
    font-size: 0.85rem;
    color: var(--text-muted);
    width: 100%;
    padding-left: 57px;
    margin-top: -5px;
}

/* Responsive Testimonials */
@media (max-width: 768px) {
    .polls-served-counter {
        padding: 30px 25px;
        margin: 30px 15px;
    }
    
    .polls-served-counter .big-number {
        font-size: 3.5rem;
    }
    
    .polls-served-counter .counter-icon {
        font-size: 2rem;
    }
    
    .polls-served-counter .served-label {
        font-size: 1.2rem;
    }
    
    .testimonials-section {
        margin-top: 50px;
    }
    
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .testimonial-card {
        padding: 20px;
    }
}