/*
 * ╔══════════════════════════════════════════════════╗
 * ║  villaGo — Utilities                            ║
 * ║  Single-purpose reusable utility classes.       ║
 * ╚══════════════════════════════════════════════════╝
 */

/* ── DISPLAY ─────────────────────────────────────── */
.y-u-flex        { display: flex; }
.y-u-flex-col    { display: flex; flex-direction: column; }
.y-u-grid        { display: grid; }
.y-u-block       { display: block; }
.y-u-inline      { display: inline; }
.y-u-inline-flex { display: inline-flex; }
.y-u-hidden      { display: none !important; }

/* ── ALIGNMENT ───────────────────────────────────── */
.y-u-center       { display: flex; align-items: center; justify-content: center; }
.y-u-between      { justify-content: space-between; }
.y-u-align-center { align-items: center; }
.y-u-text-center  { text-align: center; }
.y-u-text-right   { text-align: right; }
.y-u-text-left    { text-align: left; }

/* ── SIZING ──────────────────────────────────────── */
.y-u-w-full   { width: 100%; }
.y-u-h-full   { height: 100%; }
.y-u-w-screen { width: 100vw; }
.y-u-h-screen { height: 100vh; }

/* ── SPACING ─────────────────────────────────────── */
.y-u-m-0 { margin: 0; }
.y-u-p-0 { padding: 0; }

/* ── OVERFLOW ────────────────────────────────────── */
.y-u-overflow-hidden { overflow: hidden; }
.y-u-overflow-auto   { overflow: auto; }
.y-u-overflow-scroll { overflow: scroll; }

/* ── POSITION ────────────────────────────────────── */
.y-u-relative { position: relative; }
.y-u-absolute { position: absolute; }
.y-u-fixed    { position: fixed; }
.y-u-sticky   { position: sticky; }

/* ── CURSOR ──────────────────────────────────────── */
.y-u-pointer { cursor: pointer; }

/* ── VISUAL ──────────────────────────────────────── */
.y-u-rounded  { border-radius: var(--y-radius-m); }
.y-u-shadow   { box-shadow: var(--y-shadow-m); }
.y-u-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── FLEX UTILITIES ──────────────────────────────── */
.y-u-flex-1    { flex: 1; }
.y-u-shrink-0  { flex-shrink: 0; }
.y-u-flex-wrap { flex-wrap: wrap; }

/* ── GAP ─────────────────────────────────────────── */
.y-u-gap-2 { gap: var(--y-space-s); }
.y-u-gap-4 { gap: var(--y-space-m); }
.y-u-gap-6 { gap: var(--y-space-l); }

/* ── MARGIN SHORTCUTS ────────────────────────────── */
.mt-4  { margin-block-start: var(--y-space-m); }
.mt-6  { margin-block-start: var(--y-space-l); }
.mt-8  { margin-block-start: 32px; }
.mb-2  { margin-block-end: var(--y-space-s); }
.mb-4  { margin-block-end: var(--y-space-m); }
.mb-6  { margin-block-end: var(--y-space-l); }
.mb-8  { margin-block-end: 32px; }
.py-8  { padding-block: 32px; }
.py-12 { padding-block: 48px; }
.px-4  { padding-inline: var(--y-space-m); }

/* ── GRID LAYOUTS ────────────────────────────────── */
.grid-2   { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--y-space-m); }
.grid-3   { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--y-space-l); }
.grid-4   { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--y-space-l); }
.grid-1-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; }
.grid-2-1 { display: grid; grid-template-columns: 1fr 2fr; gap: 32px; }

/* ── MISC SHARED ─────────────────────────────────── */
.d-flex       { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1       { flex: 1; }
.shrink-0     { flex-shrink: 0; }

/* ── DIRECTION ───────────────────────────────────── */
.dir-ltr { direction: ltr; }

/* ── CARD ────────────────────────────────────────── */
.card {
  background: white;
  border: 1px solid var(--y-color-border);
  border-radius: var(--y-radius-l);
  padding: var(--y-space-l);
  box-shadow: var(--y-shadow-s);
}

/* ── CONTAINERS ──────────────────────────────────── */
.container {
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--y-space-m);
}

.container-sm {
  max-width: 896px;
  margin-inline: auto;
  padding-inline: var(--y-space-m);
}

/* ── PAGE WRAPPER ────────────────────────────────── */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
}

/* ── CHECKBOX LABEL ──────────────────────────────── */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--y-space-s);
  cursor: pointer;
}

.checkbox-label input {
  accent-color: var(--y-color-primary);
  cursor: pointer;
}

/* ── EMPTY STATE ─────────────────────────────────── */
.empty-state {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 var(--y-space-m);
  text-align: center;
}

.empty-state svg {
  width: 64px;
  height: 64px;
  color: rgba(138, 131, 120, 0.3);
  margin-block-end: var(--y-space-m);
}

.empty-state h2 {
  font-size: var(--y-font-xl);
  font-weight: var(--y-weight-bold);
}

.empty-state p {
  color: var(--y-color-text-muted);
  margin-block: var(--y-space-s) var(--y-space-l);
}

/* ── BACKGROUND ──────────────────────────────────── */
.bg-primary   { background: var(--y-color-primary); }
.bg-secondary { background: var(--y-color-secondary); }

/* ═══════════════════════════════════════════════════
   RESPONSIVE STYLES
   ═══════════════════════════════════════════════════ */

/* ── Large Desktop (lg) ──────────────────────────── */
@media (max-width: 1200px) {
  .grid-1-2, .grid-2-1 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ── Tablet (md) ─────────────────────────────────── */
@media (max-width: 992px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

/* ── Mobile Landscape / Large Phone (sm) ─────────── */
@media (max-width: 768px) {
  .y-u-grid        { grid-template-columns: 1fr; }
  .y-u-flex-col-sm { flex-direction: column; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ── Small Phone (xs) ────────────────────────────── */
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .card   { padding: var(--y-space-m); }
}
