/* ==========================================================================
   POLL Application Styling - Modern Glassmorphism Dark Theme
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

:root {
  --bg-dark: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(51, 65, 85, 0.8);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(99, 102, 241, 0.4);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #ef4444;
  --accent-cyan: #06b6d4;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --shadow-main: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables */
html.light {
  --bg-dark: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(248, 250, 252, 0.95);
  --border-color: rgba(15, 23, 42, 0.12);
  --border-glow: rgba(99, 102, 241, 0.5);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --shadow-main: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.2);
}

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

body {
  font-family: 'Noto Sans KR', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(16, 185, 129, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  padding: 40px 20px;
}

.container {
  max-width: 860px;
  margin: 0 auto;
}

.admin-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Header & Banner */
.survey-header {
  text-align: center;
  margin-bottom: 32px;
  position: relative;
}

.survey-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 6px 16px;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
}

.survey-title {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 30%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}

.survey-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-main);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.glass-card:hover {
  border-color: var(--border-glow);
}

/* Question Styling */
.question-number {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  display: block;
}

.question-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.question-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Options Grid / Group */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.options-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

/* Custom Checkbox & Radio Labels */
.option-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  font-size: 0.95rem;
}

.option-label:hover {
  background: rgba(51, 65, 85, 0.5);
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

.option-input {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-dim);
  border-radius: 4px;
  background: transparent;
  outline: none;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

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

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

.option-input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 13px;
  font-weight: bold;
}

.option-input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
}

.option-label:has(.option-input:checked) {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

/* Other Text Inputs */
.other-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.text-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: all var(--transition-fast);
}

.text-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  background: rgba(15, 23, 42, 0.9);
}

.textarea-input {
  width: 100%;
  min-height: 120px;
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: all var(--transition-fast);
}

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

/* NPS Selector (0-10) */
.nps-wrapper {
  margin-top: 16px;
}

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

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

.nps-btn {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nps-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
}

/* NPS Colors */
.nps-btn[data-nps="0"]:hover, .nps-btn[data-nps="1"]:hover, .nps-btn[data-nps="2"]:hover,
.nps-btn[data-nps="3"]:hover, .nps-btn[data-nps="4"]:hover, .nps-btn[data-nps="5"]:hover, .nps-btn[data-nps="6"]:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--accent-rose);
}

.nps-btn[data-nps="7"]:hover, .nps-btn[data-nps="8"]:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--accent-amber);
}

.nps-btn[data-nps="9"]:hover, .nps-btn[data-nps="10"]:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--accent-emerald);
}

/* Selected NPS states */
.nps-btn.selected[data-nps="0"], .nps-btn.selected[data-nps="1"], .nps-btn.selected[data-nps="2"],
.nps-btn.selected[data-nps="3"], .nps-btn.selected[data-nps="4"], .nps-btn.selected[data-nps="5"], .nps-btn.selected[data-nps="6"] {
  background: var(--accent-rose);
  border-color: var(--accent-rose);
  color: white;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.nps-btn.selected[data-nps="7"], .nps-btn.selected[data-nps="8"] {
  background: var(--accent-amber);
  border-color: var(--accent-amber);
  color: white;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.nps-btn.selected[data-nps="9"], .nps-btn.selected[data-nps="10"] {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: white;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

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

/* Submit Button & Actions */
.submit-btn {
  width: 100%;
  padding: 16px;
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.submit-btn:hover {
  opacity: 0.95;
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.4);
}

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

/* Thank You Success View */
.thankyou-box {
  text-align: center;
  padding: 48px 24px;
}

.thankyou-icon {
  width: 72px;
  height: 72px;
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid var(--accent-emerald);
  color: var(--accent-emerald);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 20px auto;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

/* Admin Dashboard Specific */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.admin-title-group h1 {
  font-size: 1.8rem;
  font-weight: 700;
}

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

.btn-secondary {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.btn-danger {
  padding: 6px 12px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid var(--accent-rose);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-danger:hover {
  background: var(--accent-rose);
  color: white;
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
}

.stat-sub {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Dashboard Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
}

.chart-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chart-container {
  position: relative;
  height: 260px;
  width: 100%;
}

/* Data Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  background: rgba(15, 23, 42, 0.8);
  padding: 14px 16px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  vertical-align: top;
}

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

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.badge-detractor { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.badge-passive { background: rgba(245, 158, 11, 0.2); color: #fde68a; }
.badge-promoter { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }

/* Login Form */
.login-card {
  max-width: 420px;
  margin: 80px auto;
}

.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--accent-rose);
  color: #fca5a5;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.9rem;
}

/* Theme Toggle Button (Matching jisu.best) */
.theme-toggle-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 40px;
  height: 40px;
  outline: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.theme-toggle-btn:hover {
  background: rgba(99, 102, 241, 0.25);
  transform: rotate(15deg) scale(1.08);
  border-color: var(--primary);
}

.sun-icon { display: none; width: 20px; height: 20px; }
.moon-icon { display: block; width: 20px; height: 20px; }
html.light .sun-icon { display: block; width: 20px; height: 20px; }
html.light .moon-icon { display: none; width: 20px; height: 20px; }

/* Light Theme Element Overrides */
html.light body {
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(16, 185, 129, 0.04) 0px, transparent 50%);
}

html.light .survey-title {
  background: linear-gradient(135deg, #0f172a 30%, #4338ca 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

html.light .option-label {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 23, 42, 0.12);
}

html.light .option-label:hover {
  background: rgba(238, 242, 255, 0.8);
  border-color: rgba(99, 102, 241, 0.6);
}

html.light .option-label:has(.option-input:checked) {
  background: rgba(99, 102, 241, 0.12);
  border-color: var(--primary);
}

html.light .text-input,
html.light .textarea-input {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(15, 23, 42, 0.18);
  color: var(--text-main);
}

html.light .nps-btn {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 23, 42, 0.15);
  color: var(--text-main);
}

html.light .data-table th {
  background: rgba(241, 245, 249, 0.9);
}

html.light .theme-toggle-btn {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.12);
}

