/* layout.css - structural layout components */

/* Grid Layout Structure */
body,
html {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: "Comic Neue", sans-serif;
  font-size: 80%;
  display: grid;
  grid-template-rows: var(--header-height) var(--nav-height) 1fr var(--footer-height);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
}

.page-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  margin-top: calc(var(--header-height) + var(--nav-height));
}

/* Header Component */
header {
  font-family: "Comic Neue", sans-serif;
  background-color: var(--header-background-color);
  color: var(--header-text-color);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1030;
  height: var(--header-height);
  padding: 5px;
  font-size: 1.5em;
}

header img {
  border-radius: 50%;
}

header .customer-field {
  text-align: center;
}

header .username {
  margin-right: 10px;
}

header .dropdown img {
  width: 20px;
  height: 20px;
}

header .header-logo {
  width: 50px;
  height: 50px;
}

/* Updated: Ensure navbar spans full width */
.navbar-container {
  width: 100%;
  height: var(--nav-height);
  background-color: var(--navbar-background-color);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Basic Component Styles */
.nav {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Navbar Component */
.navbar {
  background-color: var(--navbar-background-color);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  width: 100vw;
  top: var(--header-height);
  font-size: 0.6em;
  z-index: 0;
  margin-left: 0;
  margin-right: 0;
}

/* Navbar Items */
.navbar-nav {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  z-index: 1000;
}

.navbar-nav .nav-item {
  margin: 0 15px;
  z-index: 1015;
}

.navbar-nav .nav-link {
  text-decoration: none;
  color: var(--navbar-text-color);
  padding: 10px;
  transition: background-color 0.3s ease-in-out;
  z-index: 1015;
}

.navbar-nav .nav-link:hover {
  background-color: var(--navbar-menu-color);
  border-radius: 5px;
  z-index: 1015;
}

/* Dropdown Menu */
.navbar-nav .dropdown-menu {
  display: none;
  position: absolute;
  background-color: var(--navbar-menu-color);
  border-radius: 5px;
  padding: 10px;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1015;
}

.navbar-nav .nav-item:hover .dropdown-menu {
  display: block;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .navbar-nav {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    height: auto;
  }

  .navbar-nav {
    flex-direction: column;
    align-items: center;
  }

  .navbar-nav .nav-item {
    width: 100%;
    text-align: center;
  }
}

/* Footer Component */
.footer {
  background-color: var(--footer-background-color);
  color: var(--footer-text-color);
  width: 100%;
  height: var(--footer-height);
  font-size: 1em;
  margin-top: auto; /* Pushes the footer to the bottom */
  flex-shrink: 0;
}

.footer a {
  color: var(--footer-text-color);
}

.footer a:hover {
  color: var(--footer-hover-color);
}

.layout-card-header {
  background-color: var(--section-title-background);
  color: var(--section-title-text-color);
  padding: 10px;
  border-radius: 5px;
}

/* Reference Data */
.reference-container {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  position: relative;
}

/* Ensure table doesn't expand beyond container */
.reference-container table {
  width: 100%;
  margin-bottom: 0;
}
