/* ==========================================================================
   SHOULDCARE STORE - DESIGN SYSTEM & ZERO-LAG GPU ANIMATIONS
   ========================================================================== */

:root {
  --sc-bg: #070b14;
  --sc-surface: #0c1221;
  --sc-surface-alt: #10182b;
  --sc-elevated: #141e36;
  --sc-border: rgba(148, 163, 184, 0.14);
  --sc-border-strong: rgba(139, 92, 246, 0.36);
  --sc-accent: #7c3aed;
  --sc-accent-2: #4f46e5;
  --sc-emerald: #10b981;
  --sc-amber: #f59e0b;
  --sc-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Tabular numerals & clean tap highlight */
html {
  -webkit-tap-highlight-color: transparent;
}

.font-mono,
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Eliminate expensive compositor repaints on weak PCs & mobile */
.backdrop-blur-md,
.backdrop-blur-lg,
.backdrop-blur-xl,
.backdrop-blur-2xl,
.backdrop-blur-3xl,
.backdrop-blur-sm,
.backdrop-blur-xs {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

header .bg-white\/95,
.theme-dark header .dark\:bg-\[\#0e1626\]\/95,
.theme-semiDark header .dark\:bg-\[\#0e1626\]\/95 {
  background-color: rgba(10, 15, 29, 0.98) !important;
}

.theme-light header .bg-white\/95 {
  background-color: rgba(255, 255, 255, 0.98) !important;
}

/* Stop idle GPU drain from continuous infinite loops */
.animate-border-spin,
.glowing-border::before {
  animation: none !important;
}

.blur-3xl {
  filter: none !important;
  opacity: 0.35;
}

/* Crisp obsidian surface elevation */
.sc-card {
  background: var(--sc-surface);
  border: 1px solid var(--sc-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 24px -16px rgba(0, 0, 0, 0.75);
  transition: transform 0.24s var(--sc-ease), border-color 0.24s ease, box-shadow 0.28s var(--sc-ease);
  contain: layout style;
}

.sc-card-hover:hover {
  transform: translate3d(0, -3px, 0);
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow:
    0 0 26px -6px rgba(124, 58, 237, 0.36),
    0 14px 28px -14px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.theme-light .sc-card {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.09);
  box-shadow: 0 6px 20px -12px rgba(15, 23, 42, 0.14);
}

.theme-light .sc-card-hover:hover {
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow:
    0 0 24px -6px rgba(99, 102, 241, 0.24),
    0 14px 26px -12px rgba(15, 23, 42, 0.2);
}

/* ==========================================================================
   HOMEPAGE SERVICE CARDS: GPU TRAVELING BORDER BEAM + SOFT HOVER GLOW
   ========================================================================== */
@keyframes scCardBeamSpin {
  from {
    transform: translate3d(-50%, -50%, 0) rotate(0deg);
  }
  to {
    transform: translate3d(-50%, -50%, 0) rotate(360deg);
  }
}

.group-card-item {
  isolation: isolate;
  box-shadow:
    0 0 18px -10px rgba(99, 102, 241, 0.22),
    0 10px 24px -16px rgba(0, 0, 0, 0.78),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Soft inner radial hover mist */
.group-card-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(85% 60% at 50% 0%, rgba(139, 92, 246, 0.18), rgba(56, 189, 248, 0.06) 55%, transparent 80%);
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  transition: opacity 0.3s var(--sc-ease);
}

.sc-beam-ring {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  pointer-events: none;
  z-index: 25;
  opacity: 0.56;
  transition: opacity 0.28s var(--sc-ease);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.sc-beam-spin {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 220%;
  aspect-ratio: 1 / 1;
  background: conic-gradient(
    from 0deg,
    transparent 0deg 102deg,
    rgba(99, 102, 241, 0.22) 132deg,
    rgba(168, 85, 247, 0.92) 160deg,
    rgba(56, 189, 248, 0.95) 174deg,
    transparent 182deg 282deg,
    rgba(99, 102, 241, 0.22) 312deg,
    rgba(168, 85, 247, 0.92) 340deg,
    rgba(56, 189, 248, 0.95) 354deg,
    transparent 360deg
  );
  will-change: transform;
  animation: scCardBeamSpin 5.6s linear infinite;
  animation-delay: calc(var(--sc-beam-i, 0) * -0.85s);
}

@media (hover: hover) {
  .group-card-item:hover {
    transform: translate3d(0, -4px, 0);
    border-color: rgba(167, 139, 250, 0.65);
    box-shadow:
      0 0 32px -4px rgba(139, 92, 246, 0.44),
      0 0 60px -14px rgba(56, 189, 248, 0.24),
      0 18px 34px -14px rgba(0, 0, 0, 0.85),
      inset 0 1px 0 rgba(255, 255, 255, 0.14);
  }
  .group-card-item:hover::after {
    opacity: 1;
  }
  .group-card-item:hover .sc-beam-ring {
    opacity: 1;
  }
}

.group-card-item:active {
  transform: scale(0.982);
  border-color: rgba(167, 139, 250, 0.72);
  box-shadow:
    0 0 28px -4px rgba(139, 92, 246, 0.48),
    0 12px 24px -12px rgba(0, 0, 0, 0.82);
}

.group-card-item:active::after,
.group-card-item:focus-within::after {
  opacity: 1;
}

.group-card-item:active .sc-beam-ring,
.group-card-item:focus-within .sc-beam-ring {
  opacity: 1;
}

@media (max-width: 640px) {
  .sc-beam-spin {
    animation-duration: 6.4s;
  }
  .sc-beam-ring {
    opacity: 0.62;
  }
  .group-card-item {
    box-shadow:
      0 0 20px -8px rgba(124, 58, 237, 0.3),
      0 10px 22px -14px rgba(0, 0, 0, 0.75);
  }
}

.theme-light .group-card-item:hover {
  box-shadow:
    0 0 28px -4px rgba(99, 102, 241, 0.34),
    0 0 54px -14px rgba(139, 92, 246, 0.2),
    0 16px 30px -12px rgba(15, 23, 42, 0.18);
}

/* Tactile Buttons with hover-only sheen (0% idle CPU) */
.sc-btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.16s var(--sc-ease), filter 0.16s ease, box-shadow 0.16s ease;
}

.sc-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 25%, rgba(255, 255, 255, 0.18) 50%, transparent 75%);
  transform: translate3d(-120%, 0, 0);
  transition: transform 0.45s var(--sc-ease);
  pointer-events: none;
}

.sc-btn:hover::after {
  transform: translate3d(120%, 0, 0);
}

.sc-btn:active {
  transform: scale(0.975);
}

/* Clean Unified Tables */
.sc-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 1rem;
  border: 1px solid var(--sc-border);
  background: rgba(9, 14, 26, 0.75);
}

.theme-light .sc-table-wrap {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.1);
}

