/* 
 * Modern Glassmorphic Design System for POLL Feedback System
 */
:root {
  --bg-gradient: radial-gradient(circle at 15% 15%, #1e1b4b 0%, #0f172a 45%, #020617 100%);
  --card-bg: rgba(30, 41, 59, 0.65);
  --card-border: rgba(255, 255, 255, 0.1);
  --card-hover-border: rgba(99, 102, 241, 0.5);
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --accent: #ec4899;
  --accent-cyan: #06b6d4;
  --accent-amber: #f59e0b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --input-bg: rgba(15, 23, 42, 0.6);
  --input-border: rgba(255, 255, 255, 0.12);
  --success: #10b981;
  --danger: #ef4444;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  padding: 40px 20px;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Ambient glow spheres in background */
body::before, body::after {
  content: '';
  position: fixed;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(100px);
  opacity: 0.18;
}

body::before {
  top: -50px;
  left: -50px;
  background: #6366f1;
}

body::after {
  bottom: -50px;
  right: -50px;
  background: #ec4899;
}

.container {
  max-width: 820px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Header */
.poll-header {
  text-align: center;
  margin-bottom: 35px;
  animation: fadeInDown 0.8s ease-out;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(99, 102, 241, 0.3);
  margin-bottom: 16px;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.poll-header h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 60%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}

.poll-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Progress bar */
.progress-container {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-full);
  padding: 4px;
  margin-bottom: 30px;
  position: sticky;
  top: 20px;
  z-index: 10;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
  box-shadow: 0 0 10px var(--primary);
}

/* Card Sections */
.form-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 30px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  animation: fadeInUp 0.6s ease-out backwards;
}

.form-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.card-title-group {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.q-number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.q-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
}

.q-hint {
  font-size: 0.85rem;
  color: var(--accent-cyan);
  font-weight: 500;
  margin-top: 4px;
  display: block;
}

/* Option Grid */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Custom Interactive Option Card */
.option-label {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
  position: relative;
  overflow: hidden;
}

.option-label:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: var(--card-hover-border);
}

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

.custom-indicator {
  width: 20px;
  height: 20px;
  border: 2px solid #64748b;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.option-label input[type="radio"] + .custom-indicator {
  border-radius: 50%;
}

.option-label input:checked + .custom-indicator {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

.custom-indicator svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: white;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.5);
  transition: var(--transition);
}

.option-label input:checked + .custom-indicator svg {
  opacity: 1;
  transform: scale(1);
}

.option-label.checked {
  background: rgba(99, 102, 241, 0.12);
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary-glow);
}

.option-text {
  font-size: 0.98rem;
  color: #e2e8f0;
  font-weight: 500;
  flex: 1;
}

/* Likert Emoji Cards (Questions 3 & 4) */
.likert-group {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

@media (max-width: 640px) {
  .likert-group {
    grid-template-columns: 1fr;
  }
}

.likert-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 10px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.likert-card:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: var(--card-hover-border);
  transform: translateY(-2px);
}

.likert-card input {
  position: absolute;
  opacity: 0;
}

.likert-emoji {
  font-size: 1.75rem;
  margin-bottom: 8px;
  transition: transform 0.2s;
}

.likert-card:hover .likert-emoji {
  transform: scale(1.2);
}

.likert-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: #cbd5e1;
  line-height: 1.3;
}

.likert-card.checked {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
  box-shadow: 0 0 18px rgba(99, 102, 241, 0.35);
}

.likert-card.checked .likert-text {
  color: #fff;
}

/* NPS 0-10 Selector */
.nps-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nps-button-group {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 6px;
}

@media (max-width: 600px) {
  .nps-button-group {
    grid-template-columns: repeat(6, 1fr);
  }
}

.nps-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 700;
  color: #cbd5e1;
  cursor: pointer;
  transition: var(--transition);
}

.nps-btn:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--primary);
  color: white;
  transform: translateY(-2px);
}

.nps-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.5);
  transform: scale(1.05);
}

.nps-labels {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Text Inputs & Textarea */
.other-input-container {
  margin-top: 12px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.other-input-container.visible {
  max-height: 100px;
  opacity: 1;
}

.text-field {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  color: white;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.text-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: rgba(15, 23, 42, 0.9);
}

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

textarea.text-field {
  min-height: 110px;
  resize: vertical;
}

/* Submit Area */
.submit-wrapper {
  text-align: center;
  margin-top: 40px;
  margin-bottom: 60px;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  color: white;
  border: none;
  padding: 16px 48px;
  border-radius: var(--radius-full);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.45);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-submit:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 35px rgba(236, 72, 153, 0.55);
}

.btn-submit:active {
  transform: translateY(0) scale(0.98);
}

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

.footer-credits {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-top: 20px;
}

.footer-credits a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-credits a:hover {
  color: var(--primary);
}

/* Success Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 40px 30px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px rgba(99, 102, 241, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin-bottom: 20px;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.4);
}

.modal-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: white;
}

.modal-desc {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 28px;
  line-height: 1.5;
}

.modal-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 32px;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.modal-btn:hover {
  background: var(--primary-hover);
  box-shadow: 0 0 20px var(--primary-glow);
}

/* Animations */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

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