/* File: bj-core/vars.css
 * Shared CSS custom properties for 4th Move Logic blackjack training platform
 */

:root {
  /* Core colors */
  --bg: #050507;
  --text: #ffffff;
  --muted: rgba(255,255,255,0.62);

  /* Accent colors */
  --accent: #00e676;
  --danger: #ff0055;
  --gold: #ffd700;

  /* Panel/surface colors */
  --panel: rgba(10,10,12,0.92);
  --border: rgba(255,255,255,0.14);

  /* Felt table colors */
  --felt-a: #1c4a2e;
  --felt-b: #0a1510;
  --felt-glow: rgba(255,255,255,0.10);
  --felt-vignette: rgba(0,0,0,0.78);

  /* Typography */
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";

  /* Spacing */
  --radius: 14px;
  --shadow: 0 18px 60px rgba(0,0,0,0.55);

  /* Safe areas (for mobile) */
  --safe-b: max(15px, env(safe-area-inset-bottom));
  --safe-t: max(12px, env(safe-area-inset-top));

  /* Card dimensions (default, can be overridden) */
  --card-w: 96px;
  --card-h: 132px;

  /* Chip dimensions */
  --chip-sz: 58px;
  --bet-sz: 148px;

  /* Ad zones */
  --ad-width: 160px;
}

/* Common button styles */
.btn-base {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border-radius: 999px;
  height: 40px;
  padding: 0 18px;
  font-weight: 1000;
  letter-spacing: 0.6px;
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
  touch-action: manipulation;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.btn-base:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.22);
}
.btn-base:active {
  transform: translateY(1px);
}

/* Card styles */
.bj-card-base {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.55);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform-origin: center;
}
.bj-card-base.red { color: #d00000; }
.bj-card-base.black { color: #111; }
.bj-card-base.back {
  background: repeating-linear-gradient(45deg, #b0003a, #b0003a 6px, #7a0026 6px, #7a0026 12px);
  border: 4px solid #ffffff;
}
.bj-card-base.back * { display: none; }

/* Mobile breakpoints */
@media (max-width: 600px) {
  :root {
    --card-w: 64px;
    --card-h: 92px;
    --chip-sz: 54px;
    --bet-sz: 136px;
  }
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* UX POLISH: MICRO-INTERACTIONS & ACCESSIBILITY                              */
/* ══════════════════════════════════════════════════════════════════════════ */

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Better focus states for accessibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Remove default tap highlight on mobile */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Smooth transitions on interactive elements */
a, button, input, select, .btn, .card, .toggle {
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

/* Button press feedback */
button:active:not(:disabled),
.btn:active:not(:disabled) {
  transform: scale(0.97);
}

/* Hover lift effect for cards */
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 70px rgba(0,0,0,0.5);
}

/* Loading spinner animation */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Pulse animation for attention */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

/* Shake animation for errors */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake {
  animation: shake 0.5s ease-in-out;
}

/* Pop animation for success */
@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.pop {
  animation: pop 0.3s ease-in-out;
}

/* Fade in animation */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

/* Slide up animation */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-up {
  animation: slideUp 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.15);
}

/* Ripple effect for buttons (applied via JS) */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
}

.ripple:active::after {
  width: 200%;
  padding-bottom: 200%;
  opacity: 0;
  transition: width 0.4s ease, padding-bottom 0.4s ease, opacity 0.4s ease;
}

/* Disabled state */
:disabled,
.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Selection color */
::selection {
  background: rgba(0,230,118,0.3);
  color: #fff;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.25);
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
