
@import url("../dimens/global.css");
@import url("../colours.css");

@font-face {
  font-family: "App-Medium";
  src: url("../fonts/Nunito-Medium.ttf");
}
@font-face {
  font-family: "App-Regular";
  src: url("../fonts/Nunito-Light.ttf");
}

.top-container {
  position: sticky;
  width: 100%;
  top: 0;
  z-index: 1000;
}

.hStack {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  min-width: 0;
  max-width: var(--top-bar-max-width);
  /* width: 70%; */
}

.top-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 12px var(--top-bar-margin-right) 12px var(--top-bar-margin-right);
  background: var(--white);
  border-bottom: 1px solid var(--silver-background);
  /* overflow: hidden;    */
}
.top-bar-1 {
  height: var(--top-bar-height);
  background-color:var(--white);
}

.top-bar-2 {
  /* height: 56px;
  gap: 16px; */
  height: var(--top-bar-height);
  display: flex;
  align-items: center;
  gap: 16px;

  overflow-x: auto;     /* enable horizontal scroll */
  overflow-y: hidden;
  white-space: nowrap; /* prevent wrapping */
  -webkit-overflow-scrolling: touch; /* smooth iOS scrolling */
  flex-direction: row;
  display: none;
  

  background-color:var(--white);
}

/* Sections */
.top-bar .left, .top-bar .center, .top-bar .right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-bar .left, .top-bar .right {
  flex-shrink: 0;
}

.spacer {
    height: 100%;
    width: 1px;
    align-items: center;
    background-color: var(--silver-background);
    margin-left: 15px;
}

.spacer-2 {
    height: 100%;
    width: 1px;
    align-items: right;
    background-color: var(--silver-background);
    margin-right:5px;
}

.title-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Logo */
.logo {
  height: var(--top-bar-logo-height);
}

/* Dates */
.date-box {
  /* width: var(--top-bar-filter-width); */
  height: var(--dates_box_height);
  width: var(--dates_box_width);
  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 0 12px;

  border: 1px solid var(--silver-background);
  border-radius: 8px;
  background: var(--white);

  box-shadow: 0 2px 6px rgba(0, 0, 0, var(--top-bar-buttons-shadow));
}

/* Label */
.date-label {
  font-family: App-Medium;
  font-size: var(--top-bar-filter-font-size);
  color: var(--text-regular);
  white-space: nowrap;
}

/* Date input */
.date-input {
  border: none;
  outline: none;
  font-family: App-Regular;
  font-size: var(--top-bar-filter-font-size);
  background: transparent;
  padding: 0;
  color: var(--text-regular);
  padding-right: 5px;

  /* iOS fix */

}

.search {
  height: var(--dates_box_height);
  padding: 0 12px;
  border-radius: 18px;
  border: 1px solid var(--silver-background);
  font-family: App-Regular;
  font-size: var(--top-bar-filter-font-size);
  outline: none;
  color: var(--text-regular);
  box-shadow: 0 2px 6px rgba(0, 0, 0, var(--top-bar-buttons-shadow));
  box-sizing: border-box;
}


.search.dates-hidden {
  width: 100%;
  max-width: var(--searchbar-max-width-hidden);;
}
.search.dates-not-hidden {
  width: 100%;
  max-width: 1000%;
}
.left.search-container {
  flex: 1 1 auto;
  min-width: var(--searchbar-min-width);   /* a real floor, not 0 — prevents total collapse */
}

#dates_container_id.center {
  flex: 1 1 auto;          /* grow to fill available space */
  justify-content: center; /* keep date boxes centered within that space */
}




/* Buttons */
.icon-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
}
.icon-home {
  content: "⌄";  /* unicode down arrow */
}

.dropdown {
  display: flex;
  align-items: center;
  height: var(--dropdown_box_height);
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--silver-background);
  background: var(--white);
  color: var(--text-regular);
  font: App-Medium;
  font-size: var(--top-bar_title_size);
  cursor: pointer;
  word-wrap: ellipsis;
  white-space: nowrap; 
  overflow: hidden;   

  box-shadow: 0 2px 6px rgba(0, 0, 0, var(--top-bar-buttons-shadow));

}

.dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.dropdown-container {
  position: absolute;
  right: 0;               /* align to button end */
  margin-top: 6px;

  width: var(--dropdown-container-width);           /* whatever you want */
  height: 320px;

  border: none;
  display: none;          /* toggled by JS */
  z-index: 1000;
  display: none;

  border-radius: 8px;
  background-color: var(--white);

  box-shadow: 0 2px 6px rgba(0, 0, 0, var(--top-bar-buttons-shadow));
}

/* User */
.user {
  text-align: left;
  min-width: 0;
  flex-direction: column;
  display: inline-flex;      /* important */

}

.user-image {
  text-align: right;
  width: 30px;
}

.user .name {
    font-family: App-Medium;
    font-size: var(--top-bar_name_size);
    color: var(--text-regular);
    white-space: nowrap; 
}

.user .role {
    font-family: App-Regular;
    font-size: var(--top-bar_role_size);
    color: var(--text-regular);
    white-space: nowrap; 
    text-overflow: ellipsis; 
    overflow: hidden; 
}

/* Settings link */
.settings {
  display: flex;
  gap: 0px;
  color: var(--text-small-titles);
  text-decoration: none;
  font-family: App-Medium;
  margin-right: var(--top-bar-margin-right);

}

.settings:hover {
  text-decoration: underline;
}

.icon-user::before {
  content: "👤";  /* unicode emoji as icon */
}
.icon-chevron::before {
  content: "⌄";  /* unicode down arrow */
}

/* Floating action buttons for refresh/options */
.right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  flex: 1 1 0;      /* ← each button takes an equal share of .right's width */
  min-width: 50%;      /* ← allows shrinking evenly instead of overflowing */
  height: 40px;
  padding: 0 18px;
  border-radius: 20px;
  

  background: var(--white);
  color: var(--text-small-titles);
  text-decoration: none;
  font-family: App-Medium;
  font-size: 14px;
  white-space: nowrap;

  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18), 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fab-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22), 0 2px 4px rgba(0, 0, 0, 0.14);
  text-decoration: none;
}