/* ============================================================
   09-utilities.css — Kurvin Utility Classes
   ============================================================ */

/* ── Display ── */
.d-none    { display: none !important; }
.d-block   { display: block !important; }
.d-flex    { display: flex !important; }
.d-grid    { display: grid !important; }
.d-inline  { display: inline !important; }
.d-inline-flex { display: inline-flex !important; }

/* ── Flex ── */
.flex-row      { flex-direction: row; }
.flex-col      { flex-direction: column; }
.flex-wrap     { flex-wrap: wrap; }
.flex-nowrap   { flex-wrap: nowrap; }
.flex-1        { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

.items-start   { align-items: flex-start; }
.items-center  { align-items: center; }
.items-end     { align-items: flex-end; }
.items-stretch { align-items: stretch; }

.justify-start   { justify-content: flex-start; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around  { justify-content: space-around; }

/* ── Gap ── */
.gap-1  { gap: var(--space-1); }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }

/* ── Padding ── */
.p-0 { padding: 0; }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.px-2 { padding-left: var(--space-2); padding-right: var(--space-2); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }

/* ── Margin ── */
.m-auto { margin: auto; }
.mt-2   { margin-top: var(--space-2); }
.mt-4   { margin-top: var(--space-4); }
.mt-6   { margin-top: var(--space-6); }
.mb-2   { margin-bottom: var(--space-2); }
.mb-4   { margin-bottom: var(--space-4); }
.mb-6   { margin-bottom: var(--space-6); }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

/* ── Width / Height ── */
.w-full     { width: 100%; }
.w-auto     { width: auto; }
.h-full     { height: 100%; }
.min-w-0    { min-width: 0; }
.max-w-none { max-width: none; }

/* ── Overflow ── */
.overflow-hidden  { overflow: hidden; }
.overflow-auto    { overflow: auto; }
.overflow-x-auto  { overflow-x: auto; }
.overflow-y-auto  { overflow-y: auto; }
.overflow-x-hidden { overflow-x: hidden; }

/* ── Position ── */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; top: 0; }
.inset-0  { inset: 0; }

/* ── Border Radius ── */
.rounded-sm   { border-radius: var(--radius-sm); }
.rounded-md   { border-radius: var(--radius-md); }
.rounded-lg   { border-radius: var(--radius-lg); }
.rounded-xl   { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* ── Color utils ── */
.bg-surface  { background: var(--color-bg-surface); }
.bg-panel    { background: var(--color-bg-panel); }
.border      { border: 1px solid var(--color-border); }
.border-strong { border: 1px solid var(--color-border-hover); }

.color-accent   { color: var(--color-accent); }
.color-muted    { color: var(--color-text-muted); }
.color-success  { color: var(--color-success); }
.color-error    { color: var(--color-error); }

/* ── Cursor ── */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.select-none    { user-select: none; }
.select-all     { user-select: all; }

/* ── Z-Index ── */
.z-raised   { z-index: var(--z-raised); }
.z-sticky   { z-index: var(--z-sticky); }
.z-modal    { z-index: var(--z-modal); }

/* ── Opacity ── */
.opacity-0   { opacity: 0; }
.opacity-50  { opacity: 0.5; }
.opacity-75  { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* ── Pointer events ── */
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }

/* ── GPU compositing ── */
.gpu { transform: translateZ(0); backface-visibility: hidden; }

/* ── Aspect Ratio ── */
.aspect-square  { aspect-ratio: 1; }
.aspect-video   { aspect-ratio: 16/9; }
.aspect-portrait { aspect-ratio: 2/3; }
.aspect-cinema  { aspect-ratio: 21/9; }

/* ── Separator ── */
.sep-h { height: 1px; background: var(--color-border); width: 100%; }
.sep-v { width: 1px;  background: var(--color-border); height: 100%; }

/* ── No-scrollbar helper ── */
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* ── Responsive show/hide ── */
@media (max-width: 900px)  { .hide-tablet { display: none !important; } }
@media (max-width: 600px)  { .hide-mobile { display: none !important; } }
@media (min-width: 601px)  { .show-mobile { display: none !important; } }
@media (min-width: 901px)  { .show-tablet { display: none !important; } }

/* ══════════════════════════════════════════════════════
   GLOBAL PAGE FIXES — padding, inputs, cards
   ══════════════════════════════════════════════════════ */

/* Every injected page fragment gets breathing room */
#content > div {
  padding: var(--space-6) var(--space-8);
  max-width: 1400px;
}

/* Inputs — clean, dark, sharp border, pink focus */
input[type="text"],
input[type="search"],
input[type="number"],
input[type="email"],
input[type="password"],
textarea,
select,
.input-base {
  background: var(--color-bg-surface) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: 4px !important;
  color: var(--color-text) !important;
  font-family: var(--font-sans) !important;
  font-size: var(--font-size-sm) !important;
  padding: 8px 12px !important;
  outline: none !important;
  transition: border-color 150ms ease, box-shadow 150ms ease !important;
  width: 100%;
}
input[type="text"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus,
.input-base:focus {
  border-color: var(--color-accent) !important;
  box-shadow: 0 0 0 2px rgba(255,20,147,0.12) !important;
}
input::placeholder,
textarea::placeholder { color: var(--color-text-faint) !important; }

/* Cards — consistent surface with hover lift */
.card, .app-card, .game-card, .media-card {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  transition: border-color 150ms ease, transform 150ms ease;
}
.card:hover, .app-card:hover, .game-card:hover, .media-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

/* Section rows — consistent spacing */
.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

/* Section titles use display font, no uppercase forcing */
.section-title {
  font-family: var(--font-display) !important;
  font-size: 2rem !important;
  text-transform: none !important;
  letter-spacing: 0.01em !important;
  line-height: 1 !important;
}

/* Tabs — clean underline style */
.media-tab, .games-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: var(--space-2) var(--space-4);
  text-transform: uppercase;
  transition: color 150ms ease, border-color 150ms ease;
}
.media-tab.active, .media-tab:hover,
.games-tab.active, .games-tab:hover {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* Skeleton cards */
.skeleton-card {
  background: var(--color-bg-surface-2);
  border-radius: 4px;
  animation: skeletonPulse 1.4s ease-in-out infinite;
}
@keyframes skeletonPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* Scrollbar — thin, accent-colored */
* { scrollbar-width: thin; scrollbar-color: var(--color-border) transparent; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-accent); }