.sc-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}

.sc-table thead th {
  background: rgba(15, 23, 42, 0.85);
  color: #94a3b8;
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 11px 14px;
  border-bottom: 1px solid var(--sc-border);
  white-space: nowrap;
}

.theme-light .sc-table thead th {
  background: #f8fafc;
  color: #475569;
}

.sc-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  vertical-align: middle;
}

.sc-table tbody tr:last-child td {
  border-bottom: none;
}

/* Rõ nét vạch phân cách giữa từng đơn hàng trên bảng lịch sử */
.sc-order-table {
  border-collapse: collapse;
}

.sc-order-table tbody tr:not(:last-child) > td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.theme-light .sc-order-table tbody tr:not(:last-child) > td {
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
}

.sc-table tbody tr {
  transition: background-color 0.14s ease;
}

.sc-table tbody tr:hover {
  background: rgba(148, 163, 184, 0.06);
}

/* Receipt / Ticket Perforated Divider */
.sc-receipt-divider {
  position: relative;
  height: 1px;
  border-top: 1px dashed rgba(148, 163, 184, 0.24);
  margin: 4px 0;
}

.sc-receipt-divider::before,
.sc-receipt-divider::after {
  content: "";
  position: absolute;
  top: -8px;
  width: 16px;
  height: 16px;
  border-radius: 9999px;
  background: #070b14;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.sc-receipt-divider::before {
  left: -28px;
}

.sc-receipt-divider::after {
  right: -28px;
}

/* ==========================================================================
   MODALS: SMOOTH POP ANIMATION + SOFT AMBIENT GLOW
   ========================================================================== */
@keyframes scCheckDraw {
  from { stroke-dashoffset: 36; }
  to { stroke-dashoffset: 0; }
}

