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

:root {
  --primary: #a855f7;
  --primary-glow: rgba(168, 85, 247, 0.4);
  --bg-dark: #09090b;
  --bg-card: rgba(15, 15, 20, 0.85);
  --text-main: #ffffff;
  --text-muted: #a1a1aa;
  --border-color: rgba(168, 85, 247, 0.2);
  --glass-bg: rgba(168, 85, 247, 0.05);
  --glass-border: rgba(168, 85, 247, 0.15);
  --transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', sans-serif;
}

body {
  background-color: transparent;
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: -10%;
  right: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  bottom: -10%;
  left: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.1) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

#root {
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
  transition: var(--transition);
  font-family: 'Outfit', sans-serif;
  color: white;
}

input,
textarea,
select {
  font-family: 'Outfit', sans-serif;
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  transition: var(--transition);
  transform: translateZ(0);
  will-change: transform, border-color, box-shadow;
}

.glass-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px) translateZ(0);
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.2);
}

.glass-card-nohover {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9333ea;
}

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

.toast {
  background: rgba(15, 15, 20, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.25rem 1.75rem;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  min-width: 320px;
  position: relative;
  overflow: hidden;
  animation: toastIn 0.3s ease forwards;
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from {
    transform: translateX(100px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(100px);
    opacity: 0;
  }
}

.toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: bold;
  flex-shrink: 0;
}

.toast-success .toast-icon {
  background: var(--primary);
  color: #000;
}

.toast-error .toast-icon {
  background: #ff4444;
  color: #fff;
}

.toast-info .toast-icon {
  background: #3b82f6;
  color: #fff;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.toast-message {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  animation: progressShrink 3s linear forwards;
}

@keyframes progressShrink {
  from {
    width: 100%;
  }

  to {
    width: 0%;
  }
}

.gradient-text {
  background: linear-gradient(135deg, #ffffff 0%, #a855f7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
  justify-content: center;
  cursor: pointer;
}

.btn-primary:hover {
  transform: scale(1.02);
  background: #9333ea;
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.5);
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

@keyframes spin-anim {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.spinning {
  animation: spin-anim 1s linear infinite;
}

@keyframes snowfall {
  0% {
    transform: translateY(-10vh) translateX(0);
    opacity: 1;
  }

  100% {
    transform: translateY(100vh) translateX(20px);
    opacity: 0.3;
  }
}

.snowflake {
  position: fixed;
  background-color: white;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  filter: blur(1px);
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  padding: 1rem 2rem;
}

.nav-link {
  opacity: 0.7;
  transition: var(--transition);
  font-weight: 500;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link i {
  width: 18px;
  height: 18px;
}

.nav-link:hover {
  opacity: 1;
  color: var(--primary);
}

/* Responsive Navbar Optimization for Mobile */
@media (max-width: 768px) {
  .nav-links-container {
    gap: 0.75rem !important;
    /* Reduce space between tabs on mobile */
  }

  .nav-link span {
    display: none !important;
    /* Hide text on mobile */
  }

  .nav-link i {
    width: 22px;
    height: 22px;
    /* Make icons larger on mobile */
  }

  #perf-toggle-btn span {
    display: none !important;
    /* Hide "FPS Boost" text on mobile */
  }

  #perf-toggle-btn {
    padding: 0.5rem !important;
    /* Make performance toggle compact */
    border-radius: 50% !important;
  }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: var(--transition);
  color: white;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--primary);
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease;
}

.loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: 2rem;
}

.loading-spinner .outer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid transparent;
  border-top-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
  animation: spin-anim 2s linear infinite;
}

.loading-spinner .inner {
  position: absolute;
  inset: 15px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #fff;
  opacity: 0.5;
  animation: spin-anim 1.5s linear infinite reverse;
}

/* Background */
.gojo-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: #000;
  will-change: transform;
  transform: translateZ(0);
}

.gojo-bg img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
  z-index: 1;
}

.gojo-bg .energy-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(168, 85, 247, 0.1) 0%, transparent 80%);
  z-index: 2;
  pointer-events: none;
}

.gojo-bg .vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, transparent 40%, rgba(0, 0, 0, 0.8) 100%);
  z-index: 3;
  pointer-events: none;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 11, 0.9);
  /* More solid backdrop to avoid redrawing animating background */
  z-index: 3000;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.15s ease-out;
  will-change: opacity;
}

