/* ============================================
   VoteHub - Modern Voting Platform Styles
   Glass Morphism Design with Dark/Light Mode
   ============================================ */

/* CSS Variables - Light Theme (Default) */
:root {
  /* Primary Colors - Vibrant Purple/Violet Gradient */
  --color-primary: #8b5cf6;
  --color-primary-hover: #7c3aed;
  --color-primary-light: #a78bfa;
  --color-primary-dark: #6d28d9;
  --color-primary-bg: rgba(139, 92, 246, 0.1);
  --color-primary-glow: rgba(139, 92, 246, 0.4);

  /* Secondary Colors - Cyan accent */
  --color-secondary: #06b6d4;
  --color-secondary-hover: #0891b2;
  --color-secondary-bg: rgba(6, 182, 212, 0.1);

  /* Accent Colors */
  --color-success: #10b981;
  --color-success-light: #34d399;
  --color-success-bg: rgba(16, 185, 129, 0.15);
  --color-error: #f43f5e;
  --color-error-light: #fb7185;
  --color-error-bg: rgba(244, 63, 94, 0.15);
  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.15);

  /* Background Colors */
  --color-background: #f8fafc;
  --color-background-secondary: #f1f5f9;
  --color-surface: rgba(255, 255, 255, 0.8);
  --color-surface-elevated: rgba(255, 255, 255, 0.9);
  --color-surface-solid: #ffffff;

  /* Text Colors */
  --color-text: #0f172a;
  --color-text-secondary: #475569;
  --color-text-tertiary: #94a3b8;
  --color-text-inverse: #ffffff;

  /* Border Colors */
  --color-border: rgba(148, 163, 184, 0.3);
  --color-border-light: rgba(148, 163, 184, 0.15);
  --color-border-focus: rgba(139, 92, 246, 0.5);

  /* Glass Morphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-bg-elevated: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --blur-amount: 20px;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
  --gradient-secondary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #06b6d4 100%);
  --gradient-card: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(139,92,246,0.05) 100%);
  --gradient-mesh: radial-gradient(at 40% 20%, rgba(139, 92, 246, 0.15) 0px, transparent 50%),
                   radial-gradient(at 80% 0%, rgba(6, 182, 212, 0.15) 0px, transparent 50%),
                   radial-gradient(at 0% 50%, rgba(236, 72, 153, 0.1) 0px, transparent 50%);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.15);
  --shadow-primary: 0 4px 20px rgba(139, 92, 246, 0.35);
  --shadow-primary-hover: 0 8px 30px rgba(139, 92, 246, 0.45);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 12px 40px rgba(139, 92, 246, 0.2);

  /* Border Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-theme: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme */
