/* app-layout.css - Core layout styles for the application */

/* Main layout container */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  position: relative;
  overflow-x: hidden;
  background-color: var(--bg-color, #f8fafc);
}

/* Main content area */
.app-main {
  margin-left: 250px;
  padding-top: 80px;
  padding-bottom: 20px;
  padding-left: 20px;
  padding-right: 20px;
  min-height: calc(100vh - 60px);
  width: calc(100% - 250px);
  flex: 1;
  transition: margin-left 0.3s ease, width 0.3s ease;
  z-index: 1;
}

/* When sidebar is collapsed */
.app-layout.sidebar-collapsed .app-main {
  margin-left: 0;
  width: 100%;
}

/* Responsive layout on mobile */
@media (max-width: 768px) {
  .app-main {
    margin-left: 0;
    width: 100%;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .app-layout.sidebar-open .app-main {
    opacity: 0.5;
  }
}

/* Fix for any content overflow */
.dashboard-grid {
  width: 100%;
  overflow-x: hidden;
}

/* Card styling enhancements */
.dashboard-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card-content {
  flex: 1;
  overflow: hidden;
}

/* Z-index layering */
.app-header {
  z-index: 1000;
}

.app-sidebar {
  z-index: 950;
}

.sidebar-overlay {
  z-index: 949;
}

.app-main {
  z-index: 1;
}

.modal-container {
  z-index: 1100;
}

.notification-container {
  z-index: 1200;
}

/* Performance tweaks */
* {
  box-sizing: border-box;
}

/* Improved scrolling */
html, body {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

/* Fixed position elements anchoring */
.app-header,
.app-sidebar,
.modal-container,
.notification-container {
  position: fixed;
}

/* Metric values styling */
.metric-value.positive {
  color: var(--success-color, #22c55e);
}

.metric-value.negative {
  color: var(--danger-color, #ef4444);
}

/* Fixed layout spacing */
.app-layout {
  padding: 0;
  margin: 0;
}

/* Button hover effects */
.btn {
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease;
}

.btn:active::after {
  width: 200px;
  height: 200px;
  opacity: 1;
  transition: 0s;
}

/* Fix sidebar content overflow */
.app-sidebar {
  overflow-x: hidden;
}

/* Improve table responsiveness */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
