:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --secondary: #f43f5e;
  --accent: #10b981;
  --accent-2: #f59e0b;
  --bg-dark: #0f0f23;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-solid: #1a1a3e;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-bright: #f8fafc;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ==================== Background Animation ==================== */
.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.bg-gradient {
  position: absolute;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(244, 63, 94, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
}

.floating-shapes {
  position: absolute;
  width: 100%;
  height: 100%;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.4;
  animation: float 20s infinite;
}

.shape-1 { width: 300px; height: 300px; background: rgba(99, 102, 241, 0.3); top: 10%; left: 10%; animation-delay: 0s; }
.shape-2 { width: 200px; height: 200px; background: rgba(244, 63, 94, 0.3); top: 60%; right: 10%; animation-delay: -5s; }
.shape-3 { width: 250px; height: 250px; background: rgba(16, 185, 129, 0.2); bottom: 10%; left: 30%; animation-delay: -10s; }
.shape-4 { width: 150px; height: 150px; background: rgba(245, 158, 11, 0.2); top: 30%; right: 30%; animation-delay: -15s; }
.shape-5 { width: 180px; height: 180px; background: rgba(139, 92, 246, 0.2); bottom: 30%; right: 20%; animation-delay: -7s; }
.shape-6 { width: 220px; height: 220px; background: rgba(236, 72, 153, 0.15); top: 50%; left: 50%; animation-delay: -12s; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -50px) scale(1.1); }
  50% { transform: translate(-20px, 30px) scale(0.9); }
  75% { transform: translate(50px, 20px) scale(1.05); }
}

/* ==================== Navbar ==================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 12px 0;
  backdrop-filter: blur(20px) saturate(1.8);
  background: rgba(15, 15, 35, 0.7);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.nav-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-bright);
  font-weight: 800;
  font-size: 1.4rem;
}

.logo-icon {
  font-size: 1.8rem;
  animation: bounce-slow 3s infinite;
}

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

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  font-weight: 500;
  font-size: 0.9rem;
}

.nav-link:hover {
  color: var(--text-bright);
  background: rgba(255, 255, 255, 0.05);
}

.btn-create-nav {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white !important;
  border: none;
  font-weight: 600;
}

.btn-create-nav:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

/* ==================== Main Content ==================== */
.main-content {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 140px);
  padding: 100px 24px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ==================== Glass Card ==================== */
.glass-card {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4);
}

/* ==================== Home Page ==================== */
.hero {
  text-align: center;
  padding: 60px 0 40px;
  animation: fadeInUp 0.8s ease;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--primary-light);
  margin-bottom: 20px;
  font-weight: 500;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff, var(--primary-light), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-dim);
  max-width: 600px;
  margin: 0 auto 32px;
}

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

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 48px;
  animation: fadeInUp 1s ease 0.2s both;
}

.feature-card {
  padding: 28px;
  text-align: center;
}

.feature-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 16px;
  transition: var(--transition);
}

.feature-card:hover .feature-icon {
  transform: scale(1.1) rotate(5deg);
}

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--text-bright);
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-dim);
}

.polls-section {
  margin-top: 48px;
  animation: fadeInUp 1s ease 0.4s both;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.poll-list {
  display: grid;
  gap: 16px;
}

.poll-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  cursor: pointer;
  transition: var(--transition);
}

.poll-item:hover {
  transform: translateX(8px);
  border-color: var(--primary);
}