[data-theme="dark"] {
  /* Primary Colors */
  --color-primary: #a78bfa;
  --color-primary-hover: #c4b5fd;
  --color-primary-light: #c4b5fd;
  --color-primary-dark: #8b5cf6;
  --color-primary-bg: rgba(167, 139, 250, 0.15);
  --color-primary-glow: rgba(167, 139, 250, 0.5);

  /* Secondary Colors */
  --color-secondary: #22d3ee;
  --color-secondary-hover: #67e8f9;
  --color-secondary-bg: rgba(34, 211, 238, 0.15);

  /* Accent Colors */
  --color-success: #34d399;
  --color-success-light: #6ee7b7;
  --color-success-bg: rgba(52, 211, 153, 0.2);
  --color-error: #fb7185;
  --color-error-light: #fda4af;
  --color-error-bg: rgba(251, 113, 133, 0.2);
  --color-warning: #fbbf24;
  --color-warning-bg: rgba(251, 191, 36, 0.2);

  /* Background Colors */
  --color-background: #0f172a;
  --color-background-secondary: #1e293b;
  --color-surface: rgba(30, 41, 59, 0.8);
  --color-surface-elevated: rgba(51, 65, 85, 0.9);
  --color-surface-solid: #1e293b;

  /* Text Colors */
  --color-text: #f1f5f9;
  --color-text-secondary: #94a3b8;
  --color-text-tertiary: #64748b;
  --color-text-inverse: #0f172a;

  /* Border Colors */
  --color-border: rgba(148, 163, 184, 0.2);
  --color-border-light: rgba(148, 163, 184, 0.1);
  --color-border-focus: rgba(167, 139, 250, 0.5);

  /* Glass Morphism */
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-bg-elevated: rgba(51, 65, 85, 0.85);
  --glass-border: rgba(148, 163, 184, 0.2);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #a78bfa 0%, #22d3ee 100%);
  --gradient-secondary: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
  --gradient-hero: linear-gradient(135deg, #818cf8 0%, #a78bfa 50%, #22d3ee 100%);
  --gradient-card: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(139,92,246,0.08) 100%);
  --gradient-mesh: radial-gradient(at 40% 20%, rgba(167, 139, 250, 0.2) 0px, transparent 50%),
                   radial-gradient(at 80% 0%, rgba(34, 211, 238, 0.2) 0px, transparent 50%),
                   radial-gradient(at 0% 50%, rgba(244, 114, 182, 0.15) 0px, transparent 50%);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.7);
  --shadow-primary: 0 4px 20px rgba(167, 139, 250, 0.3);
  --shadow-primary-hover: 0 8px 30px rgba(167, 139, 250, 0.4);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-card-hover: 0 12px 40px rgba(167, 139, 250, 0.25);
}

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

/* Base */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-background);
  background-image: var(--gradient-mesh);
  background-attachment: fixed;
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color var(--transition-theme), color var(--transition-theme);
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================
   Header & Navigation - Glass Morphism
   ============================================ */

.header {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur-amount));
  -webkit-backdrop-filter: blur(var(--blur-amount));
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background var(--transition-theme), border-color var(--transition-theme);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: color var(--transition-theme);
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  color: white;
  box-shadow: var(--shadow-primary);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.logo:hover .logo-icon {
  transform: scale(1.05);
  box-shadow: var(--shadow-primary-hover);
}

.logo-icon svg {
  width: 22px;
  height: 22px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  padding: 0.25rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border-light);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.625rem 1.125rem;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.nav-tab svg {
  width: 16px;
  height: 16px;
}

.nav-tab:hover {
  color: var(--color-text);
  background: var(--color-border-light);
}

.nav-tab.active {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.auth-nav,
.user-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Theme Toggle Button */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover {
  background: var(--color-primary-bg);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: scale(1.05);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  transition: transform var(--transition-base);
}

.theme-toggle:hover svg {
  transform: rotate(15deg);
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
  position: absolute;
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.theme-toggle .sun-icon {
  opacity: 1;
  transform: rotate(0deg);
}

.theme-toggle .moon-icon {
  opacity: 0;
  transform: rotate(-90deg);
}

[data-theme="dark"] .theme-toggle .sun-icon {
  opacity: 0;
  transform: rotate(90deg);
}

[data-theme="dark"] .theme-toggle .moon-icon {
  opacity: 1;
  transform: rotate(0deg);
}

/* User Menu */
.user-menu {
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 0.375rem 0.875rem 0.375rem 0.375rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.user-menu-btn:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-bg);
}

.user-photo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-border-light);
}

.user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chevron {
  width: 16px;
  height: 16px;
  color: var(--color-text-tertiary);
  transition: transform var(--transition-fast);
}

.user-menu-btn.open .chevron {
  transform: rotate(180deg);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--glass-bg-elevated);
  backdrop-filter: blur(var(--blur-amount));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  padding: 0.5rem;
  z-index: 50;
  animation: dropdownIn 0.2s ease-out;
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.dropdown-item svg {
  width: 18px;
  height: 18px;
  color: var(--color-text-secondary);
}

.dropdown-item:hover {
  background: var(--color-error-bg);
  color: var(--color-error);
}

.dropdown-item:hover svg {
  color: var(--color-error);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::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:hover::before {
  left: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn:disabled::before {
  display: none;
}

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

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary-hover);
}

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

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