@keyframes scModalPop {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0) scale(0.955);
  }
  70% {
    opacity: 1;
    transform: translate3d(0, -1px, 0) scale(1.006);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes scModalGlowAmbient {
  0%, 100% {
    box-shadow:
      0 0 32px -6px rgba(99, 102, 241, 0.22),
      0 0 72px -18px rgba(139, 92, 246, 0.14),
      0 24px 60px -15px rgba(0, 0, 0, 0.84),
      inset 0 1px 0 rgba(255, 255, 255, 0.09);
  }
  50% {
    box-shadow:
      0 0 42px -4px rgba(99, 102, 241, 0.34),
      0 0 88px -16px rgba(139, 92, 246, 0.22),
      0 24px 60px -15px rgba(0, 0, 0, 0.84),
      inset 0 1px 0 rgba(255, 255, 255, 0.13);
  }
}

@keyframes scSuccessGlowPulse {
  0%, 100% {
    box-shadow:
      0 0 38px -6px rgba(16, 185, 129, 0.26),
      0 0 86px -18px rgba(52, 211, 153, 0.16),
      0 24px 60px -15px rgba(0, 0, 0, 0.86),
      inset 0 1px 0 rgba(167, 243, 208, 0.16);
  }
  50% {
    box-shadow:
      0 0 52px -4px rgba(16, 185, 129, 0.40),
      0 0 105px -14px rgba(52, 211, 153, 0.25),
      0 24px 60px -15px rgba(0, 0, 0, 0.86),
      inset 0 1px 0 rgba(167, 243, 208, 0.24);
  }
}

.sc-modal-backdrop {
  background: rgba(4, 7, 16, 0.88);
  transition: opacity 0.22s var(--sc-ease);
}

.sc-lightbox-backdrop {
  background: rgba(2, 6, 16, 0.90);
  transition: opacity 0.2s var(--sc-ease);
}

.sc-modal-panel {
  position: relative;
  box-shadow:
    0 0 34px -6px rgba(99, 102, 241, 0.22),
    0 0 72px -18px rgba(139, 92, 246, 0.14),
    0 24px 60px -15px rgba(0, 0, 0, 0.84),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: box-shadow 0.35s var(--sc-ease);
}

.sc-modal-panel::after {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.55), rgba(56, 189, 248, 0.45), transparent);
  pointer-events: none;
  z-index: 30;
}

.is-open .sc-modal-panel,
.opacity-100 > .sc-modal-panel {
  animation: scModalPop 0.28s var(--sc-ease) both;
}

#globalOrderSuccessModal .sc-modal-panel,
#successModal .sc-modal-panel,
#spinNoticeDialog {
  box-shadow:
    0 0 40px -6px rgba(16, 185, 129, 0.28),
    0 0 88px -18px rgba(52, 211, 153, 0.18),
    0 24px 60px -15px rgba(0, 0, 0, 0.86),
    inset 0 1px 0 rgba(167, 243, 208, 0.18);
}

#globalOrderSuccessModal .sc-modal-panel::after,
#successModal .sc-modal-panel::after {
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.72), rgba(52, 211, 153, 0.5), transparent);
}

#globalOrderSuccessModal.is-open .sc-modal-panel,
#globalOrderSuccessModal.opacity-100 .sc-modal-panel,
#successModal:not(.hidden) .sc-modal-panel {
  animation: scModalPop 0.3s var(--sc-ease) both;
}

.is-open .sc-check-path {
  stroke-dasharray: 36;
  stroke-dashoffset: 36;
  animation: scCheckDraw 0.44s 0.1s var(--sc-ease) forwards;
}

/* ==========================================================================
   UNIFIED TOAST NOTIFICATIONS (SPRING ENTRANCE + PROGRESS DRAIN BAR)
   ========================================================================== */
