/* Custom UI enhancements for the polls app */

:root {
  /* Brand colors */
  --brand-primary: #4f46e5; /* indigo-600 */
  --brand-primary-soft: #eef2ff; /* indigo-50 */
  --brand-accent: #a855f7; /* purple-500 */
  --brand-danger: #ef4444; /* red-500 */
  --brand-success: #10b981; /* emerald-500 */

  /* Aliases for backward compatibility */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --accent: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;

  /* UI */
  --surface-main: #ffffff;
  --surface-muted: #f9fafb;
  --text-main: #111827;
  --text-muted: #6b7280;
  --shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.08);
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  color: var(--text-main);
}

/* Gradient text for main titles */
.gradient-text {
  background-image: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Primary gradient button */
.btn-gradient {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding-inline: 1.5rem;
  padding-block: 0.8rem;
  border-radius: var(--radius-xl);
  border-width: 0;
  background-image: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 18px 35px rgba(79, 70, 229, 0.35);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), filter var(--transition-fast);
}

.btn-gradient:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 24px 45px rgba(79, 70, 229, 0.4);
  filter: brightness(1.03);
}

.btn-gradient:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
}

/* Card hover elevation */
.card-hover {
  border-radius: var(--radius-2xl);
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.04);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-fast), background-color var(--transition-fast);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

/* Focus style for inputs */
.input-focus {
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

.input-focus:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.35);
  border-color: var(--brand-primary);
  background-color: #ffffff;
}

/* Soft glass-like blur (used on header/footer backgrounds) */
.backdrop-blur-custom {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Keyframe animations */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* Utility animation classes */
.animate-fade-in {
  animation: fade-in-up 0.45s var(--transition-fast) both;
}

.animate-slide-in {
  animation: slide-in 0.35s var(--transition-fast) both;
}

.animate-scale-in {
  animation: scale-in 0.35s var(--transition-fast) both;
}

.shimmer {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
}

/* Subtle section dividers */
.section-muted {
  background: radial-gradient(circle at top left, rgba(79, 70, 229, 0.05), transparent 60%),
              radial-gradient(circle at bottom right, rgba(168, 85, 247, 0.05), transparent 55%);
}

/* Pill tags (for question types, badges, etc.) */
.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: var(--surface-muted);
  color: var(--text-muted);
}

/* Tables for stats/responses */
.table-modern {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background-color: #fff;
  box-shadow: var(--shadow-soft);
}

.table-modern thead {
  background: linear-gradient(90deg, var(--brand-primary-soft), #fef3ff);
}

.table-modern th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  padding: 0.9rem 1rem;
  color: var(--text-muted);
}

.table-modern td {
  padding: 0.85rem 1rem;
  border-top: 1px solid #f1f5f9;
}

.table-modern tbody tr:hover {
  background-color: #f9fafb;
}

/* Chips for small pieces of meta info */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background-color: #eff6ff;
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Make QR images and cards look nicer */
.qr-card img {
  border-radius: 1rem;
}

/* Smooth transitions for links in nav */
.nav-link-soft {
  transition: color var(--transition-fast), transform var(--transition-fast), text-decoration-color var(--transition-fast);
}

.nav-link-soft:hover {
  transform: translateY(-1px);
}

/* Responsive helper for poll code input */
.poll-code-input {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* === ÐžÑ‚Ð²ÐµÑ‚Ñ‹ Ð½Ð° Ð²Ð¾Ð¿Ñ€Ð¾ÑÑ‹ (ÐµÐ´Ð¸Ð½Ð¾Ðµ Ð¾Ð¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð¸Ðµ) === */
.answer-cell {
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.4;
  word-break: break-word;
}

.answer-cell.empty-cell {
  color: #adb5bd;
  font-style: italic;
}

.answer-cell.correct-answer {
  color: #155724;
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
}

.answer-cell.incorrect-answer {
  color: #721c24;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
}

.answer-cell .icon {
  margin-left: 0.5em;
  font-weight: bold;
}


/* Custom CSS Ð´Ð»Ñ ÑÐ¸ÑÑ‚ÐµÐ¼Ñ‹ Ð¾Ð¿Ñ€Ð¾ÑÐ¾Ð² */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --accent: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
}

/* ÐÐ½Ð¸Ð¼Ð°Ñ†Ð¸Ð¸ */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

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

.animate-fade-in {
  animation: fadeIn 0.5s ease-out;
}

.animate-scale-in {
  animation: scaleIn 0.3s ease-out;
}

.animate-fade-in-up {
  animation: fadeIn 0.5s ease-out, slideIn 0.5s ease-out;
}

.shimmer {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* ÐšÐ¾Ð¼Ð¿Ð¾Ð½ÐµÐ½Ñ‚Ñ‹ */
.card-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.btn-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  transition: all 0.3s ease;
}

.btn-gradient:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #7c3aed 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.input-focus:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

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

.backdrop-blur-custom {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Ð£Ñ‚Ð¸Ð»Ð¸Ñ‚Ñ‹ */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ÐžÐ¿Ñ‚Ð¸Ð¼Ð¸Ð·Ð°Ñ†Ð¸Ñ Ð¿Ñ€Ð¾Ð¸Ð·Ð²Ð¾Ð´Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ð¾ÑÑ‚Ð¸ */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
}

/* ÐÐ´Ð°Ð¿Ñ‚Ð¸Ð²Ð½Ð¾ÑÑ‚ÑŒ */
@media (max-width: 640px) {
  .card-hover:hover {
    transform: none;
  }
}
.answer-cell {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.4;
    word-break: break-word;
}

.answer-cell.empty-cell {
    color: #adb5bd;
    font-style: italic;
}

.answer-cell.correct-answer {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

.answer-cell.incorrect-answer {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

.answer-cell .icon {
    margin-left: 0.5em;
    font-weight: bold;
}

header .gradient-text {
  /* Ð¤Ð¸ÐºÑ Ð´Ð»Ñ Ñ€Ð°Ð·Ð½Ñ‹Ñ… Ð±Ñ€Ð°ÑƒÐ·ÐµÑ€Ð¾Ð² */
  -webkit-text-stroke: 0.5px transparent;
  font-weight: 800;
  letter-spacing: -0.025em;
}
.gradient-text {
  background: linear-gradient(90deg, #4c1d95, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* Ð”Ð¾Ð¿Ð¾Ð»Ð½Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ð¾: Ñ„Ð¸ÐºÑ Ð´Ð»Ñ Safari */
  -webkit-text-fill-color: transparent;
}
