/* ============================================================
   CricBata v3.0 — Utilities Module
   Text styles, colors, amounts, typography utilities
   ============================================================ */

/* ============================================================
   TEXT STYLES
   ============================================================ */

.text-xs { font-size: 10px; }
.text-sm { font-size: 11px; }
.text-base { font-size: 13px; }
.text-lg { font-size: 15px; }
.text-xl { font-size: 17px; }
.text-2xl { font-size: 19px; }

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.italic { font-style: italic; }
.underline { text-decoration: underline; }
.line-through { text-decoration: line-through; }

.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

.leading-tight { line-height: 1.2; }
.leading-normal { line-height: 1.4; }
.leading-relaxed { line-height: 1.6; }

.tracking-tight { letter-spacing: -0.01em; }
.tracking-normal { letter-spacing: 0; }
.tracking-wide { letter-spacing: 0.05em; }

/* ============================================================
   COLOR UTILITIES
   ============================================================ */

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }

.bg-root { background: var(--bg-root); }
.bg-primary { background: var(--bg-primary); }
.bg-secondary { background: var(--bg-secondary); }
.bg-hover { background: var(--bg-hover); }

/* ============================================================
   AMOUNT COLORS & CLASSES
   ============================================================ */

.amt-pos {
  color: rgb(34, 197, 94);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.amt-neg {
  color: rgb(239, 68, 68);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.amt-zero {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.amt-gold {
  color: #fbbf24;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.amt-large {
  font-size: 15px;
  font-weight: 700;
}

.amt-highlight {
  padding: 4px 8px;
  background: rgba(34, 197, 94, 0.1);
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   BORDERS & SHADOWS
   ============================================================ */

.border { border: 1px solid var(--border); }
.border-top { border-top: 1px solid var(--border); }
.border-bottom { border-bottom: 1px solid var(--border); }

.border-subtle {
  border: 1px solid var(--border-subtle);
}

.rounded { border-radius: 6px; }
.rounded-sm { border-radius: 4px; }
.rounded-md { border-radius: 8px; }
.rounded-lg { border-radius: 12px; }
.rounded-full { border-radius: 9999px; }

.shadow-sm {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.shadow {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.shadow-md {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.shadow-lg {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

/* ============================================================
   OPACITY
   ============================================================ */

.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* ============================================================
   DISPLAY & VISIBILITY
   ============================================================ */

.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.grid { display: grid; }

.visible { visibility: visible; }
.invisible { visibility: hidden; }

/* ============================================================
   CURSOR
   ============================================================ */

.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }
.cursor-text { cursor: text; }

/* ============================================================
   USER SELECT
   ============================================================ */

.select-none { user-select: none; }
.select-text { user-select: text; }
.select-all { user-select: all; }

/* ============================================================
   ANIMATIONS
   ============================================================ */

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

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-bounce {
  animation: bounce 1s infinite;
}

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-25%);
  }
}

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

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ============================================================
   TRANSITIONS
   ============================================================ */

.transition {
  transition: all 0.2s ease;
}

.transition-colors {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.transition-transform {
  transition: transform 0.2s ease;
}

.transition-opacity {
  transition: opacity 0.2s ease;
}

/* ============================================================
   SCROLLING
   ============================================================ */

.scroll-smooth {
  scroll-behavior: smooth;
}

.snap-mandatory {
  scroll-snap-type: x mandatory;
}

.snap-center {
  scroll-snap-align: center;
}

.snap-start {
  scroll-snap-align: start;
}

/* ============================================================
   POINTER EVENTS
   ============================================================ */

.pointer-events-auto {
  pointer-events: auto;
}

.pointer-events-none {
  pointer-events: none;
}

/* ============================================================
   TRANSFORM UTILITIES
   ============================================================ */

.translate-x-0 { transform: translateX(0); }
.translate-y-0 { transform: translateY(0); }

.scale-100 { transform: scale(1); }
.scale-95 { transform: scale(0.95); }
.scale-110 { transform: scale(1.1); }

.rotate-0 { transform: rotate(0deg); }
.rotate-90 { transform: rotate(90deg); }
.rotate-180 { transform: rotate(180deg); }

/* ============================================================
   BREAKPOINTS (Mobile-first)
   ============================================================ */

@media (min-width: 640px) {
  .sm\:w-full { width: 100%; }
  .sm\:max-w-sm { max-width: 24rem; }
}

@media (min-width: 768px) {
  .md\:w-full { width: 100%; }
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ============================================================
   DARK MODE (handled by data-theme attribute)
   ============================================================ */

[data-theme="dark"] {
  color-scheme: dark;
}

[data-theme="light"] {
  color-scheme: light;
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  .btn {
    border-width: 2px;
  }
}

/* ============================================================
   HIGH CONTRAST MODE
   ============================================================ */

@media (prefers-contrast: more) {
  body {
    font-weight: 500;
  }
  
  .btn {
    border-width: 2px;
  }
}


/* ── Edit Indicator (added by CricBata v3.0 Enhanced) ── */
.list-item.is-edited {
  background: rgba(255, 193, 7, 0.08);
  border-left: 3px solid #fbbf24;
  padding-left: 9px;
}