/* Fallback blur for modern fast devices only when not in performance mode */
@support (backdrop-filter: blur(8px)) {
  body:not(.perf-mode) .modal-overlay {
    background: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

.modal-overlay-right {
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 11, 0.85);
  z-index: 3000;
  display: flex;
  justify-content: flex-end;
  animation: fadeIn 0.15s ease-out;
  will-change: opacity;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: scale(0.96) translateZ(0);
    opacity: 0;
  }

  to {
    transform: scale(1) translateZ(0);
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%) translateZ(0);
  }

  to {
    transform: translateX(0) translateZ(0);
  }
}

.modal-content {
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
  transform: translateZ(0);
}

.cart-panel {
  width: 450px;
  height: 100%;
  background: #09090b;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
  transform: translateZ(0);
}

/* Custom Select */
.custom-select {
  position: relative;
}

.custom-select-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border: 1px solid var(--border-color);
}

.custom-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  background: #09090b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  z-index: 1000;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.2s ease;
}

.custom-select-option {
  padding: 12px 15px;
  cursor: pointer;
  transition: 0.2s;
}

.custom-select-option:hover {
  background: rgba(255, 255, 255, 0.05);
}

.custom-select-option.active {
  background: rgba(255, 255, 255, 0.1);
}

/* Product Card */
.product-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 16px;
  position: relative;
  transition: var(--transition);
}

.product-card:hover {
  transform: translateY(-10px);
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
}

/* Profile Menu Animation */
.profile-menu {
  position: absolute;
  top: 50px;
  right: 0;
  width: 200px;
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.2s ease;
}

/* Category Card */
.category-card {
  height: 350px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: 16px;
  transition: var(--transition);
}

.category-card:hover {
  transform: scale(1.05) translateY(-10px);
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
}

/* Input styles */
.input-field {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: white;
  outline: none;
  font-size: 0.95rem;
  transition: border-color 0.3s ease;
}

.input-field:focus {
  border-color: var(--primary);
}

.input-field-icon {
  width: 100%;
  padding: 14px 14px 14px 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: white;
  outline: none;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.input-field-icon:focus {
  border-color: var(--primary);
}

/* Toggle Switch */
.toggle-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.3s ease;
}

.toggle-track {
  width: 46px;
  height: 24px;
  border-radius: 20px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-track.on {
  background: var(--primary);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
}

.toggle-track.off {
  background: rgba(255, 255, 255, 0.1);
}

.toggle-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  position: absolute;
  top: 3px;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-track.on .toggle-thumb {
  left: 25px;
}

.toggle-track.off .toggle-thumb {
  left: 3px;
}

/* Wheel */
.wheel-container {
  position: relative;
  width: 380px;
  height: 380px;
  padding: 10px;
}

.wheel-outer-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 50px rgba(139, 92, 246, 0.2);
}

.wheel-pointer {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-top: 40px solid #ff4444;
  filter: drop-shadow(0 4px 10px rgba(255, 68, 68, 0.5));
}

.wheel-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 12px solid #1a1a1a;
  background: #0a0a0a;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.5);
  transition: transform 5s cubic-bezier(0.15, 0, 0, 1);
}

.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: #111;
  border: 6px solid #222;
  z-index: 40;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.wheel-center button {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  color: #000;
  font-weight: 900;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

/* Pulse animation for waiting indicator */
@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* Admin tabs */
.admin-tab {
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  white-space: nowrap;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: var(--transition);
}

/* Table styles */
table {
  border-collapse: collapse;
}

/* Misc */
.hidden {
  display: none !important;
}

.page-container {
  padding-top: 100px;
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 5rem;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.4s ease forwards;
}

/* Performance Mode (Lag Fix) */
body.perf-mode .gojo-bg img {
  display: none !important;
}

body.perf-mode #snowfall-container {
  display: none !important;
}

body.perf-mode .gojo-bg {
  background: radial-gradient(circle at center, #1c0836 0%, #09090b 100%) !important;
}

body.perf-mode .glass,
body.perf-mode .glass-card,
body.perf-mode .glass-card-nohover,
body.perf-mode .navbar {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(15, 15, 20, 0.96) !important;
  box-shadow: none !important;
}

body.perf-mode .glass-card:hover {
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.2) !important;
}