@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

/* =============================================
   RED & WHITE PREMIUM DESIGN
   한동훈 토크콘서트 - Tailwind CSS + Custom
============================================= */

/* CSS Variables for custom components */
:root {
  --color-primary: #dc2626;
  --color-primary-dark: #b91c1c;
  --color-primary-light: #fef2f2;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #3b82f6;
  --color-text: #111827;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-bg: #ffffff;
  --shadow-red: 0 10px 40px -10px rgba(220, 38, 38, 0.5);
  --touch-target-min: 44px;
}

/* =============================================
   Base Styles (Tailwind preflight compatible)
============================================= */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* =============================================
   Header - Premium Red
============================================= */
.glass-header {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.glass-header a,
.glass-header span {
  color: white !important;
}

.glass-header a:hover {
  opacity: 0.9;
}

/* =============================================
   Main Content Area
============================================= */
.main-content {
  background: linear-gradient(180deg, #f9fafb 0%, #ffffff 100%);
  min-height: 100vh;
}

/* =============================================
   Glass Card - Premium Design
============================================= */
.glass-card {
  background: white;
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border: 1px solid #f3f4f6;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ef4444, #dc2626, #b91c1c);
}

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

/* =============================================
   Badge Styles
============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
}

.badge-red {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.badge-green {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.badge-yellow {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-gray {
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid #e5e7eb;
}

/* =============================================
   Countdown Timer
============================================= */
#countdownSection {
  background: linear-gradient(135deg, #fef2f2 0%, #ffffff 50%, #eff6ff 100%);
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid #fee2e2;
}

/* =============================================
   Accordion / Details
============================================= */
details {
  border-radius: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
}

details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::marker {
  display: none;
  content: '';
}

details summary svg {
  width: 1.25rem;
  height: 1.25rem;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

details[open] summary svg {
  transform: rotate(180deg);
}

/* =============================================
   Buttons - Premium Red Style
============================================= */
.btn-primary-glass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-red);
  position: relative;
  overflow: hidden;
  min-height: var(--touch-target-min);
}

.btn-primary-glass::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 ease;
}

.btn-primary-glass:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 50px -10px rgba(220, 38, 38, 0.6);
}

.btn-primary-glass:hover::before {
  left: 100%;
}

.btn-primary-glass:active {
  transform: translateY(-1px);
}

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

.btn-secondary-glass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: white;
  color: #374151;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid #e5e7eb;
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  min-height: var(--touch-target-min);
}

.btn-secondary-glass:hover {
  border-color: #fca5a5;
  color: #dc2626;
  background: #fef2f2;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 0.75rem;
  background: #fef2f2;
  border: 1px solid #fee2e2;
  color: #dc2626;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: #fee2e2;
  transform: scale(1.05);
}

.btn-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* =============================================
   Form Inputs
============================================= */
.input-glass {
  width: 100%;
  padding: 0.875rem 1rem;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 0.75rem;
  font-size: 1rem;
  color: #111827;
  transition: all 0.2s ease;
  min-height: var(--touch-target-min);
}

.input-glass:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.input-glass::placeholder {
  color: #9ca3af;
}

.input-glass.input-error {
  border-color: #ef4444;
}

.input-glass.input-valid {
  border-color: #10b981;
}

.input-group {
  position: relative;
}

.input-icon-right {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.validation-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: bold;
}

.validation-icon.valid {
  background: #dcfce7;
  color: #166534;
}

.input-hint {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.375rem;
}

.input-error-message {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: #ef4444;
  margin-top: 0.375rem;
}

.input-error-message svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* =============================================
   Alert Components
============================================= */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 1rem;
}

.alert-warning {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.alert-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.alert-icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
}

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

