/*
* demo.css
* File include item demo only specific css only
******************************************************************************/

.menu .app-brand.demo {
  height: 64px;
  margin-top: 12px;
}

.app-brand-logo.demo svg {
  width: 22px;
  height: 38px;
}

.app-brand-text.demo {
  font-size: 1.75rem;
  letter-spacing: -0.5px;
  text-transform: lowercase;
}

/* ! For .layout-navbar-fixed added fix padding top tpo .layout-page */
/* Detached navbar */
.layout-navbar-fixed .layout-wrapper:not(.layout-horizontal):not(.layout-without-menu) .layout-page {
  padding-top: 76px !important;
}
/* Default navbar */
.layout-navbar-fixed .layout-wrapper:not(.layout-without-menu) .layout-page {
  padding-top: 64px !important;
}

/* Navbar page z-index issue solution */
.content-wrapper .navbar {
  z-index: auto;
}

/*
* Content
******************************************************************************/

.demo-blocks > * {
  display: block !important;
}

.demo-inline-spacing > * {
  margin: 1rem 0.375rem 0 0 !important;
}

/* ? .demo-vertical-spacing class is used to have vertical margins between elements. To remove margin-top from the first-child, use .demo-only-element class with .demo-vertical-spacing class. For example, we have used this class in forms-input-groups.html file. */
.demo-vertical-spacing > * {
  margin-top: 1rem !important;
  margin-bottom: 0 !important;
}
.demo-vertical-spacing.demo-only-element > :first-child {
  margin-top: 0 !important;
}

.demo-vertical-spacing-lg > * {
  margin-top: 1.875rem !important;
  margin-bottom: 0 !important;
}
.demo-vertical-spacing-lg.demo-only-element > :first-child {
  margin-top: 0 !important;
}

.demo-vertical-spacing-xl > * {
  margin-top: 5rem !important;
  margin-bottom: 0 !important;
}
.demo-vertical-spacing-xl.demo-only-element > :first-child {
  margin-top: 0 !important;
}

.rtl-only {
  display: none !important;
  text-align: left !important;
  direction: ltr !important;
}

[dir='rtl'] .rtl-only {
  display: block !important;
}

/*
* Layout demo
******************************************************************************/

.layout-demo-wrapper {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  margin-top: 1rem;
}
.layout-demo-placeholder img {
  width: 900px;
}
.layout-demo-info {
  text-align: center;
  margin-top: 1rem;
}

/* ==========================================================================
   GLOBAL RESPONSIVENESS BOOSTER & MOBILE FIXES
   ========================================================================== */

@media (max-width: 991.98px) {
  /* 1. AUTO-RESPONSIVE TABLES (Preserves headers & structure but allows horizontal scrolling) */
  .card table:not(.no-responsive),
  .table:not(.no-responsive),
  table.table:not(.no-responsive) {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  /* Prevent tables from looking too cramped on mobile */
  .table:not(.no-responsive) th, 
  .table:not(.no-responsive) td {
    padding: 0.625rem 0.5rem !important;
    font-size: 0.825rem !important;
  }
  
  /* Text break policies in responsive tables */
  .table:not(.no-responsive) td {
    white-space: nowrap;
  }
  
  .table:not(.no-responsive) td.wrap-text,
  .table:not(.no-responsive) td.long-text {
    white-space: normal !important;
    word-break: break-word !important;
    min-width: 150px;
  }

  /* 2. OPTIMIZE SPA AND LAYOUT PADDINGS FOR MAXIMUM VIEWPORT SIZE */
  .container-xxl {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
  
  .container-p-y {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }
  
  .card-body, .card {
    padding: 0.85rem !important;
  }

  /* 3. ROW & COLS FIXES FOR IMPROVED GRID FLOW */
  .row > [class*="col-"] {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  /* 4. MODALS, POPUPS & SWEETALERTS FULL RESPONSIVENESS */
  .modal-dialog {
    margin: 0.5rem !important;
    max-width: calc(100% - 1rem) !important;
  }
  
  .modal-content {
    padding: 0.5rem !important;
  }
  
  .swal2-popup {
    width: 92% !important;
    padding: 1rem !important;
    font-size: 0.85rem !important;
  }

  /* 5. DATATABLES CONTROLS OPTIMIZATION */
  div.dataTables_wrapper div.dataTables_length,
  div.dataTables_wrapper div.dataTables_filter,
  div.dataTables_wrapper div.dataTables_info,
  div.dataTables_wrapper div.dataTables_paginate {
    text-align: center !important;
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
  }
  
  div.dataTables_wrapper .row {
    flex-direction: column !important;
  }
  
  /* 6. CHARTS & INLINE LOGOS SCALING */
  .apexcharts-canvas, .apexcharts-canvas svg {
    max-width: 100% !important;
  }
  
  /* 7. BADGES & QUICK ACTIONS */
  .badge {
    padding: 0.35em 0.5em !important;
    font-size: 75% !important;
  }
}

@media (max-width: 575.98px) {
  /* Extra mobile optimization */
  .btn {
    padding: 0.45rem 0.85rem !important;
    font-size: 0.8rem !important;
  }
  
  h1, .h1 { font-size: 1.6rem !important; }
  h2, .h2 { font-size: 1.4rem !important; }
  h3, .h3 { font-size: 1.2rem !important; }
  h4, .h4 { font-size: 1.05rem !important; }
  
  /* Stacking form controls that get squished */
  .input-group {
    flex-wrap: wrap !important;
  }
  
  .input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    margin-left: 0 !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
  }
}

