/* ═══════════════════════════════════════════════════════════════════
   POSITIONING & DISPLAY UTILITIES
   ═══════════════════════════════════════════════════════════════════
   Purpose: Control element positioning, display, overflow,
   transforms, transitions, and visibility behavior.
   No pure white (#FFFFFF), no pure black (#000000).
   ═══════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════
   POSITION TYPES
   ═══════════════════════════════════════════════════════════════════ */

.static {
    position: static;
}

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.fixed {
    position: fixed;
}

.sticky {
    position: sticky;
}

/* ─── Sticky helpers ───────────────────────────────────────────────── */

.sticky-top {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky, 100);
}

.sticky-bottom {
    position: sticky;
    bottom: 0;
    z-index: var(--z-sticky, 100);
}

/* ═══════════════════════════════════════════════════════════════════
   POSITION INSETS
   ═══════════════════════════════════════════════════════════════════ */

/* ─── All sides ───────────────────────────────────────────────────── */

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.inset-auto {
    inset: auto;
}

.inset-x-0 {
    left: 0;
    right: 0;
}

.inset-y-0 {
    top: 0;
    bottom: 0;
}

/* ─── Top ──────────────────────────────────────────────────────────── */

.top-0 {
    top: 0;
}

.top-auto {
    top: auto;
}

.top-1 {
    top: var(--xs, 4px);
}

.top-2 {
    top: var(--sm, 8px);
}

.top-3 {
    top: var(--md, 16px);
}

.top-4 {
    top: var(--lg, 24px);
}

.top-5 {
    top: var(--xl, 32px);
}

.top-6 {
    top: var(--xxl, 48px);
}

/* ─── Right ────────────────────────────────────────────────────────── */

.right-0 {
    right: 0;
}

.right-auto {
    right: auto;
}

.right-1 {
    right: var(--xs, 4px);
}

.right-2 {
    right: var(--sm, 8px);
}

.right-3 {
    right: var(--md, 16px);
}

.right-4 {
    right: var(--lg, 24px);
}

.right-5 {
    right: var(--xl, 32px);
}

/* ─── Bottom ───────────────────────────────────────────────────────── */

.bottom-0 {
    bottom: 0;
}

.bottom-auto {
    bottom: auto;
}

.bottom-1 {
    bottom: var(--xs, 4px);
}

.bottom-2 {
    bottom: var(--sm, 8px);
}

.bottom-3 {
    bottom: var(--md, 16px);
}

.bottom-4 {
    bottom: var(--lg, 24px);
}

.bottom-5 {
    bottom: var(--xl, 32px);
}

/* ─── Left ─────────────────────────────────────────────────────────── */

.left-0 {
    left: 0;
}

.left-auto {
    left: auto;
}

.left-1 {
    left: var(--xs, 4px);
}

.left-2 {
    left: var(--sm, 8px);
}

.left-3 {
    left: var(--md, 16px);
}

.left-4 {
    left: var(--lg, 24px);
}

.left-5 {
    left: var(--xl, 32px);
}

/* ─── Center positioning ──────────────────────────────────────────── */