@keyframes scToastIn {
  0% {
    opacity: 0;
    transform: translate3d(44px, -6px, 0) scale(0.92);
  }
  65% {
    opacity: 1;
    transform: translate3d(-4px, 0, 0) scale(1.015);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes scToastOut {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate3d(42px, -4px, 0) scale(0.94);
  }
}

@keyframes scToastInBottom {
  0% {
    opacity: 0;
    transform: translate3d(28px, 16px, 0) scale(0.92);
  }
  68% {
    opacity: 1;
    transform: translate3d(-2px, -2px, 0) scale(1.015);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes scToastOutBottom {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate3d(32px, 10px, 0) scale(0.94);
  }
}

@keyframes scToastDrain {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

.sc-toast {
  position: relative;
  overflow: hidden;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 260px;
  max-width: min(360px, calc(100vw - 2rem));
  padding: 0.875rem 2.15rem 1rem 0.95rem;
  border-radius: 1rem;
  background: rgba(13, 20, 38, 0.97);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow:
    0 14px 34px -10px rgba(0, 0, 0, 0.78),
    0 0 24px -8px var(--sc-toast-glow, rgba(99, 102, 241, 0.34)),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: scToastIn 0.4s var(--sc-ease) both;
  will-change: transform, opacity;
}

.sc-toast.is-leaving {
  animation: scToastOut 0.26s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.sc-toast--bottom {
  animation-name: scToastInBottom;
}

.sc-toast--bottom.is-leaving {
  animation-name: scToastOutBottom;
}

.sc-toast-icon {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.9rem;
  flex-shrink: 0;
  background: var(--sc-toast-accent, #4f46e5);
  box-shadow: 0 0 14px -2px var(--sc-toast-glow, rgba(99, 102, 241, 0.55));
}

.sc-toast-body {
  flex: 1 1 auto;
  min-width: 0;
}

.sc-toast-title {
  margin: 0;
  font-weight: 800;
  font-size: 0.78rem;
  line-height: 1.25;
  color: #ffffff;
}

.sc-toast-msg {
  margin: 0.15rem 0 0;
  font-size: 0.7rem;
  line-height: 1.4;
  color: #cbd5e1;
  word-break: break-word;
}

.sc-toast-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 0.65rem;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.sc-toast-close:hover {
  color: #f8fafc;
  background: rgba(148, 163, 184, 0.14);
}

.sc-toast-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.sc-toast-fill {
  width: 100%;
  height: 100%;
  transform-origin: left center;
  background: var(--sc-toast-bar, linear-gradient(90deg, #6366f1, #a855f7));
  box-shadow: 0 0 8px var(--sc-toast-glow, rgba(99, 102, 241, 0.65));
  animation: scToastDrain var(--sc-toast-dur, 4200ms) linear forwards;
  will-change: transform;
}

.sc-toast--info {
  --sc-toast-accent: linear-gradient(135deg, #4f46e5, #6366f1);
  --sc-toast-glow: rgba(99, 102, 241, 0.48);
  --sc-toast-bar: linear-gradient(90deg, #6366f1, #a855f7, #38bdf8);
  border-color: rgba(99, 102, 241, 0.34);
}

.sc-toast--success {
  --sc-toast-accent: linear-gradient(135deg, #059669, #10b981);
  --sc-toast-glow: rgba(16, 185, 129, 0.48);
  --sc-toast-bar: linear-gradient(90deg, #10b981, #34d399, #2dd4bf);
  border-color: rgba(16, 185, 129, 0.36);
}

.sc-toast--warning {
  --sc-toast-accent: linear-gradient(135deg, #d97706, #f59e0b);
  --sc-toast-glow: rgba(245, 158, 11, 0.45);
  --sc-toast-bar: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-color: rgba(245, 158, 11, 0.36);
}

.sc-toast--error {
  --sc-toast-accent: linear-gradient(135deg, #e11d48, #f43f5e);
  --sc-toast-glow: rgba(244, 63, 94, 0.48);
  --sc-toast-bar: linear-gradient(90deg, #f43f5e, #fb7185);
  border-color: rgba(244, 63, 94, 0.38);
}

/* Smooth subtle scroll reveal (GPU only) */
@keyframes scFadeUp {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.sc-fade-in {
  animation: scFadeUp 0.28s var(--sc-ease) both;
}

/* Sleek Dark Scrollbars & Mobile Overflow Safety */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.38);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.55);
}

.overflow-x-auto {
  -webkit-overflow-scrolling: touch;
}

/* Unified crisp table rhythm inside dark & admin dashboards */
.overflow-x-auto > table {
  border-collapse: separate;
  border-spacing: 0;
}

.overflow-x-auto > table thead th {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}

/* Crisp Focus Ring on Inputs */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.28);
}

/* Lightweight GPU Roblox Check & Service Card Transitions */
@keyframes scCheckPop {
  from {
    opacity: 0;
    transform: translate3d(0, 6px, 0) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.sc-check-pop {
  animation: scCheckPop 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes scFadeSlideUp {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.sc-stagger-in {
  animation: scFadeSlideUp 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--sc-delay, 0) * 45ms);
}

.gd-tier-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.22s ease;
}

.gd-tier-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 65%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  transform: skewX(-18deg);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

@media (hover: hover) {
  .gd-tier-card:hover {
    transform: translate3d(0, -3px, 0);
  }
  .gd-tier-card:hover::before {
    transform: translate3d(380%, 0, 0) skewX(-18deg);
  }
}

/* Accessibility & Low-End Device Motion Protection */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
