/* ==============================================
   UTILITY CLASSES
   Spacing, typography, sizing, and display helpers
   ============================================== */

/* --- Spacing --- */
.m-0 { margin: 0; }
.mt-xs { margin-top: 4px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mt-xl { margin-top: 32px; }
.mb-xs { margin-bottom: 4px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.mb-xl { margin-bottom: 32px; }
.ml-sm { margin-left: 8px; }
.mr-sm { margin-right: 8px; }

.p-0 { padding: 0; }
.p-xs { padding: 4px; }
.p-sm { padding: 8px; }
.p-md { padding: 16px; }
.p-lg { padding: 24px; }
.p-xl { padding: 32px; }
.px-sm { padding-left: 8px; padding-right: 8px; }
.px-md { padding-left: 16px; padding-right: 16px; }
.py-sm { padding-top: 8px; padding-bottom: 8px; }
.py-md { padding-top: 16px; padding-bottom: 16px; }

/* --- Typography --- */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.85rem; }
.text-md { font-size: 1rem; }
.text-lg { font-size: 1.15rem; }
.text-xl { font-size: 1.35rem; }
.text-2xl { font-size: 1.75rem; }
.text-3xl { font-size: 2.25rem; }

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

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

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-gray { color: var(--text-tertiary); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-gold { color: var(--coin-gold); }
.text-white { color: #ffffff; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uppercase { text-transform: uppercase; }

/* --- Sizing --- */
.w-full { width: 100%; }
.w-auto { width: auto; }
.h-full { height: 100%; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 32rem; }
.max-w-lg { max-width: 48rem; }

/* --- Display & Layout --- */
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.flex-shrink-0 { flex-shrink: 0; }
.self-start { align-self: flex-start; }
.self-center { align-self: center; }
.self-end { align-self: flex-end; }

/* --- Grid extensions --- */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

/* --- Borders --- */
.border-b { border-bottom: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border { border: 1px solid var(--border); }
.rounded { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: 50%; }

/* --- Shadow --- */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* --- Special --- */
.completed-tint {
  background: rgba(74, 222, 128, 0.08) !important;
  border-color: var(--accent) !important;
}

.completed-tint:hover {
  background: rgba(74, 222, 128, 0.12) !important;
}

.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.select-none { user-select: none; }
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow-y: auto; }

.position-fixed { position: fixed; }
.bottom-lg { bottom: 96px; }
.right-lg { right: 24px; }
.z-10 { z-index: 10; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}