.center-absolute {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.center-fixed {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ═══════════════════════════════════════════════════════════════════
   Z-INDEX LAYERS
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Numeric z-index ─────────────────────────────────────────────── */

.z-0 {
    z-index: 0;
}

.z-10 {
    z-index: 10;
}

.z-20 {
    z-index: 20;
}

.z-30 {
    z-index: 30;
}

.z-40 {
    z-index: 40;
}

.z-50 {
    z-index: 50;
}

.z-auto {
    z-index: auto;
}

/* ─── Semantic z-index (from variables) ──────────────────────────── */

.z-base {
    z-index: var(--z-base, 1);
}

.z-low {
    z-index: var(--z-low, 10);
}

.z-medium {
    z-index: var(--z-medium, 100);
}

.z-high {
    z-index: var(--z-high, 200);
}

.z-dropdown {
    z-index: var(--z-dropdown, 300);
}

.z-modal {
    z-index: var(--z-modal, 500);
}

.z-tooltip {
    z-index: var(--z-tooltip, 600);
}

.z-toast {
    z-index: var(--z-toast, 999);
}

.z-loader {
    z-index: var(--z-loader, 9999);
}

.z-max {
    z-index: 99999;
}

/* ═══════════════════════════════════════════════════════════════════
   DISPLAY TYPES
   ═══════════════════════════════════════════════════════════════════ */

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

.inline {
    display: inline;
}

.flex {
    display: flex;
}

.inline-flex {
    display: inline-flex;
}

.grid {
    display: grid;
}

.inline-grid {
    display: inline-grid;
}

.contents {
    display: contents;
}

.table {
    display: table;
}

.table-cell {
    display: table-cell;
}

.table-row {
    display: table-row;
}

.none {
    display: none;
}

/* ─── Flex direction ───────────────────────────────────────────────── */

.flex-row {
    flex-direction: row;
}

.flex-col {
    flex-direction: column;
}

.flex-row-reverse {
    flex-direction: row-reverse;
}

.flex-col-reverse {
    flex-direction: column-reverse;
}

/* ─── Flex wrap ────────────────────────────────────────────────────── */

.flex-wrap {
    flex-wrap: wrap;
}

.flex-nowrap {
    flex-wrap: nowrap;
}

.flex-wrap-reverse {
    flex-wrap: wrap-reverse;
}

/* ─── Flex grow/shrink ────────────────────────────────────────────── */

.flex-1 {
    flex: 1;
}

.flex-auto {
    flex: auto;
}

.flex-none {
    flex: none;
}

.flex-initial {
    flex: 0 1 auto;
}

.flex-grow {
    flex-grow: 1;
}

.flex-grow-0 {
    flex-grow: 0;
}

.flex-shrink {
    flex-shrink: 1;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

/* ─── Flex alignment ───────────────────────────────────────────────── */

.items-start {
    align-items: flex-start;
}

.items-center {
    align-items: center;
}

.items-end {
    align-items: flex-end;
}

.items-stretch {
    align-items: stretch;
}

.items-baseline {
    align-items: baseline;
}

/* ─── Flex justification ───────────────────────────────────────────── */

.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;
}

.justify-evenly {
    justify-content: space-evenly;
}

/* ─── Flex content ─────────────────────────────────────────────────── */

.content-start {
    align-content: flex-start;
}

.content-center {
    align-content: center;
}

.content-end {
    align-content: flex-end;
}

.content-between {
    align-content: space-between;
}

.content-around {
    align-content: space-around;
}

.content-stretch {
    align-content: stretch;
}

/* ═══════════════════════════════════════════════════════════════════
   VISIBILITY
   ═══════════════════════════════════════════════════════════════════ */

.visible {
    visibility: visible;
}

.invisible {
    visibility: hidden;
}

/* ─── Hide element visually but keep in layout ────────────────────── */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   OVERFLOW
   ═══════════════════════════════════════════════════════════════════ */

.overflow-auto {
    overflow: auto;
}

.overflow-hidden {
    overflow: hidden;
}

.overflow-visible {
    overflow: visible;
}

.overflow-scroll {
    overflow: scroll;
}

.overflow-clip {
    overflow: clip;
}

.overflow-x-auto {
    overflow-x: auto;
}

.overflow-y-auto {
    overflow-y: auto;
}

.overflow-x-hidden {
    overflow-x: hidden;
}

.overflow-y-hidden {
    overflow-y: hidden;
}

.overflow-x-scroll {
    overflow-x: scroll;
}

.overflow-y-scroll {
    overflow-y: scroll;
}

.overflow-x-visible {
    overflow-x: visible;
}

.overflow-y-visible {
    overflow-y: visible;
}

.overflow-x-clip {
    overflow-x: clip;
}

.overflow-y-clip {
    overflow-y: clip;
}

/* ─── Scroll behavior ──────────────────────────────────────────────── */

.scroll-smooth {
    scroll-behavior: smooth;
}

.scroll-auto {
    scroll-behavior: auto;
}

/* ─── Scroll margin (for anchor links) ────────────────────────────── */

.scroll-mt {
    scroll-margin-top: var(--topbar-h, 64px);
}

@media (max-width: 768px) {
    .scroll-mt {
        scroll-margin-top: var(--topbar-h-mobile, 56px);
    }
}

.scroll-mb {
    scroll-margin-bottom: var(--lg, 24px);
}

/* ═══════════════════════════════════════════════════════════════════
   POINTER EVENTS
   ═══════════════════════════════════════════════════════════════════ */

.pointer-events-none {
    pointer-events: none;
}

.pointer-events-auto {
    pointer-events: auto;
}

/* ═══════════════════════════════════════════════════════════════════
   BACKDROP FILTER
   ═══════════════════════════════════════════════════════════════════ */

.backdrop-blur-none {
    backdrop-filter: none;
}

.backdrop-blur-sm {
    backdrop-filter: blur(4px);
}

.backdrop-blur-md {
    backdrop-filter: blur(8px);
}

.backdrop-blur-lg {
    backdrop-filter: blur(12px);
}

.backdrop-blur-xl {
    backdrop-filter: blur(16px);
}

.backdrop-blur-2xl {
    backdrop-filter: blur(24px);
}

.backdrop-brightness-100 {
    backdrop-filter: brightness(1);
}

.backdrop-brightness-75 {
    backdrop-filter: brightness(0.75);
}

.backdrop-brightness-50 {
    backdrop-filter: brightness(0.5);
}

.backdrop-contrast-100 {
    backdrop-filter: contrast(1);
}

.backdrop-contrast-75 {
    backdrop-filter: contrast(0.75);
}

.backdrop-saturate-100 {
    backdrop-filter: saturate(1);
}

.backdrop-saturate-50 {
    backdrop-filter: saturate(0.5);
}

/* ─── WebKit prefix for Safari ────────────────────────────────────── */

.backdrop-blur-sm,
.backdrop-blur-md,
.backdrop-blur-lg,
.backdrop-blur-xl,
.backdrop-blur-2xl {
    -webkit-backdrop-filter: blur(var(--blur, 8px));
}

/* ═══════════════════════════════════════════════════════════════════
   TRANSFORMS
   ═══════════════════════════════════════════════════════════════════ */

.transform {
    transform: translateZ(0);
    will-change: transform;
}

.transform-none {
    transform: none;
}

/* ─── Scale ────────────────────────────────────────────────────────── */

.scale-0 {
    transform: scale(0);
}

.scale-50 {
    transform: scale(0.5);
}

.scale-75 {
    transform: scale(0.75);
}

.scale-90 {
    transform: scale(0.9);
}

.scale-95 {
    transform: scale(0.95);
}

.scale-100 {
    transform: scale(1);
}

.scale-105 {
    transform: scale(1.05);
}

.scale-110 {
    transform: scale(1.1);
}

.scale-125 {
    transform: scale(1.25);
}

.scale-150 {
    transform: scale(1.5);
}

.scale-x-0 {
    transform: scaleX(0);
}

.scale-x-50 {
    transform: scaleX(0.5);
}

.scale-x-100 {
    transform: scaleX(1);
}

.scale-y-0 {
    transform: scaleY(0);
}

.scale-y-50 {
    transform: scaleY(0.5);
}

.scale-y-100 {
    transform: scaleY(1);
}

/* ─── Rotate ───────────────────────────────────────────────────────── */

.rotate-0 {
    transform: rotate(0deg);
}

.rotate-45 {
    transform: rotate(45deg);
}

.rotate-90 {
    transform: rotate(90deg);
}

.rotate-180 {
    transform: rotate(180deg);
}

.rotate-270 {
    transform: rotate(270deg);
}

.rotate-360 {
    transform: rotate(360deg);
}

.rotate--45 {
    transform: rotate(-45deg);
}

.rotate--90 {
    transform: rotate(-90deg);
}

.rotate--180 {
    transform: rotate(-180deg);
}

/* ─── Translate ────────────────────────────────────────────────────── */

.translate-x-0 {
    transform: translateX(0);
}

.translate-x-1 {
    transform: translateX(var(--sm, 8px));
}

.translate-x-2 {
    transform: translateX(var(--md, 16px));
}

.translate-x-3 {
    transform: translateX(var(--lg, 24px));
}

.translate-x--1 {
    transform: translateX(calc(-1 * var(--sm, 8px)));
}

.translate-x--2 {
    transform: translateX(calc(-1 * var(--md, 16px)));
}

.translate-x--3 {
    transform: translateX(calc(-1 * var(--lg, 24px)));
}

.translate-y-0 {
    transform: translateY(0);
}

.translate-y-1 {
    transform: translateY(var(--sm, 8px));
}

.translate-y-2 {
    transform: translateY(var(--md, 16px));
}

.translate-y-3 {
    transform: translateY(var(--lg, 24px));
}

.translate-y--1 {
    transform: translateY(calc(-1 * var(--sm, 8px)));
}

.translate-y--2 {
    transform: translateY(calc(-1 * var(--md, 16px)));
}

.translate-y--3 {
    transform: translateY(calc(-1 * var(--lg, 24px)));
}

.translate-center {
    transform: translate(-50%, -50%);
}

.translate-x-center {
    transform: translateX(-50%);
}

.translate-y-center {
    transform: translateY(-50%);
}

/* ─── Transform origin ────────────────────────────────────────────── */

.origin-center {
    transform-origin: center;
}

.origin-top {
    transform-origin: top;
}

.origin-top-left {
    transform-origin: top left;
}

.origin-top-right {
    transform-origin: top right;
}

.origin-bottom {
    transform-origin: bottom;
}

.origin-bottom-left {
    transform-origin: bottom left;
}

.origin-bottom-right {
    transform-origin: bottom right;
}

.origin-left {
    transform-origin: left;
}

.origin-right {
    transform-origin: right;
}

/* ═══════════════════════════════════════════════════════════════════
   TRANSITIONS
   ═══════════════════════════════════════════════════════════════════ */

.transition-none {
    transition: none;
}

.transition-all {
    transition: all var(--transition, 0.3s cubic-bezier(0.22, 1, 0.36, 1));
}

.transition-colors {
    transition: background-color var(--transition, 0.3s cubic-bezier(0.22, 1, 0.36, 1)),
        border-color var(--transition, 0.3s cubic-bezier(0.22, 1, 0.36, 1)),
        color var(--transition, 0.3s cubic-bezier(0.22, 1, 0.36, 1));
}

.transition-opacity {
    transition: opacity var(--transition, 0.3s cubic-bezier(0.22, 1, 0.36, 1));
}

.transition-transform {
    transition: transform var(--transition, 0.3s cubic-bezier(0.22, 1, 0.36, 1));
}

.transition-shadow {
    transition: box-shadow var(--transition, 0.3s cubic-bezier(0.22, 1, 0.36, 1));
}

.transition-height {
    transition: height var(--transition, 0.3s cubic-bezier(0.22, 1, 0.36, 1));
}

.transition-width {
    transition: width var(--transition, 0.3s cubic-bezier(0.22, 1, 0.36, 1));
}

.transition-spacing {
    transition: margin var(--transition, 0.3s cubic-bezier(0.22, 1, 0.36, 1)),
        padding var(--transition, 0.3s cubic-bezier(0.22, 1, 0.36, 1));
}

/* ─── Transition duration helpers ──────────────────────────────────── */

.duration-100 {
    transition-duration: 0.1s;
}

.duration-150 {
    transition-duration: 0.15s;
}

.duration-200 {
    transition-duration: 0.2s;
}

.duration-300 {
    transition-duration: 0.3s;
}

.duration-400 {
    transition-duration: 0.4s;
}

.duration-500 {
    transition-duration: 0.5s;
}

.duration-700 {
    transition-duration: 0.7s;
}

.duration-1000 {
    transition-duration: 1s;
}

/* ─── Transition delay ────────────────────────────────────────────── */

.delay-0 {
    transition-delay: 0s;
}

.delay-100 {
    transition-delay: 0.1s;
}

.delay-200 {
    transition-delay: 0.2s;
}

.delay-300 {
    transition-delay: 0.3s;
}

.delay-400 {
    transition-delay: 0.4s;
}

.delay-500 {
    transition-delay: 0.5s;
}

.delay-700 {
    transition-delay: 0.7s;
}

.delay-1000 {
    transition-delay: 1s;
}

/* ─── Transition easing ───────────────────────────────────────────── */

.ease-linear {
    transition-timing-function: linear;
}

.ease-in {
    transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}

.ease-out {
    transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
}

.ease-in-out {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.ease-bounce {
    transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.ease-spring {
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ═══════════════════════════════════════════════════════════════════
   CURSOR STYLES
   ═══════════════════════════════════════════════════════════════════ */

.cursor-auto {
    cursor: auto;
}

.cursor-default {
    cursor: default;
}

.cursor-pointer {
    cursor: pointer;
}

.cursor-wait {
    cursor: wait;
}

.cursor-text {
    cursor: text;
}

.cursor-move {
    cursor: move;
}

.cursor-not-allowed {
    cursor: not-allowed;
}

.cursor-grab {
    cursor: grab;
}

.cursor-grabbing {
    cursor: grabbing;
}

.cursor-zoom-in {
    cursor: zoom-in;
}

.cursor-zoom-out {
    cursor: zoom-out;
}

.cursor-help {
    cursor: help;
}

.cursor-progress {
    cursor: progress;
}

.cursor-crosshair {
    cursor: crosshair;
}

/* ═══════════════════════════════════════════════════════════════════
   USER SELECT
   ═══════════════════════════════════════════════════════════════════ */

.select-none {
    user-select: none;
}

.select-text {
    user-select: text;
}

.select-all {
    user-select: all;
}

.select-auto {
    user-select: auto;
}

/* ═══════════════════════════════════════════════════════════════════
   ASPECT RATIO
   ═══════════════════════════════════════════════════════════════════ */

.aspect-square {
    aspect-ratio: 1 / 1;
}

.aspect-video {
    aspect-ratio: 16 / 9;
}

.aspect-portrait {
    aspect-ratio: 3 / 4;
}

.aspect-landscape {
    aspect-ratio: 4 / 3;
}

.aspect-auto {
    aspect-ratio: auto;
}

/* ═══════════════════════════════════════════════════════════════════
   OBJECT FIT
   ═══════════════════════════════════════════════════════════════════ */

.object-cover {
    object-fit: cover;
}

.object-contain {
    object-fit: contain;
}

.object-fill {
    object-fit: fill;
}

.object-none {
    object-fit: none;
}

.object-scale-down {
    object-fit: scale-down;
}

/* ─── Object position ──────────────────────────────────────────────── */

.object-top {
    object-position: top;
}

.object-bottom {
    object-position: bottom;
}

.object-center {
    object-position: center;
}

.object-left {
    object-position: left;
}

.object-right {
    object-position: right;
}

/* ═══════════════════════════════════════════════════════════════════
   WIDTH & HEIGHT HELPERS
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Width ────────────────────────────────────────────────────────── */

.w-full {
    width: 100%;
}

.w-auto {
    width: auto;
}

.w-screen {
    width: 100vw;
}

.w-min {
    width: min-content;
}

.w-max {
    width: max-content;
}

.w-fit {
    width: fit-content;
}

.w-1\/2 {
    width: 50%;
}

.w-1\/3 {
    width: 33.333333%;
}

.w-2\/3 {
    width: 66.666667%;
}

.w-1\/4 {
    width: 25%;
}

.w-3\/4 {
    width: 75%;
}

/* ─── Height ───────────────────────────────────────────────────────── */

.h-full {
    height: 100%;
}

.h-auto {
    height: auto;
}

.h-screen {
    height: 100vh;
}

.h-min {
    height: min-content;
}

.h-max {
    height: max-content;
}

.h-fit {
    height: fit-content;
}

.h-1\/2 {
    height: 50%;
}

.h-1\/3 {
    height: 33.333333%;
}

.h-2\/3 {
    height: 66.666667%;
}

.h-1\/4 {
    height: 25%;
}

.h-3\/4 {
    height: 75%;
}

/* ─── Min/Max sizes ────────────────────────────────────────────────── */

.min-w-full {
    min-width: 100%;
}

.min-w-0 {
    min-width: 0;
}

.min-h-full {
    min-height: 100%;
}

.min-h-screen {
    min-height: 100vh;
}

.max-w-full {
    max-width: 100%;
}

.max-w-none {
    max-width: none;
}

.max-h-full {
    max-height: 100%;
}

.max-h-screen {
    max-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile adjustments
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .md\:flex-col {
        flex-direction: column;
    }

    .md\:flex-row {
        flex-direction: row;
    }

    .md\:items-center {
        align-items: center;
    }

    .md\:justify-center {
        justify-content: center;
    }

    .md\:hidden {
        display: none;
    }

    .md\:block {
        display: block;
    }

    .md\:w-full {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .sm\:flex-col {
        flex-direction: column;
    }

    .sm\:items-center {
        align-items: center;
    }

    .sm\:justify-center {
        justify-content: center;
    }

    .sm\:hidden {
        display: none;
    }

    .sm\:block {
        display: block;
    }

    .sm\:w-full {
        width: 100%;
    }
}