/* ===== CloudGuard Utilities ===== */

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

/* ---- Flex ---- */
.flex-row    { flex-direction: row !important; }
.flex-col    { flex-direction: column !important; }
.flex-wrap   { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.flex-1      { flex: 1 !important; }
.flex-auto   { flex: auto !important; }
.flex-none   { flex: none !important; }

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

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

.gap-4  { gap: 4px !important; }
.gap-8  { gap: 8px !important; }
.gap-12 { gap: 12px !important; }
.gap-16 { gap: 16px !important; }
.gap-20 { gap: 20px !important; }
.gap-24 { gap: 24px !important; }

/* ---- Text ---- */
.text-left   { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right  { text-align: right !important; }

.text-xs  { font-size: 12px !important; }
.text-sm  { font-size: 13px !important; }
.text-base { font-size: 14px !important; }
.text-lg  { font-size: 16px !important; }
.text-xl  { font-size: 18px !important; }
.text-2xl { font-size: 24px !important; }
.text-3xl { font-size: 30px !important; }

.font-normal { font-weight: 400 !important; }
.font-medium { font-weight: 500 !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: 700 !important; }

.text-primary { color: var(--theme-brand) !important; }
.text-success { color: var(--theme-success) !important; }
.text-warning { color: var(--theme-warning) !important; }
.text-danger  { color: var(--theme-danger) !important; }
.text-info    { color: var(--theme-info) !important; }
.text-muted   { color: var(--theme-text-muted) !important; }
.text-soft    { color: var(--theme-text-soft) !important; }
.text-white   { color: #fff !important; }

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-break {
  word-break: break-word;
  overflow-wrap: break-word;
}

.text-nowrap {
  white-space: nowrap;
}

.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- Spacing (Margin & Padding) ---- */
.m-0   { margin: 0 !important; }
.m-4   { margin: 4px !important; }
.m-8   { margin: 8px !important; }
.m-12  { margin: 12px !important; }
.m-16  { margin: 16px !important; }
.m-20  { margin: 20px !important; }
.m-24  { margin: 24px !important; }
.m-32  { margin: 32px !important; }

.mt-0  { margin-top: 0 !important; }
.mt-4  { margin-top: 4px !important; }
.mt-8  { margin-top: 8px !important; }
.mt-12 { margin-top: 12px !important; }
.mt-16 { margin-top: 16px !important; }
.mt-20 { margin-top: 20px !important; }
.mt-24 { margin-top: 24px !important; }
.mt-32 { margin-top: 32px !important; }

.mb-0  { margin-bottom: 0 !important; }
.mb-4  { margin-bottom: 4px !important; }
.mb-8  { margin-bottom: 8px !important; }
.mb-12 { margin-bottom: 12px !important; }
.mb-16 { margin-bottom: 16px !important; }
.mb-20 { margin-bottom: 20px !important; }
.mb-24 { margin-bottom: 24px !important; }
.mb-32 { margin-bottom: 32px !important; }

.ml-0  { margin-left: 0 !important; }
.ml-4  { margin-left: 4px !important; }
.ml-8  { margin-left: 8px !important; }
.ml-12 { margin-left: 12px !important; }
.ml-16 { margin-left: 16px !important; }
.ml-auto { margin-left: auto !important; }

.mr-0  { margin-right: 0 !important; }
.mr-4  { margin-right: 4px !important; }
.mr-8  { margin-right: 8px !important; }
.mr-12 { margin-right: 12px !important; }
.mr-16 { margin-right: 16px !important; }
.mr-auto { margin-right: auto !important; }

.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.mx-4  { margin-left: 4px !important; margin-right: 4px !important; }
.mx-8  { margin-left: 8px !important; margin-right: 8px !important; }
.mx-16 { margin-left: 16px !important; margin-right: 16px !important; }
.mx-24 { margin-left: 24px !important; margin-right: 24px !important; }

.my-4  { margin-top: 4px !important; margin-bottom: 4px !important; }
.my-8  { margin-top: 8px !important; margin-bottom: 8px !important; }
.my-16 { margin-top: 16px !important; margin-bottom: 16px !important; }
.my-24 { margin-top: 24px !important; margin-bottom: 24px !important; }

.p-0   { padding: 0 !important; }
.p-4   { padding: 4px !important; }
.p-8   { padding: 8px !important; }
.p-12  { padding: 12px !important; }
.p-16  { padding: 16px !important; }
.p-20  { padding: 20px !important; }
.p-24  { padding: 24px !important; }
.p-32  { padding: 32px !important; }

.px-4  { padding-left: 4px !important; padding-right: 4px !important; }
.px-8  { padding-left: 8px !important; padding-right: 8px !important; }
.px-12 { padding-left: 12px !important; padding-right: 12px !important; }
.px-16 { padding-left: 16px !important; padding-right: 16px !important; }
.px-24 { padding-left: 24px !important; padding-right: 24px !important; }

.py-4  { padding-top: 4px !important; padding-bottom: 4px !important; }
.py-8  { padding-top: 8px !important; padding-bottom: 8px !important; }
.py-12 { padding-top: 12px !important; padding-bottom: 12px !important; }
.py-16 { padding-top: 16px !important; padding-bottom: 16px !important; }
.py-24 { padding-top: 24px !important; padding-bottom: 24px !important; }

/* ---- Width ---- */
.w-full  { width: 100% !important; }
.w-auto  { width: auto !important; }
.w-50    { width: 50% !important; }

.max-w-200 { max-width: 200px !important; }
.max-w-300 { max-width: 300px !important; }
.max-w-400 { max-width: 400px !important; }
.max-w-500 { max-width: 500px !important; }
.max-w-600 { max-width: 600px !important; }
.max-w-800 { max-width: 800px !important; }

.min-w-0 { min-width: 0 !important; }

/* ---- Border Radius ---- */
.radius-sm { border-radius: var(--theme-radius-sm) !important; }
.radius-md { border-radius: var(--theme-radius-md) !important; }
.radius-lg { border-radius: var(--theme-radius-lg) !important; }
.radius-round { border-radius: var(--theme-radius-round) !important; }
.radius-none { border-radius: 0 !important; }

/* ---- Cursor ---- */
.cursor-pointer { cursor: pointer !important; }
.cursor-not-allowed { cursor: not-allowed !important; }
.pointer-events-none { pointer-events: none !important; }

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

/* ---- Position ---- */
.relative { position: relative !important; }
.absolute { position: absolute !important; }
.fixed    { position: fixed !important; }
.sticky   { position: sticky !important; }

/* ---- Opacity ---- */
.opacity-0 { opacity: 0 !important; }
.opacity-25 { opacity: 0.25 !important; }
.opacity-50 { opacity: 0.5 !important; }
.opacity-75 { opacity: 0.75 !important; }
.opacity-100 { opacity: 1 !important; }

/* ---- Visibility ---- */
.visible { visibility: visible !important; }
.invisible { visibility: hidden !important; }

/* ---- Clearfix ---- */
.clearfix::after {
  content: '';
  display: table;
  clear: both;
}

/* ---- Screen Readers ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Print ---- */
@media print {
  .no-print { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
}

/* ---- Grid helpers ---- */
.grid-cols-2 { grid-template-columns: repeat(2, 1fr) !important; }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr) !important; }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr) !important; }
.grid-cols-auto { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important; }