.btn-secondary:hover:not(:disabled) {
  background: var(--glass-bg-elevated);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-danger {
  background: linear-gradient(135deg, var(--color-error) 0%, #e11d48 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.35);
}

.btn-danger:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.45);
}

.btn-signin {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: var(--glass-bg-elevated);
  backdrop-filter: blur(10px);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-signin:hover {
  background: var(--color-surface-solid);
  border-color: var(--color-text-tertiary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-back {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  padding: 0.5rem 0;
  margin-bottom: 1.5rem;
}

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

.btn-back::before {
  display: none;
}

.btn-add-option {
  background: var(--color-primary-bg);
  color: var(--color-primary);
  border: 2px dashed var(--color-primary);
  width: 100%;
  padding: 0.875rem;
  border-radius: var(--radius-lg);
}

.btn-add-option:hover:not(:disabled) {
  background: rgba(139, 92, 246, 0.2);
  border-style: solid;
}

.btn-add-option::before {
  display: none;
}

.btn-loading {
  display: none;
}

.btn-submit .btn-loading.visible,
.btn-submit:disabled .btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-submit:disabled .btn-text {
  display: none;
}

/* ============================================
   Main Content
   ============================================ */

.main {
  padding: 2rem 0 4rem;
  min-height: calc(100vh - 72px);
}

/* Hero Section - Glass Morphism */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--color-border-light);
}

.hero-content {
  max-width: 520px;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.gradient-text {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  gap: 1.5rem;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--glass-bg-elevated);
  backdrop-filter: blur(var(--blur-amount));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  padding: 1.75rem 3rem;
  box-shadow: var(--glass-shadow);
  transition: all var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  font-weight: 500;
  margin-top: 0.25rem;
}

/* Sections */
.section {
  animation: fadeInUp 0.4s ease-out;
}

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

.section-header {
  margin-bottom: 2rem;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.375rem;
}

.section-subtitle {
  color: var(--color-text-secondary);
}

/* ============================================
   Poll Cards Grid - Glass Morphism
   ============================================ */

.poll-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.poll-card {
  background: var(--glass-bg-elevated);
  backdrop-filter: blur(var(--blur-amount));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: 1.75rem;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.poll-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
}

.poll-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.poll-card:hover {
  border-color: transparent;
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-4px);
}

.poll-card:hover::before {
  transform: scaleX(1);
}

.poll-card:hover::after {
  opacity: 0.03;
}

.poll-card-header {
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.poll-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.poll-card-description {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.poll-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border-light);
  position: relative;
  z-index: 1;
}

.poll-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--color-text-tertiary);
}

.poll-card-votes {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 600;
  color: var(--color-primary);
}

.poll-card-votes svg {
  width: 16px;
  height: 16px;
}

.poll-card-actions {
  display: flex;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.poll-card:hover .poll-card-actions {
  opacity: 1;
}

.poll-card-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.poll-card-action svg {
  width: 16px;
  height: 16px;
}

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

.poll-card-action.danger:hover {
  background: var(--color-error-bg);
  border-color: var(--color-error);
  color: var(--color-error);
}

.owner-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--color-success-bg);
  color: var(--color-success);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  margin-left: 0.5rem;
}

