@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --tk-bg: #f4f5f7;
  --tk-card-bg: #ffffff;
  --tk-black: #161823;
  --tk-dark: #ffffff;
  --tk-dark-2: #ffffff;
  --tk-dark-3: #f1f2f5;
  --tk-red: #FE2C55;
  --tk-cyan: #00B5B0;
  --tk-white: #ffffff;
  --tk-gray: #757575;
  --tk-gray-light: #555555;
  --tk-green: #00c853;
  --tk-gold: #ffb800;
  --glow-red: 0 4px 20px rgba(254, 44, 85, 0.35);
  --glow-cyan: 0 4px 20px rgba(0, 181, 176, 0.25);
  --glow-green: 0 4px 20px rgba(0, 200, 83, 0.25);
  --glass-bg: #ffffff;
  --glass-border: #e1e2e6;
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: #f4f5f7 !important;
  color: #161823 !important;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
  min-height: 100vh;
  position: relative;
}

/* ===== HEADER ===== */
.tk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: none;
  position: relative;
  top: 0;
  background: transparent;
  backdrop-filter: none;
  z-index: 100;
}

.tk-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 20px;
}

.tk-logo svg, .tk-logo-icon { width: 28px; height: 28px; object-fit: contain; vertical-align: middle; }

.tk-logo .logo-text span:first-child { color: var(--tk-cyan); }
.tk-logo .logo-text span:last-child { color: var(--tk-red); }

.header-balance {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(0,240,118,0.15), rgba(0,240,118,0.05));
  border: 1px solid rgba(0,240,118,0.3);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 14px;
  color: var(--tk-green);
}

/* ===== GLASSMORPHISM CARD ===== */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px;
  margin: 16px 0;
}

.glass-card-glow {
  box-shadow: var(--glow-red);
}

/* ===== BUTTONS ===== */
.btn-primary {
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-red {
  background: linear-gradient(135deg, var(--tk-red), #e91e4d);
  color: var(--tk-white);
  box-shadow: var(--glow-red);
}

.btn-red:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(254,44,85,0.6), 0 0 80px rgba(254,44,85,0.2);
}

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

.btn-cyan {
  background: linear-gradient(135deg, var(--tk-cyan), #1ad4ce);
  color: var(--tk-black);
  box-shadow: var(--glow-cyan);
}

.btn-white-blue {
  background: #161823 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 15px rgba(22, 24, 35, 0.2);
  transition: all 0.3s ease;
}

.btn-white-blue:hover,
.btn-white-blue:active,
.btn-white-blue:focus {
  background: #000000 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.btn-green {
  background: linear-gradient(135deg, var(--tk-green), #00c864);
  color: var(--tk-black);
  box-shadow: var(--glow-green);
}

.btn-disabled {
  background: var(--tk-dark-3) !important;
  color: var(--tk-gray) !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
}

/* ===== PULSE ANIMATION ===== */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: var(--glow-red); }
  50% { box-shadow: 0 0 40px rgba(254,44,85,0.6), 0 0 100px rgba(254,44,85,0.2); }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

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

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

@keyframes countUp {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

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

@keyframes progressFill {
  from { width: 0; }
}

.animate-pulse { animation: pulse 2s infinite; }
.animate-glow { animation: glow-pulse 2s infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-fadeInUp { animation: fadeInUp 0.5s ease-out forwards; }

/* ===== MODAL/OVERLAY ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal-content {
  background: #ffffff;
  color: #161823;
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 40px rgba(0,0,0,0.12);
  border-radius: 20px;
  padding: 32px 24px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  animation: fadeInUp 0.4s ease-out;
}

/* ===== SLIDER VERIFICATION ===== */
.slider-track {
  width: 100%;
  height: 50px;
  background: #f1f2f5;
  border-radius: 25px;
  position: relative;
  margin: 20px 0;
  border: 1px solid var(--glass-border);
  overflow: hidden;
}

.slider-target {
  position: absolute;
  right: 10px;
  top: 5px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px dashed var(--tk-red);
  opacity: 0.6;
}

.slider-handle {
  position: absolute;
  left: 5px;
  top: 5px;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--tk-red), #e91e4d);
  color: #ffffff;
  border-radius: 50%;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: box-shadow 0.3s;
  touch-action: none;
}

.slider-handle:active { cursor: grabbing; }
.slider-handle.matched {
  background: var(--tk-green) !important;
  box-shadow: var(--glow-green);
}

.slider-text {
  position: absolute;
  width: 100%;
  text-align: center;
  line-height: 50px;
  color: var(--tk-gray);
  font-size: 13px;
  pointer-events: none;
}

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

.stat-item {
  background: #ffffff;
  border: 1.5px solid #e8e8ed;
  box-shadow: 0 4px 15px rgba(0,0,0,0.04);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
}

.stat-value {
  font-size: 19px;
  font-weight: 900;
  white-space: nowrap;
  color: var(--tk-red);
  background: linear-gradient(135deg, #00B5B0, #FE2C55);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===== LIVE NOTIFICATION TOASTS ===== */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 310px;
  width: calc(100% - 40px);
  pointer-events: none; /* Entire container allows click-through */
}

.live-toast {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(254, 44, 85, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08), 0 0 10px rgba(254, 44, 85, 0.1);
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: none; /* Taps & clicks pass straight through to buttons below */
}

.live-toast.toast-exiting {
  animation: toastSlideOut 0.3s ease-in forwards;
}

.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(254, 44, 85, 0.1);
  border: 1px solid var(--tk-red);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  padding: 4px;
}

.toast-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.toast-body {
  font-size: 12px;
  color: #555555;
  line-height: 1.35;
}

.toast-user {
  font-weight: 700;
  color: #161823;
}

.toast-amount {
  font-weight: 800;
  color: var(--tk-red);
  display: inline-block;
  margin-left: 2px;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(-30px) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
    max-height: 60px;
  }
  to {
    opacity: 0;
    transform: translateX(-40px);
    max-height: 0;
    margin: 0;
    padding: 0;
  }
}

@keyframes toastSlideDownMobile {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 600px) {
  .toast-container {
    top: 14px;
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    max-width: 350px;
    width: calc(100% - 24px);
  }

  .live-toast {
    animation: toastSlideDownMobile 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    padding: 8px 12px;
  }
}

.stat-label {
  font-size: 12px;
  color: var(--tk-gray);
  margin-top: 4px;
}

/* ===== URGENCY BAR ===== */
.urgency-bar {
  background: linear-gradient(90deg, rgba(254,44,85,0.1), rgba(254,44,85,0.2));
  border: 1px solid rgba(254,44,85,0.3);
  border-radius: 10px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--tk-red);
  font-weight: 600;
}

.urgency-dot {
  width: 8px; height: 8px;
  background: var(--tk-red);
  border-radius: 50%;
  animation: pulse 1s infinite;
}

/* ===== QUIZ STYLES ===== */
.quiz-progress {
  width: 100%;
  height: 4px;
  background: var(--tk-dark-3);
  border-radius: 2px;
  margin: 16px 0 8px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--tk-cyan), var(--tk-red));
  border-radius: 2px;
  transition: width 0.5s ease;
  animation: progressFill 0.5s ease;
}

