/* public/css/custom_layout.css */

body {
  overflow-x: hidden;
  /* Ensure body takes up at least full viewport height to prevent footer issues */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content-wrapper {
  flex-grow: 1;
  padding-top: calc(60px + 1rem); /* 60px for topbar height */
  padding-bottom: 1rem;
  padding-right: 1rem;
  /* min-height: calc(100vh - 60px); Removed as body handles min-height */
  transition: padding-left 0.35s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s ease;
  width: 100%; /* Ensure it tries to take full width initially */
}

[data-bs-theme="dark"] .content-wrapper {
  color: var(--theme-dark-body-text-color);
}

/* Desktop Sidebar Adjustments */
@media (min-width: 992px) {
  body:not(.sidebar-is-floating).sidebar-state-expanded .content-wrapper,
  body:not(.sidebar-is-floating).sidebar-state-expanded .bd-footer {
    padding-left: calc(280px + 1rem);
  }

  body:not(.sidebar-is-floating).sidebar-state-mini .content-wrapper,
  body:not(.sidebar-is-floating).sidebar-state-mini .bd-footer {
    padding-left: calc(63px + 1rem);
  }

  body.sidebar-state-hidden .content-wrapper,
  body.sidebar-state-hidden .bd-footer,
  body.sidebar-is-floating .content-wrapper, /* Full width if sidebar is floating */
  body.sidebar-is-floating .bd-footer {
    padding-left: 1rem;
  }

  /* Default state if no specific body class (e.g., mini) and not floating */
  .content-wrapper,
  .bd-footer {
    padding-left: calc(63px + 1rem); /* Default to mini sidebar width */
  }

  /* Explicitly handle floating state for default */
  body.sidebar-is-floating .content-wrapper,
  body.sidebar-is-floating .bd-footer {
    padding-left: 1rem !important;
  }
}

/* Mobile and Tablet Adjustments */
@media (max-width: 991.98px) {
  .content-wrapper,
  .bd-footer {
    padding-left: 1rem; /* Simple padding for mobile */
    padding-right: 1rem;
    width: 100%; /* Ensure full width on mobile */
    box-sizing: border-box;
  }
}

.bd-footer {
  width: 100%;
  flex-shrink: 0; /* Prevent footer from shrinking */
  background-color: var(--theme-light-footer-bg);
  backdrop-filter: blur(var(--theme-glass-blur));
  color: var(--theme-light-footer-text-color);
  border-top: 0.5px solid var(--theme-light-footer-border-color);
  padding-top: 1rem;
  padding-bottom: 1rem;
  padding-right: 1rem; /* Consistent with content-wrapper */
  transition: padding-left 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  margin-top: auto; /* Push footer to bottom if content is short */
}

[data-bs-theme="dark"] .bd-footer {
  background-color: var(--theme-dark-footer-bg);
  color: var(--theme-dark-footer-text-color);
  border-top-color: var(--theme-dark-footer-border-color);
}

/* Floating Item (Wallet) Positioning */
.floating-item-position {
  transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1), top 0.3s ease-in-out;
  top: calc(60px + 15px); /* Below topbar */
  z-index: 1000; /* Below sidebar overlay, but above content */
  position: fixed; /* Ensure it's fixed */
}

@media (min-width: 992px) {
  body:not(.sidebar-is-floating).sidebar-state-expanded
    .floating-item-position {
    left: calc(280px + 15px);
  }
  body:not(.sidebar-is-floating).sidebar-state-mini .floating-item-position {
    left: calc(63px + 15px);
  }
  body.sidebar-state-hidden .floating-item-position,
  body.sidebar-is-floating .floating-item-position {
    /* Adjust if sidebar is floating */
    left: 15px;
  }
  /* Default for desktop if no specific state or floating */
  .floating-item-position {
    left: calc(63px + 15px); /* Default to mini sidebar offset */
  }
  body.sidebar-is-floating .floating-item-position {
    left: 15px !important; /* Ensure it's at the edge when floating */
  }
}

@media (max-width: 991.98px) {
  .floating-item-position {
    left: 15px; /* Simple positioning for mobile */
    /* Consider if it should be fixed or scroll with content on mobile */
  }
}
