/* ============================================================
   Utility Classes — Processus Législatif v2
   Spacing, display, flex, grid helpers
   ============================================================ */

/* 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-1    { flex: 1 !important; }
.flex-row  { flex-direction: row !important; }
.flex-col  { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.items-center  { align-items: center !important; }
.items-start   { align-items: flex-start !important; }
.items-end     { align-items: flex-end !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; }
.gap-1  { gap: var(--space-1) !important; }
.gap-2  { gap: var(--space-2) !important; }
.gap-3  { gap: var(--space-3) !important; }
.gap-4  { gap: var(--space-4) !important; }
.gap-6  { gap: var(--space-6) !important; }

/* Margin */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: var(--space-1) !important; }
.mt-2 { margin-top: var(--space-2) !important; }
.mt-3 { margin-top: var(--space-3) !important; }
.mt-4 { margin-top: var(--space-4) !important; }
.mt-6 { margin-top: var(--space-6) !important; }
.mt-8 { margin-top: var(--space-8) !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: var(--space-1) !important; }
.mb-2 { margin-bottom: var(--space-2) !important; }
.mb-3 { margin-bottom: var(--space-3) !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }
.mb-6 { margin-bottom: var(--space-6) !important; }
.mb-8 { margin-bottom: var(--space-8) !important; }

.ml-auto { margin-left: auto !important; }
.mr-auto { margin-right: auto !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }

/* Padding */
.p-0 { padding: 0 !important; }
.p-2 { padding: var(--space-2) !important; }
.p-3 { padding: var(--space-3) !important; }
.p-4 { padding: var(--space-4) !important; }
.p-5 { padding: var(--space-5) !important; }
.p-6 { padding: var(--space-6) !important; }
.px-4 { padding-left: var(--space-4) !important; padding-right: var(--space-4) !important; }
.py-4 { padding-top: var(--space-4) !important; padding-bottom: var(--space-4) !important; }
.py-8 { padding-top: var(--space-8) !important; padding-bottom: var(--space-8) !important; }

/* Width / Height */
.w-full  { width: 100% !important; }
.h-full  { height: 100% !important; }
.min-w-0 { min-width: 0 !important; }

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

/* Colors */
.bg-alt { background-color: var(--color-bg-alt) !important; }

/* Borders */
.border         { border: 1px solid var(--color-border) !important; }
.border-top     { border-top: 1px solid var(--color-border) !important; }
.border-bottom  { border-bottom: 1px solid var(--color-border) !important; }
.rounded        { border-radius: var(--radius-md) !important; }
.rounded-lg     { border-radius: var(--radius-lg) !important; }
.rounded-full   { border-radius: var(--radius-full) !important; }

/* Overflow */
.overflow-hidden { overflow: hidden !important; }
.overflow-auto   { overflow: auto !important; }
.truncate        { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }

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

/* Grid columns */
.grid-cols-1 { grid-template-columns: 1fr !important; }
.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-6 { grid-template-columns: repeat(6, 1fr) !important; }

@media (max-width: 767px) {
  .sm\:grid-cols-1 { grid-template-columns: 1fr !important; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Two-column layout helper */
.layout-two-col {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-6);
  align-items: start;
}

@media (max-width: 1023px) {
  .layout-two-col {
    grid-template-columns: 1fr;
  }
}

/* Separator line */
hr { border: none; border-top: 1px solid var(--color-border); margin: var(--space-4) 0; }

/* Visually hidden (accessible) */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Spin animation for icons */
.spin {
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Print utilities */
@media print {
  .no-print { display: none !important; }
}