.quiz-counter {
  font-size: 13px;
  color: var(--tk-gray);
  text-align: center;
  margin-bottom: 20px;
}

.quiz-question {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.4;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.quiz-option {
  background: var(--tk-dark-2);
  border: 2px solid var(--glass-border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
}

.quiz-option:hover {
  border-color: rgba(254,44,85,0.5);
  background: rgba(254,44,85,0.05);
}

.quiz-option.selected {
  border-color: var(--tk-red);
  background: rgba(254,44,85,0.15);
  box-shadow: 0 0 15px rgba(254,44,85,0.2);
}

/* ===== REWARD TOAST ===== */
.reward-modal .reward-amount {
  font-size: 36px;
  font-weight: 900;
  color: var(--tk-green);
  text-shadow: var(--glow-green);
  margin: 16px 0;
  animation: countUp 0.5s ease-out;
}

.reward-modal .reward-icon {
  font-size: 48px;
  margin-bottom: 8px;
  animation: float 2s ease-in-out infinite;
}

/* ===== FORM STYLES ===== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--tk-gray-light);
  margin-bottom: 8px;
}

.form-select, .form-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--tk-dark-2);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--tk-white);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  transition: border-color 0.3s;
  outline: none;
}

.form-select:focus, .form-input:focus {
  border-color: var(--tk-cyan);
  box-shadow: 0 0 10px rgba(37,244,238,0.2);
}

.form-select option { background: var(--tk-dark); }

/* ===== BALANCE DISPLAY ===== */
.balance-display {
  text-align: center;
  padding: 24px;
  background: linear-gradient(135deg, rgba(0,240,118,0.1), rgba(37,244,238,0.05));
  border: 1px solid rgba(0,240,118,0.2);
  border-radius: 16px;
  margin: 16px 0;
}

.balance-label {
  font-size: 13px;
  color: var(--tk-gray);
  margin-bottom: 4px;
}

.balance-value {
  font-size: 40px;
  font-weight: 900;
  color: var(--tk-green);
  text-shadow: var(--glow-green);
}

/* ===== VIDEO SECTION ===== */
.video-container {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: var(--tk-dark-2);
  margin: 16px 0;
}

.video-timer {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.7);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--tk-cyan);
  z-index: 10;
}

/* ===== SOCIAL PROOF ===== */
.social-proof {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid #e1e2e6;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  border-radius: 12px;
  margin: 12px 0;
  font-size: 13px;
  color: #161823;
  animation: slideInRight 0.5s ease-out;
}

.avatars-stack {
  display: flex;
}

.avatars-stack .avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  margin-left: -8px;
  background: linear-gradient(135deg, #00B5B0, #FE2C55);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.avatars-stack .avatar:first-child { margin-left: 0; }

/* ===== TIKTOK MUSIC NOTE (decorative) ===== */
.music-note {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: #ffffff;
  color: #FE2C55;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: spin 4s linear infinite;
  border: 1.5px solid #e1e2e6;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  font-size: 16px;
  z-index: 50;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .container { padding: 0 12px; }
  .balance-value { font-size: 32px; }
  .quiz-question { font-size: 16px; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--tk-black); }
::-webkit-scrollbar-thumb { background: var(--tk-dark-3); border-radius: 2px; }

/* ===== LOADING SPINNER ===== */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--tk-dark-3);
  border-top-color: var(--tk-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

/* ===== CHECKMARKS ===== */
.check-list { list-style: none; margin: 16px 0; }
.check-list li {
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--tk-gray-light);
}
.check-list li::before {
  content: '✓';
  color: var(--tk-green);
  font-weight: 700;
  font-size: 16px;
}

/* ===== BADGE ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.badge-official {
  background: rgba(37,244,238,0.15);
  color: var(--tk-cyan);
  border: 1px solid rgba(37,244,238,0.3);
}
.badge-live {
  background: rgba(254,44,85,0.15);
  color: var(--tk-red);
  border: 1px solid rgba(254,44,85,0.3);
}
