/* FILE: ProjectRoot/web/css/header.css */

/* -----------------------------
 * Header layout
 * ----------------------------- */

#app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f5f5f5;
  border-bottom: 1px solid #ddd;
  font-size: 0.9em;

  /* NEW: make header stick to top */
  position: sticky;
  top: 0;
  z-index: 2000;
}

#header-left,
#header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* -----------------------------
 * Buttons / dropdown triggers
 * ----------------------------- */

.header-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  font-size: 0.9em;
}

.header-btn:hover {
  background: #eee;
}

.header-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  font-size: 1.1em;
  line-height: 1;
}

.header-icon-btn:hover {
  background: #eee;
}

.caret {
  font-size: 0.7em;
}

/* -----------------------------
 * Dropdown menus
 * ----------------------------- */

.header-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-top: 4px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  z-index: 2100;
  padding: 4px 0;
}

.dropdown-menu-right {
  right: 0;
  left: auto;
}

.dropdown-item {
  width: 100%;
  padding: 6px 10px;
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.9em;
}

.dropdown-item:hover {
  background: #f0f0f0;
}

.dropdown-item.disabled {
  color: #999;
  cursor: default;
}

.hidden {
  display: none;
}

/* -----------------------------
 * Login status
 * ----------------------------- */

#login-status {
  font-size: 0.9em;
  color: #666;
}

#login-status a {
  color: #04AA6D;
  text-decoration: none;
}

#login-status a:hover {
  font-weight: bold;
}

/* -----------------------------
 * Modals (login + forgot)
 * ----------------------------- */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

.modal.hidden {
  display: none !important;
}

.modal-content {
  background: #fff;
  padding: 25px 30px;
  border-radius: 8px;
  width: 420px;
  max-width: 90%;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.modal-content h2 {
  margin-top: 0;
  margin-bottom: 15px;
  text-align: center;
}

.modal-content label {
  display: block;
  margin-top: 10px;
  margin-bottom: 4px;
  font-weight: 600;
}

.modal-content input {
  width: 100%;
  padding: 8px;
  margin-bottom: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.login-btn {
  width: 100%;
  padding: 10px;
  background: #04AA6D;
  color: white;
  border: none;
  border-radius: 4px;
  margin-top: 10px;
  cursor: pointer;
}

.login-btn:hover {
  background: #038f5d;
}

.forgot {
  text-align: center;
  margin-top: 10px;
}

.forgot a {
  color: #04AA6D;
  text-decoration: none;
}

.forgot a:hover {
  text-decoration: underline;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
}

.error-message {
  color: red;
  margin-top: 10px;
  text-align: center;
}

/* -----------------------------
 * Responsive tweaks
 * ----------------------------- */

@media (max-width: 600px) {
  #app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  #header-left,
  #header-right {
    justify-content: space-between;
  }
}
