/* /public/css/create-event.css */
/* ============================================
   CREATE EVENT PAGE STYLES
   Mobile-first design matching scan.html style
   ============================================ */

/* Page body - FIXED: removed overflow:hidden */
.create-page {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ============================================
   FIXED HEADER
   ============================================ */

.create-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.create-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  color: white;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.2s;
}

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

.back-icon {
  font-size: 18px;
}

.create-page-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  padding: 8px 14px;
  border-radius: 20px;
}

.badge-icon {
  font-size: 16px;
}

.badge-text {
  color: white;
  font-size: 14px;
  font-weight: 600;
}

/* ============================================
   MAIN CONTENT - FIXED: proper scrolling
   ============================================ */

.create-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: 60px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ============================================
   PAGE TITLE
   ============================================ */

.create-title {
  text-align: center;
  padding: 20px 16px 10px;
  flex-shrink: 0;
}

.create-title h1 {
  color: white;
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 6px 0;
}

.create-title p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  margin: 0;
}

/* ============================================
   FORM SECTION
   ============================================ */

.create-form-section {
  display: flex;
  flex-direction: column;
  padding-bottom: 30px;
}

/* ============================================
   CARD CONTAINER
   ============================================ */

.create-card {
  background: white;
  margin: 10px 16px 20px;
  border-radius: 20px;
  padding: 24px 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.create-form-group {
  margin-bottom: 20px;
}

.create-form-group:last-of-type {
  margin-bottom: 0;
}

.create-form-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 8px;
}

.label-icon {
  font-size: 16px;
}

.required {
  color: #ef4444;
}

.optional {
  color: #94a3b8;
  font-weight: 400;
  font-size: 13px;
}

.create-form-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  color: #1e293b;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  outline: none;
  transition: all 0.2s;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.create-form-input:focus {
  border-color: #6366f1;
  background: white;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.create-form-input::placeholder {
  color: #94a3b8;
}

/* Number input arrows */
.create-form-input[type="number"] {
  -moz-appearance: textfield;
}

.create-form-input[type="number"]::-webkit-outer-spin-button,
.create-form-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.create-form-hint {
  font-size: 13px;
  color: #64748b;
  margin: 8px 0 0 0;
}

.create-form-error {
  font-size: 13px;
  color: #ef4444;
  margin: 8px 0 0 0;
}

/* ============================================
   CODE PREVIEW
   ============================================ */

.create-code-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 14px;
  background: #f0fdf4;
  border: 1px solid #22c55e;
  border-radius: 10px;
  font-size: 13px;
  overflow: hidden;
}

.preview-label {
  color: #16a34a;
  font-weight: 600;
  flex-shrink: 0;
}

