/* ==========================================================================
   Self-hosted utility CSS — replaces Tailwind CDN for China accessibility.
   Covers all utility classes used across the KeepYoga sniping web templates.
   ========================================================================== */

/* ---- Reset ---- */
*, ::before, ::after { box-sizing: border-box; border: 0 solid #e5e7eb; }
html { -webkit-text-size-adjust: 100%; tab-size: 4; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif; }
body { margin: 0; line-height: 1.5; }

/* ---- Display ---- */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }
.flex { display: flex; }
.grid { display: grid; }
.table { display: table; }
@media (min-width: 768px) { .md\:flex { display: flex; } }

/* ---- Position ---- */
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.bottom-6 { bottom: 1.5rem; }
.right-6 { right: 1.5rem; }
.z-50 { z-index: 50; }

/* ---- Flexbox ---- */
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

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

/* ---- Width ---- */
.w-2\.5 { width: 0.625rem; }
.w-8 { width: 2rem; }
.w-32 { width: 8rem; }
.w-44 { width: 11rem; }
.w-56 { width: 14rem; }
.w-96 { width: 24rem; }
.w-\[700px\] { width: 700px; }
.w-full { width: 100%; }
.max-w-\[200px\] { max-width: 200px; }
.max-w-md { max-width: 28rem; }
.min-w-\[140px\] { min-width: 140px; }

/* ---- Height ---- */
.h-2\.5 { height: 0.625rem; }
.h-screen { height: 100vh; }
.min-h-screen { min-height: 100vh; }
.max-h-\[80vh\] { max-height: 80vh; }
.max-h-\[400px\] { max-height: 400px; }

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

/* ---- Padding ---- */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.pt-3 { padding-top: 0.75rem; }
.pr-4 { padding-right: 1rem; }

/* ---- Margin ---- */
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mr-2 { margin-right: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }

