/*
 * Zentara — Local Utility Classes
 * Replaces Tailwind CDN. All classes used across layouts, header,
 * mobile-nav, and admin pages are defined here locally.
 * Loads instantly from disk — zero external network calls.
 */

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

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

/* ── Flex grow/shrink ───────────────────────────────────── */
.flex-1       { flex: 1 1 0%; }
.flex-auto    { flex: 1 1 auto; }
.flex-none    { flex: none; }
.flex-shrink-0 { flex-shrink: 0; }
.min-w-0      { min-width: 0; }

/* ── Align / Justify ────────────────────────────────────── */
.items-start    { align-items: flex-start; }
.items-center   { align-items: center; }
.items-end      { align-items: flex-end; }
.justify-start  { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-between{ justify-content: space-between; }
.justify-end    { justify-content: flex-end; }
.self-center    { align-self: center; }

/* ── Gap ────────────────────────────────────────────────── */
.gap-0   { gap: 0; }
.gap-1   { gap: 4px; }
.gap-1\.5 { gap: 6px; }
.gap-2   { gap: 8px; }
.gap-2\.5 { gap: 10px; }
.gap-3   { gap: 12px; }
.gap-4   { gap: 16px; }
.gap-5   { gap: 20px; }
.gap-6   { gap: 24px; }
.gap-8   { gap: 32px; }

/* ── Position ───────────────────────────────────────────── */
.static   { position: static; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }

/* ── Inset ──────────────────────────────────────────────── */
.inset-0  { top: 0; right: 0; bottom: 0; left: 0; }
.top-0    { top: 0; }
.top-2    { top: 8px; }
.bottom-4 { bottom: 16px; }
.right-0  { right: 0; }
.right-4  { right: 16px; }
.left-0   { left: 0; }
.left-2   { left: 8px; }
.-top-0\.5  { top: -2px; }
.-right-0\.5 { right: -2px; }

/* ── Z-index ────────────────────────────────────────────── */
.z-10  { z-index: 10; }
.z-20  { z-index: 20; }
.z-40  { z-index: 40; }
.z-50  { z-index: 50; }

/* ── Width ──────────────────────────────────────────────── */
.w-auto  { width: auto; }
.w-full  { width: 100%; }
.w-3     { width: 12px; height: 12px; }
.w-3\.5  { width: 14px; }
.w-4     { width: 16px; }
.w-5     { width: 20px; }
.w-6     { width: 24px; }
.w-8     { width: 32px; }
.w-9     { width: 36px; }
.w-48    { width: 192px; }
.w-56    { width: 224px; }
.w-80    { width: 320px; }

/* ── Height ─────────────────────────────────────────────── */
.h-3     { height: 12px; }
.h-3\.5  { height: 14px; }
.h-4     { height: 16px; }
.h-5     { height: 20px; }
.h-6     { height: 24px; }
.h-8     { height: 32px; }
.h-9     { height: 36px; }
.h-full  { height: 100%; }
.h-screen { height: 100vh; }
.min-h-screen { min-height: 100vh; }

/* ── Max / Min sizing ───────────────────────────────────── */
.max-w-2xl  { max-width: 672px; }
.max-w-7xl  { max-width: 1280px; }
.max-w-xs   { max-width: 320px; }
.max-h-96   { max-height: 384px; }
.max-w-full { max-width: 100%; }

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

/* ── Margin ─────────────────────────────────────────────── */
.m-0     { margin: 0; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-1    { margin-top: 4px; }
.mt-2    { margin-top: 8px; }
.mt-4    { margin-top: 16px; }
.mt-5    { margin-top: 20px; }
.mt-20   { margin-top: 80px; }
.mb-4    { margin-bottom: 16px; }
.mb-5    { margin-bottom: 20px; }
.mb-6    { margin-bottom: 24px; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.-mt-px  { margin-top: -1px; }

/* ── Padding ────────────────────────────────────────────── */
.p-1   { padding: 4px; }
.p-2   { padding: 8px; }
.p-4   { padding: 16px; }
.p-5   { padding: 20px; }
.px-2  { padding-left: 8px;  padding-right: 8px; }
.px-4  { padding-left: 16px; padding-right: 16px; }
.px-5  { padding-left: 20px; padding-right: 20px; }
.py-0\.5 { padding-top: 2px;  padding-bottom: 2px; }
.py-1  { padding-top: 4px;  padding-bottom: 4px; }
.py-1\.5 { padding-top: 6px;  padding-bottom: 6px; }
.py-2  { padding-top: 8px;  padding-bottom: 8px; }
.py-2\.5 { padding-top: 10px; padding-bottom: 10px; }
.py-4  { padding-top: 16px; padding-bottom: 16px; }
.py-8  { padding-top: 32px; padding-bottom: 32px; }
.pl-2  { padding-left: 8px; }
.pl-4  { padding-left: 16px; }
.pr-3  { padding-right: 12px; }
.pt-1  { padding-top: 4px; }
.pb-2  { padding-bottom: 8px; }

/* ── Typography — Font size ─────────────────────────────── */
.text-xs   { font-size: 12px; line-height: 16px; }
.text-sm   { font-size: 14px; line-height: 20px; }
.text-base { font-size: 15px; line-height: 24px; }
.text-lg   { font-size: 18px; line-height: 28px; }
.text-xl   { font-size: 20px; line-height: 28px; }
.text-2xl  { font-size: 24px; line-height: 32px; }
.text-3xl  { font-size: 30px; line-height: 36px; }

/* ── Typography — Font weight ───────────────────────────── */
.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.font-extrabold { font-weight: 800; }

/* ── Typography — Other ─────────────────────────────────── */
.antialiased       { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.tracking-tight    { letter-spacing: -0.025em; }
.tracking-wide     { letter-spacing: 0.025em; }
.tracking-wider    { letter-spacing: 0.05em; }
.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; }
.truncate          { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whitespace-nowrap { white-space: nowrap; }
.leading-tight     { line-height: 1.25; }
.leading-none      { line-height: 1; }
.underline         { text-decoration: underline; }
.no-underline      { text-decoration: none; }

/* ── Text colors ────────────────────────────────────────── */
.text-white      { color: #fff; }
.text-gray-400   { color: #9ca3af; }
.text-gray-500   { color: #6b7280; }
.text-gray-600   { color: #4b5563; }
.text-gray-700   { color: #374151; }
.text-gray-900   { color: #111827; }
.text-slate-500  { color: #64748b; }
.text-red-600    { color: #dc2626; }
.text-amber-600  { color: #d97706; }
.text-green-600  { color: #16a34a; }
.text-primary-600 { color: #1d4ed8; }
.text-emerald-600 { color: #059669; }
.text-blue-600   { color: #2563eb; }
.text-orange-600 { color: #ea580c; }
.text-purple-600 { color: #9333ea; }

/* ── Background colors ──────────────────────────────────── */
.bg-white        { background-color: #fff; }
.bg-gray-50      { background-color: #f9fafb; }
.bg-gray-100     { background-color: #f3f4f6; }
.bg-gray-200     { background-color: #e5e7eb; }
.bg-red-500      { background-color: #ef4444; }
.bg-red-50       { background-color: #fef2f2; }
.bg-primary-50   { background-color: #eff6ff; }
.bg-primary-600  { background-color: #1d4ed8; }
.bg-primary-700  { background-color: #1e40af; }
.bg-primary-800  { background-color: #1e3a8a; }
.bg-emerald-50   { background-color: #ecfdf5; }
/* Semi-transparent backgrounds */
.bg-black\/40    { background-color: rgba(0, 0, 0, 0.4); }
.bg-white\/80    { background-color: rgba(255, 255, 255, 0.8); }
.bg-white\/90    { background-color: rgba(255, 255, 255, 0.9); }

/* ── Border ─────────────────────────────────────────────── */
.border          { border: 1px solid; }
.border-0        { border: none; }
.border-t        { border-top: 1px solid; }
.border-b        { border-bottom: 1px solid; }
.border-l        { border-left: 1px solid; }
.border-r        { border-right: 1px solid; }
.border-gray-100 { border-color: #f3f4f6; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-slate-200 { border-color: #e2e8f0; }
.border-primary-200 { border-color: #bfdbfe; }
.border-transparent { border-color: transparent; }

/* ── Border radius ──────────────────────────────────────── */
.rounded       { border-radius: 4px; }
.rounded-md    { border-radius: 6px; }
.rounded-lg    { border-radius: 8px; }
.rounded-xl    { border-radius: 12px; }
.rounded-2xl   { border-radius: 16px; }
.rounded-3xl   { border-radius: 24px; }
.rounded-full  { border-radius: 9999px; }

/* ── Box shadow ─────────────────────────────────────────── */
.shadow        { box-shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06); }
.shadow-sm     { box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.shadow-md     { box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06); }
.shadow-lg     { box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05); }
.shadow-xl     { box-shadow: 0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04); }
.shadow-2xl    { box-shadow: 0 25px 50px -12px rgba(0,0,0,.25); }

/* ── Object fit ─────────────────────────────────────────── */
.object-cover   { object-fit: cover; }
.object-contain { object-fit: contain; }

/* ── Outline ────────────────────────────────────────────── */
.outline-none  { outline: 2px solid transparent; outline-offset: 2px; }

/* ── Cursor ─────────────────────────────────────────────── */
.cursor-pointer { cursor: pointer; }

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

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

/* ── Transition ─────────────────────────────────────────── */
.transition         { transition: color 150ms, background-color 150ms, border-color 150ms, box-shadow 150ms; }
.transition-shadow  { transition: box-shadow 150ms; }
.transition-all     { transition: all 150ms; }
.duration-150       { transition-duration: 150ms; }
.duration-200       { transition-duration: 200ms; }
.duration-300       { transition-duration: 300ms; }

/* ── Space-y (child spacing) ────────────────────────────── */
.space-y-1 > * + * { margin-top: 4px; }
.space-y-2 > * + * { margin-top: 8px; }
.space-y-4 > * + * { margin-top: 16px; }

/* ── Animate ────────────────────────────────────────────── */
.animate-spin {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4,0,0.6,1) infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

/* ── Screen-reader only ─────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
.sr-only:focus,
.focus\:not-sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}
.focus\:absolute:focus { position: absolute; }
.focus\:top-2:focus    { top: 8px; }
.focus\:left-2:focus   { left: 8px; }

/* ── Hover variants ─────────────────────────────────────── */
.hover\:bg-gray-50:hover   { background-color: #f9fafb; }
.hover\:bg-gray-100:hover  { background-color: #f3f4f6; }
.hover\:bg-red-50:hover    { background-color: #fef2f2; }
.hover\:text-gray-900:hover { color: #111827; }
.hover\:text-amber-700:hover { color: #b45309; }
.hover\:bg-primary-800:hover { background-color: #1e3a8a; }
.hover\:underline:hover    { text-decoration: underline; }

/* ── Responsive — show/hide ─────────────────────────────── */
/* sm: 640px, md: 768px, lg: 1024px
   All overrides use !important to beat the base .hidden rule  */

@media (min-width: 640px) {
    .sm\:block        { display: block !important; }
    .sm\:inline-flex  { display: inline-flex !important; }
    .sm\:flex         { display: flex !important; }
    .sm\:hidden       { display: none !important; }
}

@media (min-width: 768px) {
    .md\:block  { display: block !important; }
    .md\:flex   { display: flex !important; }
    .md\:hidden { display: none !important; }
}

@media (min-width: 1024px) {
    .lg\:hidden      { display: none !important; }
    .lg\:block       { display: block !important; }
    .lg\:flex        { display: flex !important; }
    .lg\:inline-flex { display: inline-flex !important; }
}

/* ── Font family ────────────────────────────────────────── */
.font-sans {
    font-family: 'Plus Jakarta Sans', 'Noto Sans Devanagari', -apple-system,
                 BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.font-mono {
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, monospace;
}

/* ── Border-3 (spinner border) ──────────────────────────── */
.border-3 {
    border-width: 3px;
}
.border-primary-600 {
    border-color: #1d4ed8;
}
.border-t-transparent {
    border-top-color: transparent;
}

/* ── Grid utilities ─────────────────────────────────────── */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0,1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.col-span-2  { grid-column: span 2 / span 2; }

@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .sm\:flex-row    { flex-direction: row; }
    .sm\:items-center { align-items: center; }
    .sm\:justify-between { justify-content: space-between; }
}

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

@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
    .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
    .lg\:col-span-2  { grid-column: span 2 / span 2; }
}

/* ── Body helpers used in layouts ───────────────────────── */
.bg-transparent { background-color: transparent; }
.text-inherit   { color: inherit; }
.leading-relaxed { line-height: 1.625; }
.leading-snug   { line-height: 1.375; }