.poll-item-info h4 {
  font-size: 1.05rem;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.poll-item-meta {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.poll-item-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.poll-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-closed {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.status-active .status-dot {
  background: #34d399;
  animation: pulse-dot 2s infinite;
}

.status-closed .status-dot {
  background: #fb7185;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ==================== Buttons ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
}

.btn:active::after {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(135deg, var(--secondary), #dc2626);
  color: white;
  box-shadow: 0 4px 15px rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(244, 63, 94, 0.5);
}

.btn-success {
  background: linear-gradient(135deg, var(--accent), #059669);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.5);
}

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

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: var(--radius-xs);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ==================== Forms ==================== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.input-fancy {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-bright);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}

.input-fancy:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-fancy::placeholder {
  color: var(--text-dim);
}

textarea.input-fancy {
  min-height: 80px;
  resize: vertical;
}

select.input-fancy {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ==================== Visibility Selector ==================== */
.visibility-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.visibility-option {
  cursor: pointer;
}

.visibility-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.visibility-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  user-select: none;
}

.visibility-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.visibility-card.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.visibility-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: var(--transition);
}

.visibility-card.selected .visibility-icon {
  transform: scale(1.1);
}

.visibility-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.visibility-info strong {
  font-size: 0.9rem;
  color: var(--text-bright);
}

.visibility-info span {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.3;
}

/* Visibility Badges */
.visibility-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.visibility-badge-public {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.visibility-badge-private {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Option inputs for create form */
.options-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-row {
  display: flex;
  gap: 10px;
  align-items: center;
  animation: fadeInLeft 0.3s ease;
}

.option-row .input-fancy {
  flex: 1;
}

.btn-remove-option {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(244, 63, 94, 0.3);
  background: rgba(244, 63, 94, 0.1);
  color: var(--secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-remove-option:hover {
  background: rgba(244, 63, 94, 0.2);
  transform: scale(1.1);
}

.btn-add-option {
  border: 2px dashed var(--border);
  background: transparent;
  color: var(--text-dim);
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
  font-size: 0.9rem;
}

.btn-add-option:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  background: rgba(99, 102, 241, 0.05);
}

/* ==================== Vote Page ==================== */
.vote-page {
  max-width: 700px;
  margin: 0 auto;
  animation: fadeInUp 0.6s ease;
}

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

.vote-header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-bright);
  margin-bottom: 8px;
}

.vote-description {
  color: var(--text-dim);
  font-size: 1rem;
  margin-bottom: 12px;
}

.vote-meta {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-dim);
  flex-wrap: wrap;
  align-items: center;
}

.vote-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vote-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.vote-option {
  position: relative;
  cursor: pointer;
  transition: var(--transition);
}

.vote-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.vote-option-label {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  user-select: none;
}

.vote-option:hover .vote-option-label {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateX(4px);
}

.vote-option input:checked + .vote-option-label {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.custom-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

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

.vote-option input:checked + .vote-option-label .custom-check {
  background: var(--primary);
  border-color: var(--primary);
}

.custom-check-icon {
  color: white;
  font-size: 0.7rem;
  opacity: 0;
  transform: scale(0);
  transition: var(--transition);
}

.vote-option input:checked + .vote-option-label .custom-check-icon {
  opacity: 1;
  transform: scale(1);
}

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

/* Vote Results */
.results-container {
  margin-top: 24px;
  animation: fadeInUp 0.5s ease;
}

.result-item {
  margin-bottom: 16px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.result-label {
  font-weight: 600;
  color: var(--text-bright);
}

.result-count {
  color: var(--text-dim);
}

.result-bar-bg {
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.result-bar {
  height: 100%;
  border-radius: 8px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  padding-left: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.result-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  100% { left: 100%; }
}

.result-percentage {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-bright);
}

.total-votes {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ==================== Create Page ==================== */
.create-page {
  max-width: 700px;
  margin: 0 auto;
  animation: fadeInUp 0.6s ease;
}

.create-page h1 {
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 32px;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Success page after creation */
.success-page {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  animation: fadeInUp 0.6s ease;
}

.success-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: success-bounce 0.6s ease;
}

@keyframes success-bounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.success-page h2 {
  font-size: 1.8rem;
  margin-bottom: 24px;
  color: var(--text-bright);
}

.info-card {
  text-align: left;
  margin-bottom: 16px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 0.9rem;
  color: var(--text-dim);
}

.info-value {
  font-weight: 600;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-btn {
  padding: 4px 10px;
  font-size: 0.75rem;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition);
}

.copy-btn:hover {
  background: rgba(99, 102, 241, 0.3);
}

.admin-key-display {
  font-family: 'Courier New', monospace;
  font-size: 1.4rem;
  letter-spacing: 4px;
  color: var(--accent-2);
  background: rgba(245, 158, 11, 0.1);
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.warning-text {
  color: var(--secondary);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

/* ==================== Admin Page ==================== */
.admin-page {
  animation: fadeInUp 0.6s ease;
}

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

.admin-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-bright);
}

.admin-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

.stat-card {
  padding: 20px;
  text-align: center;
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 900;
  margin-bottom: 4px;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.chart-card {
  padding: 20px;
  min-height: 350px;
}

.chart-card h3 {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-container {
  width: 100%;
  height: 280px;
}

/* Admin tabs */
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.admin-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: var(--transition);
  text-align: center;
}

.admin-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.admin-tab.active {
  background: var(--primary);
  color: white;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

/* Vote logs table */
.logs-table-container {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.logs-table th {
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.logs-table td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.logs-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.ip-badge {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  background: rgba(99, 102, 241, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--primary-light);
}

/* IP Stats */
.ip-stats-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ip-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}

.ip-stat-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ip-stat-count {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-2);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
}

/* ==================== Modal ==================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 420px;
  z-index: 1;
}

.animate-modal {
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.modal-header h3 {
  font-size: 1.2rem;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(244, 63, 94, 0.2);
  color: var(--secondary);
}

/* ==================== Toast ==================== */
#toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  max-width: 380px;
  box-shadow: var(--shadow);
}

.toast-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

.toast-error {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.3);
}

.toast-info {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-light);
  border-color: rgba(99, 102, 241, 0.3);
}

.toast-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

/* ==================== Animations ==================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes confetti-fall {
  0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ==================== Voted state ==================== */
.vote-option.disabled {
  pointer-events: none;
  opacity: 0.6;
}

.voted-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
  animation: fadeInUp 0.5s ease;
}

/* ==================== Empty state ==================== */
.empty-state {
  text-align: center;
  padding: 48px;
  color: var(--text-dim);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--text);
}

/* ==================== Settings panel in admin ==================== */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  display: inline-block;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 26px;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

/* Confetti overlay */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -20px;
  animation: confetti-fall 3s linear forwards;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.2rem;
  }

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

  .form-row {
    grid-template-columns: 1fr;
  }

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

  .visibility-selector {
    grid-template-columns: 1fr;
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-controls {
    width: 100%;
  }

  .admin-controls .btn {
    flex: 1;
    justify-content: center;
    font-size: 0.8rem;
    padding: 8px 12px;
  }

  .nav-link span {
    display: none;
  }

  .glass-card {
    padding: 20px;
  }

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

  .admin-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .admin-tab {
    white-space: nowrap;
    flex: 0 0 auto;
    padding: 10px 12px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.8rem;
  }

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

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
}

/* ==================== Footer ==================== */
.footer {
  position: relative;
  z-index: 1;
  padding: 24px;
  text-align: center;
  border-top: 1px solid var(--border);
  backdrop-filter: blur(10px);
  background: rgba(15, 15, 35, 0.5);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.admin-entrance {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.8rem;
  opacity: 0.5;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-entrance:hover {
  opacity: 1;
  color: var(--primary-light);
}

/* Loading spinner */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 48px;
}

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

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

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Hover card lift effect */
.lift-on-hover {
  transition: var(--transition);
}

.lift-on-hover:hover {
  transform: translateY(-4px);
}