/* ---- Space Between (flexbox gap fallback via margin) ---- */
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* ---- Typography ---- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-mono { font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace; }
.uppercase { text-transform: uppercase; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.underline { text-decoration: underline; }

/* ---- Colors: Text ---- */
.text-white { color: #ffffff; }
.text-gray-100 { color: #f3f4f6; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-red-400 { color: #f87171; }
.text-red-500 { color: #ef4444; }
.text-red-600 { color: #dc2626; }
.text-red-700 { color: #b91c1c; }
.text-yellow-400 { color: #facc15; }
.text-yellow-500 { color: #eab308; }
.text-yellow-600 { color: #ca8a04; }
.text-green-400 { color: #4ade80; }
.text-green-500 { color: #22c55e; }
.text-green-600 { color: #16a34a; }
.text-green-700 { color: #15803d; }
.text-green-800 { color: #166534; }
.text-blue-500 { color: #3b82f6; }
.text-blue-600 { color: #2563eb; }
.text-blue-800 { color: #1e40af; }

/* ---- Colors: Background ---- */
.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-800 { background-color: #1f2937; }
.bg-gray-900 { background-color: #111827; }
.bg-red-50 { background-color: #fef2f2; }
.bg-red-100 { background-color: #fee2e2; }
.bg-red-400 { background-color: #f87171; }
.bg-yellow-50 { background-color: #fefce8; }
.bg-yellow-100 { background-color: #fef9c3; }
.bg-green-50 { background-color: #f0fdf4; }
.bg-green-100 { background-color: #dcfce7; }
.bg-green-400 { background-color: #4ade80; }
.bg-green-600 { background-color: #16a34a; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-blue-600 { background-color: #2563eb; }
.bg-black\/30 { background-color: rgba(0, 0, 0, 0.3); }

/* ---- Borders ---- */
.border { border-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-t { border-top-width: 1px; }
.border-r { border-right-width: 1px; }
.border-gray-100 { border-color: #f3f4f6; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-blue-200 { border-color: #bfdbfe; }

/* ---- Border Radius ---- */
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

/* ---- Shadows ---- */
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); }

/* ---- Opacity ---- */
.opacity-50 { opacity: 0.5; }
.opacity-70 { opacity: 0.7; }
.disabled\:opacity-50:disabled { opacity: 0.5; }

/* ---- Hover ---- */
.hover\:bg-gray-50:hover { background-color: #f9fafb; }
.hover\:bg-red-50:hover { background-color: #fef2f2; }
.hover\:bg-blue-700:hover { background-color: #1d4ed8; }
.hover\:bg-green-700:hover { background-color: #15803d; }
.hover\:bg-red-200:hover { background-color: #fecaca; }
.hover\:text-red-600:hover { color: #dc2626; }
.hover\:text-blue-800:hover { color: #1e40af; }
.hover\:text-gray-600:hover { color: #4b5563; }
.hover\:underline:hover { text-decoration: underline; }
.hover\:text-red-700:hover { color: #b91c1c; }

/* ---- Focus ---- */
.focus\:ring-2:focus { box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5); }
.focus\:ring-blue-500:focus { --tw-ring-color: #3b82f6; }
.focus\:border-blue-500:focus { border-color: #3b82f6; }
.outline-none { outline: none; }

/* ---- Tables ---- */
table { border-collapse: collapse; text-indent: 0; }
th { text-align: inherit; }

/* ---- Divide ---- */
.divide-y > * + * { border-top-width: 1px; }
.divide-gray-100 > * + * { border-color: #f3f4f6; }

/* ---- Sidebar ---- */
.sidebar-link {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.75rem; border-radius: 0.5rem;
    font-size: 0.875rem; color: #374151;
    text-decoration: none; transition: all 0.15s ease;
}
.sidebar-link:hover { background-color: #f3f4f6; }
.sidebar-link.active { background-color: #dbeafe; color: #2563eb; font-weight: 600; }

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

/* ---- Alpine.js ---- */
[x-cloak] { display: none !important; }

/* ---- Select ---- */
select { appearance: auto; }

/* ==========================================================================
   Extended utilities for KeepYoga redesign
   ========================================================================== */

/* ---- Display Breakpoints ---- */
@media (min-width: 640px)  { .sm\:block { display: block; } .sm\:hidden { display: none; } .sm\:flex { display: flex; } }
@media (min-width: 768px)  { .md\:block { display: block; } .md\:hidden { display: none; } .md\:flex { display: flex; } }
@media (min-width: 1024px) { .lg\:block { display: block; } .lg\:hidden { display: none; } .lg\:flex { display: flex; } }

/* ---- Position ---- */
.relative { position: relative; }
.absolute { position: absolute; }
.top-0 { top: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-1\/2 { left: 50%; }
.top-1\/2 { top: 50%; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }

/* ---- Z-Index ---- */
.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-60 { z-index: 60; }

/* ---- Transform ---- */
.translate-x-0 { transform: translateX(0); }
.-translate-x-full { transform: translateX(-100%); }
.-translate-x-1\/2 { transform: translateX(-50%); }
.-translate-y-1\/2 { transform: translateY(-50%); }
.translate-y-0 { transform: translateY(0); }

/* ---- Transition ---- */
.transition { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-150 { transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }
.duration-250 { transition-duration: 250ms; }
.duration-300 { transition-duration: 300ms; }
.ease-out { transition-timing-function: cubic-bezier(0, 0, 0.2, 1); }
.ease-in { transition-timing-function: cubic-bezier(0.4, 0, 1, 1); }

/* ---- Backdrop Blur ---- */
.backdrop-blur { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.backdrop-blur-sm { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.backdrop-blur-md { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

/* ---- Additional Shadows ---- */
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0,0,0,.08), 0 8px 10px -6px rgba(0,0,0,.05); }

/* ---- Additional Border Radius ---- */
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-t-xl { border-top-left-radius: 0.75rem; border-top-right-radius: 0.75rem; }

/* ---- Additional Widths ---- */
.w-1\.5 { width: 0.375rem; }
.w-2 { width: 0.5rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-7 { width: 1.75rem; }
.w-9 { width: 2.25rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.w-20 { width: 5rem; }
.w-24 { width: 6rem; }
.w-60 { width: 15rem; }
.w-64 { width: 16rem; }
.w-\[360px\] { width: 360px; }
.min-w-0 { min-width: 0; }
.min-w-\[80px\] { min-width: 80px; }
.max-w-\[200px\] { max-width: 200px; }

/* ---- Additional Heights ---- */
.h-1\.5 { height: 0.375rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-7 { height: 1.75rem; }
.h-9 { height: 2.25rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-14 { height: 3.5rem; }
.h-full { height: 100%; }

/* ---- Additional Padding ---- */
.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-5 { padding: 1.25rem; }
.pt-0 { padding-top: 0; }
.pt-1 { padding-top: 0.25rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-14 { padding-top: 3.5rem; }
.pb-0 { padding-bottom: 0; }
.pb-1 { padding-bottom: 0.25rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-3 { padding-bottom: 0.75rem; }
.pb-16 { padding-bottom: 4rem; }
.pb-20 { padding-bottom: 5rem; }
.pl-2 { padding-left: 0.5rem; }
.pl-3 { padding-left: 0.75rem; }
.pl-4 { padding-left: 1rem; }
.pr-0 { padding-right: 0; }
.pr-1 { padding-right: 0.25rem; }
.pr-2 { padding-right: 0.5rem; }
.pr-3 { padding-right: 0.75rem; }
.px-0 { padding-left: 0; padding-right: 0; }
.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.py-0 { padding-top: 0; padding-bottom: 0; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
@media (min-width: 768px) { .md\:pb-0 { padding-bottom: 0; } .md\:pt-0 { padding-top: 0; } }
@media (min-width: 640px) { .sm\:p-6 { padding: 1.5rem; } .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; } }

/* ---- Additional Margin ---- */
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.mr-1 { margin-right: 0.25rem; }
.mr-3 { margin-right: 0.75rem; }
.mr-auto { margin-right: auto; }
.-ml-px { margin-left: -1px; }

/* ---- Additional Gap ---- */
.gap-0 { gap: 0; }
.gap-0\.5 { gap: 0.125rem; }
.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-5 { gap: 1.25rem; }

/* ---- Additional Flex ---- */
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-row { flex-direction: row; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.justify-around { justify-content: space-around; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-baseline { align-items: baseline; }
.items-stretch { align-items: stretch; }

/* ---- Additional Grid ---- */
@media (min-width: 768px) { .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.col-span-1 { grid-column: span 1 / span 1; }

/* ---- Additional Text ---- */
.text-\[10px\] { font-size: 0.625rem; }
.text-\[11px\] { font-size: 0.6875rem; }
.text-\[13px\] { font-size: 0.8125rem; }
.text-\[15px\] { font-size: 0.9375rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.leading-none { line-height: 1; }
.leading-tight { line-height: 1.25; }
.leading-normal { line-height: 1.5; }
.text-current { color: currentColor; }

/* ---- Additional Text Colors ---- */
.text-indigo-500 { color: #6366f1; }
.text-indigo-600 { color: #4f46e5; }
.text-indigo-700 { color: #4338ca; }
.text-emerald-400 { color: #34d399; }
.text-emerald-500 { color: #10b981; }
.text-emerald-600 { color: #059669; }
.text-rose-500 { color: #f43f5e; }
.text-rose-600 { color: #e11d48; }
.text-amber-500 { color: #f59e0b; }
.text-amber-600 { color: #d97706; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.text-slate-600 { color: #475569; }
.text-slate-700 { color: #334155; }
.text-slate-800 { color: #1e293b; }

/* ---- Additional Backgrounds ---- */
.bg-white\/90 { background: rgba(255,255,255,.9); }
.bg-white\/95 { background: rgba(255,255,255,.95); }
.bg-indigo-50 { background: #eef2ff; }
.bg-indigo-100 { background: #e0e7ff; }
.bg-indigo-500  { background: #6366f1; }
.bg-indigo-600  { background: #4f46e5; }
.bg-emerald-50  { background: #ecfdf5; }
.bg-emerald-100 { background: #d1fae5; }
.bg-emerald-400 { background: #34d399; }
.bg-emerald-500 { background: #10b981; }
.bg-amber-50  { background: #fffbeb; }
.bg-amber-100 { background: #fef3c7; }
.bg-rose-50   { background: #fff1f2; }
.bg-rose-100  { background: #ffe4e6; }
.bg-slate-50  { background: #f8fafc; }
.bg-slate-100 { background: #f1f5f9; }
.bg-transparent { background: transparent; }

/* ---- Additional Hover ---- */
.hover\:bg-gray-100:hover { background: #f3f4f6; }
.hover\:bg-indigo-50:hover { background: #eef2ff; }
.hover\:bg-indigo-100:hover { background: #e0e7ff; }
.hover\:bg-indigo-700:hover { background: #4338ca; }
.hover\:bg-emerald-50:hover { background: #ecfdf5; }
.hover\:bg-emerald-700:hover { background: #047857; }
.hover\:bg-rose-50:hover { background: #fff1f2; }
.hover\:text-indigo-600:hover { color: #4f46e5; }
.hover\:text-indigo-800:hover { color: #3730a3; }
.hover\:text-emerald-600:hover { color: #059669; }
.hover\:text-rose-600:hover { color: #e11d48; }
.hover\:text-rose-700:hover { color: #be123c; }
.hover\:text-gray-800:hover { color: #1f2937; }
.hover\:shadow:hover { box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04); }
.hover\:shadow-md:hover { box-shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05); }

/* ---- Additional Focus ---- */
.focus\:outline-none:focus { outline: none; }

/* ---- Additional Borders ---- */
.border-l { border-left-width: 1px; }
.border-r { border-right-width: 1px; }
.border-l-4 { border-left-width: 4px; }
.border-indigo-100 { border-color: #e0e7ff; }
.border-indigo-200 { border-color: #c7d2fe; }
.border-emerald-200 { border-color: #a7f3d0; }
.border-rose-200 { border-color: #fecdd3; }
.border-amber-200 { border-color: #fde68a; }
.border-x-transparent { border-left-color: transparent; border-right-color: transparent; }

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

/* ---- Whitespace ---- */
.whitespace-nowrap { white-space: nowrap; }

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

/* ---- Misc ---- */
.select-none { user-select: none; }
.list-none { list-style-type: none; }
.inline-flex { display: inline-flex; }
.self-start { align-self: flex-start; }
.self-center { align-self: center; }
.justify-self-end { justify-self: end; }
.order-first { order: -9999; }
.order-last { order: 9999; }

/* ---- Scrollbar hide ---- */
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* ---- Active state ---- */
.active\:bg-gray-200:active { background: #e5e7eb; }
.active\:scale-95:active { transform: scale(.95); }

/* ---- Sticky ---- */
.sticky { position: sticky; }
.top-14 { top: 3.5rem; }
@media (min-width: 768px) { .md\:top-0 { top: 0; } }
@media (min-width: 640px) { .sm\:text-sm { font-size: 0.875rem; line-height: 1.25rem; } }

/* ---- Max height ---- */
.max-h-\[90vh\] { max-height: 90vh; }
.max-h-60 { max-height: 15rem; }

/* ---- Text truncate ---- */
.line-clamp-2 {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---- Safe area for iPhone ---- */
.safe-bottom { padding-bottom: env(safe-area-inset-bottom, 0.375rem); }