.alert-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.alert-message {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* =============================================
   Step Progress
============================================= */
.step-progress {
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.step-circle {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: #e5e7eb;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.step-item.active .step-circle {
  background: #dc2626;
  color: white;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.step-item.completed .step-circle {
  background: #10b981;
  color: white;
}

.step-label {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 500;
}

.step-item.active .step-label {
  color: #dc2626;
  font-weight: 600;
}

.step-line {
  width: 3rem;
  height: 2px;
  background: #e5e7eb;
  margin: 0 0.5rem;
  margin-bottom: 1.5rem;
  transition: background 0.3s ease;
}

.step-line.completed {
  background: #10b981;
}

/* =============================================
   Ticket Option Cards
============================================= */
.ticket-option {
  display: flex;
  align-items: center;
  padding: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
}

.ticket-option:hover {
  border-color: #fca5a5;
  background: #fef2f2;
}

.ticket-option.selected {
  border-color: #dc2626;
  background: #fef2f2;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* =============================================
   Ticket Card (Check Page)
============================================= */
.ticket-card {
  background: white;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.ticket-header {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white;
  padding: 1.5rem;
  text-align: center;
}

.ticket-header .check-icon {
  width: 3.5rem;
  height: 3.5rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.ticket-header .check-icon svg {
  width: 2rem;
  height: 2rem;
}

.ticket-body {
  padding: 1.5rem;
}

.ticket-divider {
  height: 1px;
  background: repeating-linear-gradient(90deg, #e5e7eb, #e5e7eb 8px, transparent 8px, transparent 16px);
  margin: 1rem 0;
}

.ticket-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.ticket-info-label {
  font-size: 0.875rem;
  color: #6b7280;
}

.ticket-info-value {
  font-weight: 600;
  color: #111827;
}

.ticket-qr {
  padding: 1.5rem;
  background: #f9fafb;
  text-align: center;
  border-top: 1px solid #e5e7eb;
}

.ticket-qr-code {
  display: inline-block;
  padding: 1rem;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.ticket-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
}

/* =============================================
   Bottom Navigation
============================================= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid #e5e7eb;
  display: none;
  padding: 0.5rem 0;
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

@media (max-width: 768px) {
  .bottom-nav {
    display: flex;
  }

  .main-content {
    padding-bottom: 80px;
  }
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  color: #6b7280;
  text-decoration: none;
  transition: all 0.2s ease;
  border-radius: 0.75rem;
  margin: 0 0.25rem;
  min-height: var(--touch-target-min);
}

.bottom-nav-item.active {
  color: #dc2626;
  background: #fef2f2;
}

.bottom-nav-item:hover {
  color: #dc2626;
}

.bottom-nav-item svg {
  width: 1.5rem;
  height: 1.5rem;
  margin-bottom: 0.125rem;
}

.bottom-nav-item span {
  font-size: 0.625rem;
  font-weight: 500;
}

/* =============================================
   Toast Notifications
============================================= */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (max-width: 640px) {
  .toast-container {
    left: 1rem;
    right: 1rem;
  }
}

.toast {
  background: white;
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  border: 1px solid #f3f4f6;
  animation: slideIn 0.3s ease;
}

.toast svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

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

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

/* =============================================
   Modal Backdrop & Content
============================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  padding: 1rem;
}

.modal-content {
  background: white;
  border-radius: 1.5rem;
  width: 100%;
  max-width: 28rem;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.3s ease;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
}

/* =============================================
   Offline Banner
============================================= */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #f59e0b;
  color: white;
  padding: 0.5rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.offline-banner svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* =============================================
   Skeleton Loading
============================================= */
.skeleton {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 0.5rem;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* =============================================
   Animation Utilities
============================================= */
.animate-spin {
  animation: spin 1s linear infinite;
}

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

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* =============================================
   Footer
============================================= */
footer {
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

/* =============================================
   Print Styles
============================================= */
@media print {
  .bottom-nav,
  .glass-header,
  .no-print {
    display: none !important;
  }

  body {
    background: white;
  }

  .glass-card {
    box-shadow: none;
    border: 1px solid #d1d5db;
  }
}
