/* ========================================
   WorldTool - Layout Structure
   Main Application Layout
   ======================================== */

/* ========== GLOBAL LAYOUT ========== */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========== APP WRAPPER ========== */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ========== MAIN CONTENT ========== */
#main {
  flex: 1;
  background: var(--bg-primary);
  min-height: calc(100vh - 60px);
  transition: background-color 0.3s ease;
}

/* Content wrapper for proper spacing */
.main-content {
  width: 100%;
  max-width: 100%;
}

/* ========== RESPONSIVE CONTAINERS ========== */
.container {
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
}

.container-sm {
  max-width: 640px;
}

.container-md {
  max-width: 768px;
}

.container-lg {
  max-width: 1024px;
}

.container-xl {
  max-width: 1280px;
}

.container-2xl {
  max-width: 1536px;
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
}

/* ========== GRID SYSTEM ========== */
.grid {
  display: grid;
  gap: 24px;
}

.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)); }

@media (max-width: 1024px) {
  .grid-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .grid-cols-4,
  .grid-cols-3,
  .grid-cols-2 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

/* ========== FLEX UTILITIES ========== */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-start {
  justify-content: flex-start;
}

.justify-end {
  justify-content: flex-end;
}

.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }

/* ========== SPACING UTILITIES ==========
   Canonical spacing helpers (mt-/mb-/p-/etc.) pour éviter les doublons.
   Toute nouvelle classe d'espacement doit être ajoutée ici uniquement.
========================================= */
.p-8 { padding: 8px; }
.p-12 { padding: 12px; }
.p-16 { padding: 16px; }
.p-24 { padding: 24px; }
.p-32 { padding: 32px; }

.px-8 { padding-left: 8px; padding-right: 8px; }
.px-12 { padding-left: 12px; padding-right: 12px; }
.px-16 { padding-left: 16px; padding-right: 16px; }
.px-24 { padding-left: 24px; padding-right: 24px; }

.py-8 { padding-top: 8px; padding-bottom: 8px; }
.py-12 { padding-top: 12px; padding-bottom: 12px; }
.py-16 { padding-top: 16px; padding-bottom: 16px; }
.py-24 { padding-top: 24px; padding-bottom: 24px; }

.m-8 { margin: 8px; }
.m-12 { margin: 12px; }
.m-16 { margin: 16px; }
.m-24 { margin: 24px; }
.m-32 { margin: 32px; }

.mx-auto { margin-left: auto; margin-right: auto; }

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

/* ========== WIDTH UTILITIES ========== */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-fit { width: fit-content; }

.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-full { max-width: 100%; }

/* ========== HEIGHT UTILITIES ========== */
.h-full { height: 100%; }
.h-screen { height: 100vh; }
.min-h-screen { min-height: 100vh; }

/* ========== DISPLAY UTILITIES ========== */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }

@media (max-width: 768px) {
  .md\:hidden { display: none; }
  .md\:block { display: block; }
}

@media (min-width: 769px) {
  .md\:flex { display: flex; }
}

/* ========== OVERFLOW UTILITIES ========== */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* ========== POSITION UTILITIES ========== */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* ========== Z-INDEX UTILITIES ========== */
.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; }

/* ========== RESPONSIVE VISIBILITY ========== */
@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .show-mobile {
    display: none !important;
  }
}


/* Disable transitions on first paint when body.no-animate is present */
body.no-animate * {
  transition: none !important;
  animation: none !important;
}


/* Main margin rules for mobile */
@media (max-width: 768px){
  #main{ margin-left: 0 !important; }
}

/* Prevention du FOUC (Flash of Unstyled Content) lors du chargement dynamique des CSS */


#app-root {
  opacity: 1;
  transition: opacity 0.50s ease-in-out;
}
#app-root.route-loading {
  opacity: 0;
  visibility:hidden;
}