.preview-value {
  color: #15803d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   TWO COLUMN ROW
   ============================================ */

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

.create-form-row .create-form-group {
  margin-bottom: 20px;
}

/* ============================================
   TOGGLE SWITCH
   ============================================ */

.create-toggle-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.create-toggle {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

.create-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-track {
  display: block;
  width: 52px;
  height: 28px;
  background: #e2e8f0;
  border-radius: 28px;
  cursor: pointer;
  transition: background 0.3s;
  position: relative;
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s;
}

.create-toggle input:checked + .toggle-track {
  background: #6366f1;
}

.create-toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(24px);
}

.toggle-label {
  font-size: 14px;
  color: #64748b;
}

/* ============================================
   QR STYLE OPTIONS
   ============================================ */

.create-qr-styles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.qr-style-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.qr-style-option:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.qr-style-option.selected {
  border-color: #6366f1;
  background: #eef2ff;
}

.qr-style-icon {
  font-size: 24px;
}

.qr-style-name {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.qr-style-option.selected .qr-style-name {
  color: #6366f1;
}

/* ============================================
   FORM ACTIONS
   ============================================ */

.create-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

/* ============================================
   BUTTONS
   ============================================ */

.create-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  border: none;
  flex: 1;
  font-family: inherit;
}

.create-btn.primary {
  color: white;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.create-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.create-btn.primary:active {
  transform: translateY(0);
}

.create-btn.primary:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.create-btn.secondary {
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.create-btn.secondary:hover {
  background: #e2e8f0;
  color: #475569;
}

.create-btn.outline {
  width: 100%;
  color: #6366f1;
  background: transparent;
  border: 2px solid #6366f1;
  flex: none;
}

.create-btn.outline:hover {
  background: #eef2ff;
}

.btn-icon {
  font-size: 18px;
}

/* ============================================
   SUCCESS SECTION
   ============================================ */

.create-success-section {
  display: flex;
  flex-direction: column;
  padding-bottom: 30px;
}

/* Success Animation */
.success-animation {
  text-align: center;
  padding: 20px 0 0;
}

.success-icon {
  font-size: 64px;
  animation: successBounce 0.6s ease-out;
}

@keyframes successBounce {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Event Name Display */
.success-event-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  margin-bottom: 24px;
}

.event-emoji {
  font-size: 24px;
}

.event-name-text {
  font-size: 18px;
  font-weight: 700;
  color: white;
}

/* Link Section */
.success-link-section {
  margin-bottom: 24px;
}

.success-link-container {
  display: flex;
  gap: 8px;
}

.success-link-input {
  flex: 1;
  padding: 14px 16px;
  font-size: 14px;
  color: #1e293b;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  outline: none;
  min-width: 0;
  font-family: inherit;
}

.success-link-copy {
  padding: 14px 18px;
  font-size: 18px;
  background: #6366f1;
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.success-link-copy:hover {
  background: #4f46e5;
  transform: scale(1.05);
}

.success-link-copy:active {
  transform: scale(0.95);
}

/* QR Section */
.success-qr-section {
  margin-bottom: 24px;
  text-align: center;
}

.success-qr-container {
  display: flex;
  justify-content: center;
  margin: 12px 0 16px;
}

.success-qr-preview {
  background: white;
  padding: 16px;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  display: inline-block;
}

.success-qr-preview canvas {
  display: block;
  width: 180px;
  height: 180px;
}

/* Success Actions */
.success-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.create-another-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 12px;
  font-size: 15px;
  color: #6366f1;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
  font-family: inherit;
}

.create-another-btn:hover {
  color: #4f46e5;
}

/* ============================================
   BUTTON RIPPLE EFFECT
   ============================================ */

.btn-ripple {
  position: relative;
  overflow: hidden;
}

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

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

/* ============================================
   RESPONSIVE - SMALL PHONES
   ============================================ */

@media (max-height: 700px) {
  .create-title {
    padding: 15px 16px 8px;
  }
  
  .create-title h1 {
    font-size: 22px;
  }
  
  .create-card {
    padding: 20px 16px;
    margin: 8px 16px 16px;
  }
  
  .create-form-group {
    margin-bottom: 16px;
  }
  
  .create-form-input {
    padding: 12px 14px;
  }
  
  .success-icon {
    font-size: 50px;
  }
}

@media (max-width: 380px) {
  .create-form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  
  .create-qr-styles {
    gap: 8px;
  }
  
  .qr-style-option {
    padding: 12px 8px;
  }
  
  .qr-style-icon {
    font-size: 20px;
  }
  
  .qr-style-name {
    font-size: 11px;
  }
}

/* ============================================
   TABLET & DESKTOP
   ============================================ */

@media (min-width: 768px) {
  .create-header {
    padding: 16px 24px;
  }
  
  .create-title {
    padding: 30px 24px 15px;
  }
  
  .create-title h1 {
    font-size: 32px;
  }
  
  .create-title p {
    font-size: 17px;
  }
  
  .create-card {
    max-width: 520px;
    margin: 15px auto 30px;
    padding: 32px 28px;
    border-radius: 24px;
  }
  
  .create-form-group {
    margin-bottom: 24px;
  }
  
  .create-form-label {
    font-size: 15px;
  }
  
  .create-form-input {
    padding: 16px 18px;
    font-size: 17px;
  }
  
  .create-btn {
    padding: 16px 28px;
    font-size: 17px;
  }
  
  .success-qr-preview canvas {
    width: 220px;
    height: 220px;
  }
}

/* ============================================
   LARGE DESKTOP
   ============================================ */

@media (min-width: 1024px) {
  .create-card {
    max-width: 560px;
  }
}

/* ============================================
   LOADING STATE FOR BUTTON
   ============================================ */

.create-btn.loading {
  pointer-events: none;
  position: relative;
  color: transparent;
}

.create-btn.loading::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================
   TOAST NOTIFICATION (FALLBACK)
   ============================================ */

.toast-notification {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1e293b;
  color: white;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-notification.toast-success {
  background: #22c55e;
}

.toast-notification.toast-error {
  background: #ef4444;
}

.toast-notification.toast-warning {
  background: #f59e0b;
}