/* ==========================================================================
   TEDxSNPSU Premium UX System
   ========================================================================== */

:root {
  --glass-bg: rgba(20, 20, 20, 0.45);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --premium-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --tedx-glow: 0 0 20px rgba(235, 0, 40, 0.4);
  --card-glow: 0 0 30px rgba(255, 255, 255, 0.03);
}

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

@keyframes pulseGlow {
  0% { box-shadow: 0 0 10px rgba(235, 0, 40, 0.2); }
  50% { box-shadow: 0 0 25px rgba(235, 0, 40, 0.5); }
  100% { box-shadow: 0 0 10px rgba(235, 0, 40, 0.2); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

.fade-in-up {
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.2s; opacity: 0; }
.delay-3 { animation-delay: 0.3s; opacity: 0; }

/* Glassmorphism Utilities */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-md);
}

.glass-card {
  background: linear-gradient(135deg, rgba(30, 30, 30, 0.6) 0%, rgba(10, 10, 10, 0.8) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border-radius: var(--radius-md);
  transition: var(--premium-transition);
}

.glass-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: var(--card-glow);
}

/* Premium Buttons */
.btn-premium {
  position: relative;
  overflow: hidden;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: var(--premium-transition);
  z-index: 1;
}

.btn-premium::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(45deg, var(--accent), var(--accent-2));
  z-index: -1;
  transition: opacity 0.3s ease;
  opacity: 0;
}

.btn-premium:hover {
  transform: translateY(-2px);
  box-shadow: var(--tedx-glow);
}

.btn-premium:hover::before {
  opacity: 1;
}

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

/* Auth Split Layout */
.auth-split-layout {
  display: flex;
  min-height: calc(100vh - 100px);
  width: 100%;
  gap: 2rem;
  align-items: stretch;
  padding: 2rem 0;
}

.auth-story-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem;
  background: url('/images/tedx/hero-bg.jpg') center/cover no-repeat;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.auth-story-side::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.9) 0%, rgba(20,0,0,0.7) 100%);
  z-index: 1;
}

.auth-story-content {
  position: relative;
  z-index: 2;
}

.auth-story-content h1 {
  font-family: tedx-display, 'Inter', sans-serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
  margin-bottom: 1rem;
  background: linear-gradient(to right, #fff, #a6a6a6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-form-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 500px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .auth-split-layout {
    flex-direction: column;
  }
  .auth-story-side {
    padding: 2rem;
    min-height: 300px;
  }
}

/* Premium Inputs */
.input-premium {
  width: 100%;
  background: rgba(15, 15, 15, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: var(--premium-transition);
}

.input-premium:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(25, 25, 25, 0.9);
  box-shadow: 0 0 0 3px rgba(235, 0, 40, 0.15);
}

.input-premium::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.field-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
}

.field-wrapper label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: #d0d0d0;
  font-weight: 500;
}

/* Form Validation states */
.field-wrapper.has-error .input-premium {
  border-color: var(--danger);
  background: rgba(212, 63, 63, 0.05);
}

.field-wrapper.has-success .input-premium {
  border-color: var(--success);
}

.error-text {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 0.4rem;
  display: block;
  animation: fadeInUp 0.3s ease;
}

/* Wizard Steps */
.wizard-event-banner {
  width: 100%;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(235, 0, 40, 0.22);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(235, 0, 40, 0.16), rgba(255, 255, 255, 0.04));
  text-align: center;
}

.wizard-event-banner span {
  display: block;
  color: #ffffff;
  font-size: clamp(1rem, 2.8vw, 1.35rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
}

.wizard-progress-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 100%;
  margin-bottom: 2rem;
  padding: 0 0.25rem 1.35rem;
  position: relative;
}

.wizard-progress-bar::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 16.666%;
  right: 16.666%;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 1;
}

.wizard-step-indicator {
  min-width: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--muted);
  position: relative;
  z-index: 2;
  transition: var(--premium-transition);
}

.wizard-step-indicator.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: var(--tedx-glow);
}

.wizard-step-indicator.completed {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.wizard-step-label {
  position: absolute;
  top: 45px;
  width: max-content;
  max-width: 72px;
  font-size: 0.76rem;
  line-height: 1.1;
  white-space: normal;
  text-align: center;
  color: var(--muted);
  transform: translateX(-50%);
  left: 50%;
  transition: color 0.3s ease;
}

.wizard-step-indicator.active .wizard-step-label {
  color: #fff;
  font-weight: 500;
}

@media (max-width: 520px) {
  .wizard-progress-bar {
    gap: 0.45rem;
    margin-bottom: 1.75rem;
    padding: 0 0 1.15rem;
  }

  .wizard-step-indicator {
    width: 32px;
    height: 32px;
    font-size: 0.86rem;
  }

  .wizard-progress-bar::before {
    top: 16px;
  }

  .wizard-step-label {
    top: 40px;
    max-width: 60px;
    font-size: 0.68rem;
  }
}

/* Loading Overlay */
.premium-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.premium-loading-overlay.is-active {
  opacity: 1;
  pointer-events: all;
}

.tedx-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(235, 0, 40, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1.5rem;
}

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

.loading-text {
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: #fff;
}

/* Dashboard Premium Layout */
.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.kpi-glass {
  background: rgba(20, 20, 20, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--premium-transition);
}

.kpi-glass:hover {
  transform: translateY(-3px);
  background: rgba(30, 30, 30, 0.7);
  border-color: rgba(255, 255, 255, 0.1);
}

.kpi-icon-box {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--accent);
}

.kpi-data h4 {
  margin: 0 0 0.25rem 0;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
}

.kpi-data p {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

/* Premium Tables */
.table-premium-wrap {
  background: rgba(15, 15, 15, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.table-premium {
  width: 100%;
  border-collapse: collapse;
}

.table-premium th {
  background: rgba(0, 0, 0, 0.4);
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table-premium td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
  font-size: 0.95rem;
}

.table-premium tbody tr {
  transition: background 0.2s ease;
}

.table-premium tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Scanner Fullscreen */
.scanner-fullscreen {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.scanner-header {
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

.scanner-viewport {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.scanner-overlay-box {
  width: 250px;
  height: 250px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  position: relative;
  box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.5);
}

.scanner-overlay-box::before,
.scanner-overlay-box::after {
  content: '';
  position: absolute;
  width: 40px;
  height: 40px;
  border-color: var(--accent);
  border-style: solid;
}

.scanner-overlay-box::before {
  top: -2px; left: -2px;
  border-width: 4px 0 0 4px;
  border-top-left-radius: 20px;
}

.scanner-overlay-box::after {
  bottom: -2px; right: -2px;
  border-width: 0 4px 4px 0;
  border-bottom-right-radius: 20px;
}