/* Poll Card Statistics */
.poll-card-stats {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.poll-card-stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.poll-card-stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.poll-card-stat-label {
  font-size: 0.8125rem;
  color: var(--color-text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.poll-card-stat-value {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-primary);
  flex-shrink: 0;
}

.poll-card-stat-bar {
  height: 6px;
  background: var(--color-border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.poll-card-stat-bar-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width 0.5s ease-out;
  min-width: 0;
}

.poll-card-more {
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
  font-weight: 500;
  padding-top: 0.25rem;
}

/* ============================================
   Poll Detail View - Glass Morphism
   ============================================ */

.poll-detail {
  background: var(--glass-bg-elevated);
  backdrop-filter: blur(var(--blur-amount));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: 2.5rem;
  box-shadow: var(--glass-shadow);
  max-width: 800px;
  position: relative;
  overflow: hidden;
}

.poll-detail::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
}

.poll-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.poll-detail-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.poll-detail-actions {
  display: flex;
  gap: 0.5rem;
}

.poll-detail-action {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.5rem 0.875rem;
  transition: all var(--transition-fast);
}

.poll-detail-action svg {
  width: 16px;
  height: 16px;
}

.poll-detail-action:hover {
  background: var(--color-primary-bg);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.poll-detail-action.danger:hover {
  background: var(--color-error-bg);
  border-color: var(--color-error);
  color: var(--color-error);
}

.poll-detail-description {
  color: var(--color-text-secondary);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.poll-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.poll-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
}

.poll-option:hover:not(.voted):not(.disabled) {
  border-color: var(--color-primary);
  background: var(--color-primary-bg);
  transform: translateX(4px);
}

.poll-option.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-bg);
  box-shadow: 0 0 0 3px var(--color-primary-bg);
}

.poll-option.voted {
  cursor: default;
}

.poll-option.disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

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

.poll-option.selected .poll-option-radio,
.poll-option:hover:not(.voted):not(.disabled) .poll-option-radio {
  border-color: var(--color-primary);
}

.poll-option.selected .poll-option-radio::after {
  content: '';
  width: 12px;
  height: 12px;
  background: var(--gradient-primary);
  border-radius: 50%;
}

/* User voted option */
.poll-option.user-vote {
  border-color: var(--color-success);
  background: var(--color-success-bg);
}

.poll-option.user-vote .poll-option-radio {
  border-color: var(--color-success);
  background: var(--color-success);
}

.poll-option.user-vote .poll-option-bar-fill {
  background: linear-gradient(135deg, var(--color-success) 0%, #059669 100%);
}

.poll-option-radio .checkmark {
  color: white;
  font-size: 14px;
  line-height: 1;
}

.poll-option-radio .checkmark::before {
  content: '\2713';
}

.your-vote-badge {
  display: inline-flex;
  align-items: center;
  background: var(--color-success);
  color: white;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  margin-left: 0.5rem;
}

.poll-option-content {
  flex: 1;
  min-width: 0;
}

.poll-option-text {
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.poll-option-bar {
  height: 8px;
  background: var(--color-border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.poll-option-bar-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width 0.6s ease-out;
}

.poll-option-count {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}

.poll-detail-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border-light);
}

.poll-total-votes {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.voted-message {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-success);
  font-weight: 600;
}

.voted-message svg {
  width: 18px;
  height: 18px;
}

/* ============================================
   Forms - Glass Morphism
   ============================================ */

.form-card {
  background: var(--glass-bg-elevated);
  backdrop-filter: blur(var(--blur-amount));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--glass-shadow);
  padding: 2.5rem;
  max-width: 640px;
  position: relative;
  overflow: hidden;
}

.form-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
}

.form-header {
  margin-bottom: 2rem;
}

.form-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.375rem;
}

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

.form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
}

.form-group label svg {
  width: 18px;
  height: 18px;
  color: var(--color-text-secondary);
}

.form-group label .optional {
  font-weight: 400;
  color: var(--color-text-tertiary);
}

.form-group input,
.form-group textarea {
  padding: 0.875rem 1rem;
  font-size: 1rem;
  font-family: var(--font-sans);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  color: var(--color-text);
  transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-bg);
  background: var(--glass-bg-elevated);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--color-text-tertiary);
}

.form-note {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  background: var(--color-warning-bg);
  padding: 0.875rem 1rem;
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--color-warning);
}

.form-error {
  padding: 0.875rem 1rem;
  background: var(--color-error-bg);
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: var(--radius-lg);
  color: var(--color-error);
  font-size: 0.875rem;
  font-weight: 500;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  padding-top: 0.5rem;
}

/* Poll Options in Create Form */
.poll-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.option-input {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.option-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--gradient-primary);
  color: white;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.option-input input {
  flex: 1;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  color: var(--color-text);
  transition: all var(--transition-fast);
}

.option-input input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-bg);
}

.option-input .btn-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--glass-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text-tertiary);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

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

.option-input .btn-remove:hover {
  background: var(--color-error-bg);
  border-color: var(--color-error);
  color: var(--color-error);
}

/* ============================================
   Modal - Glass Morphism
   ============================================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  background: var(--glass-bg-elevated);
  backdrop-filter: blur(var(--blur-amount));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.25s ease-out;
}

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

.modal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 1.5rem;
}

.modal-icon.danger {
  background: var(--color-error-bg);
  color: var(--color-error);
}

.modal-icon svg {
  width: 32px;
  height: 32px;
}

.modal-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.modal-content p {
  color: var(--color-text-secondary);
  margin-bottom: 1.75rem;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.modal-actions .btn {
  min-width: 110px;
}

/* ============================================
   Loading & States
   ============================================ */

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: var(--color-text-secondary);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

.spinner-small {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state,
.error-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-icon,
.error-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  margin: 0 auto 1.5rem;
}

.empty-icon svg,
.error-icon svg {
  width: 40px;
  height: 40px;
  color: var(--color-text-tertiary);
}

.error-icon {
  background: var(--color-error-bg);
  border-color: rgba(244, 63, 94, 0.3);
}

.error-icon svg {
  color: var(--color-error);
}

.empty-state h3,
.error-state h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.empty-state p,
.error-state p {
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
}

/* ============================================
   Toast Notifications - Glass Morphism
   ============================================ */

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--glass-bg-elevated);
  backdrop-filter: blur(var(--blur-amount));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 320px;
  max-width: 420px;
  animation: toastIn 0.35s ease-out;
}

@keyframes toastIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.toast-exit {
  animation: toastOut 0.25s ease-in forwards;
}

@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast-icon svg {
  width: 20px;
  height: 20px;
}

.toast-success .toast-icon {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.toast-error .toast-icon {
  background: var(--color-error-bg);
  color: var(--color-error);
}

.toast-warning .toast-icon {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.toast-message {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.toast-close {
  background: none;
  border: none;
  color: var(--color-text-tertiary);
  cursor: pointer;
  padding: 0.375rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.toast-close:hover {
  background: var(--color-border-light);
  color: var(--color-text);
}

.toast-close svg {
  width: 18px;
  height: 18px;
}

/* ============================================
   Utility Classes
   ============================================ */

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

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

@media (max-width: 1024px) {
  .hero {
    flex-direction: column;
    text-align: center;
    gap: 2.5rem;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-title {
    font-size: 2.25rem;
  }
}

@media (max-width: 768px) {
  .header-content {
    height: auto;
    padding: 1rem 0;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .nav {
    width: 100%;
    flex-direction: column;
    gap: 1rem;
  }

  .nav-tabs {
    width: 100%;
    justify-content: center;
  }

  .nav-actions {
    width: 100%;
    justify-content: center;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-stats {
    flex-direction: column;
    width: 100%;
  }

  .stat-card {
    width: 100%;
  }

  .poll-grid {
    grid-template-columns: 1fr;
  }

  .poll-detail {
    padding: 1.5rem;
  }

  .form-card {
    padding: 1.5rem;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions .btn {
    width: 100%;
  }

  .user-name {
    display: none;
  }

  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }

  .toast {
    min-width: auto;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .poll-card {
    padding: 1.25rem;
  }

  .poll-option {
    padding: 1rem;
    flex-wrap: wrap;
  }

  .poll-option-count {
    width: 100%;
    text-align: left;
    margin-top: 0.5rem;
  }

  .modal-content {
    padding: 1.5rem;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions .btn {
    width: 100%;
  }

  .theme-toggle {
    width: 38px;
    height: 38px;
  }
}

/* Smooth theme transition for all elements */
*, *::before, *::after {
  transition-property: background-color, border-color, color, fill, stroke, box-shadow;
  transition-duration: var(--transition-theme);
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Exclude specific elements from global transition */
.spinner, .spinner-small, .poll-option-bar-fill, .poll-card-stat-bar-fill {
  transition-property: none;
}
