@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --white: #ffffff;
  --light-grey: whitesmoke;
  --dark-grey: #c7c7c7;
  --grey: grey;
  --grey-2: rgb(227, 227, 227);
  --black: #2e3443;
  --dark-green: #1e413d;
  --light-green: #22845e;
  --light-green-2: #00a868;
  --light-green-3: #07855454;
  --yellow: #dd8d33;
  --font: "Roboto", sans-serif;
  --radius-s: 0.3rem;
  --radius-m: 0.8rem;
  --radius-l: 10rem;
  --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar {
  background: transparent;
  max-width: 0.3rem;
  max-height: 0.3rem;
}

::-webkit-scrollbar-thumb {
  background-color: var(--light-green);
  border-radius: 30rem;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

body {
  background-color: var(--light-grey);
  font-family: var(--font);
}

h4 {
  font-family: var(--font);
  font-weight: 600;
  color: var(--black);
}

h1 {
  color: var(--white);
  font-family: var(--font);
}

.hamburger,
.hamburger-side {
  cursor: pointer;
  display: none;
}

.hamburger-side {
  display: none;
}

#close-side-menu {
  display: none;
}

.hamburger p {
  color: var(--dark);
  font-size: 1.5rem;
}

p,
a,
span,
input,
label,
td,
th {
  font-family: var(--font);
  font-weight: 400;
  color: var(--black);
}

.username {
  color: var(--black);
}

a {
  text-decoration: none;
  color: var(--yellow);
}

button {
  border: none;
  padding: 0.6em 1em;
  border-radius: var(--radius-l);
  font-family: var(--font);
  font-weight: 600;
  background-color: var(--yellow);
  color: var(--black);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2); /* Subtle inner shadow */
  transition: box-shadow 0.3s ease-in-out, background-color 0.3s ease-in-out;
  cursor: pointer;
}

/* button:hover {
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.25);
} */

input,
select {
  background-color: var(--light-grey);
  border: none;
  color: var(--black);
  padding: 1em;
  border-radius: var(--radius-s);
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  outline: 1px solid var(--light-green);
}

.content-box {
  display: flex;
  height: 100svh;
}

.sidebar {
  background-color: var(--white);
  width: 16rem;
  border-radius: var(--radius-s);
  min-height: 100%;
  max-height: 100svh;
  position: fixed;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  overflow-y: scroll;
}

.sidebar-header {
  padding: 0 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  position: relative;
}

.sidebar-header img {
  height: 4rem;
}

#close-sidebar {
  position: absolute;
  color: red;
  font-size: 2.5rem;
  top: 0;
  right: 1rem;
  display: none;
}

.nav {
  flex-grow: 1;
  max-height: 40rem;
  overflow-y: auto;
  padding: 1.5rem 0;
}

.nav-item,
.nav-item-link {
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  color: var(--black);
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-item i,
.nav-item-link i {
  margin-right: 0.75rem;
  width: 24px;
  text-align: center;
}

.nav-item.active,
.nav-item.active:hover {
  color: var(--white);
  background-color: var(--light-green);
  border-right: 3px solid var(--yellow);
}

.nav-item:hover,
.nav-item-link:hover {
  background-color: var(--light-grey);
}

.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid #f1f5f9;
  display: grid;
  gap: 2rem;
  margin-top: auto;
}

#branch-link {
  padding: 0.3rem 0.6em;
  background: linear-gradient(-60deg, var(--yellow), var(--light-green));
  border-radius: var(--radius-s);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

#branch-link span {
  color: var(--light-grey);
  font-size: 0.9rem;
}

.user-profile {
  display: grid;
}

.user-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-info-box {
  display: grid;
  padding: 0;
}

.user-info-box:hover {
  background-color: var(--white);
}

.user-info-box.nav-item.active {
  background-color: transparent;
  color: var(--black);
  border: none;
}

.user-info-box h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dark);
}

.user-info-box p {
  font-size: 0.75rem;
  color: var(--light-green);
}

.user-info i {
  color: var(--light-green);
}

.main-content {
  margin-left: 14rem;
  min-height: 100svh;
  padding: 2rem;
  flex: 1;
  background-color: var(--light-grey);
  position: relative;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.page-title h1 {
  color: var(--dark);
  font-size: 1.75rem;
  font-weight: 700;
}

.search-bar {
  position: relative;
  width: 300px;
  background-color: var(--light-green);
  border-radius: 8px;
}

.search-bar input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: none;
  font-size: 0.9375rem;
  color: var(--white);
  background-color: var(--light-green);
}

.search-bar input:focus {
  outline: none;
}

.search-bar input::placeholder {
  color: var(--light-grey);
}

.search-bar i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--light-grey);
}

.search-box {
  position: absolute;
  width: 100%;
  top: 3rem;
  border-radius: 8px;
  display: none;
  gap: 1rem;
  background-color: var(--white);
  padding: 0.5rem;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-result {
  background-color: var(--light-grey);
  padding: 0.5rem;
  border-radius: 8px;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-badge.pending {
  background-color: #e5f3ff;
  color: #2e9dff;
}

.status-badge.completed {
  background-color: #e6f7ee;
  color: #10b981;
}

.status-badge.cancelled {
  background-color: #feecec;
  color: #ef4444;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-primary {
  background-color: var(--light-green);
  color: var(--white);
}

.btn-outline {
  background-color: var(--yellow);
  color: var(--white);
}

.tabs {
  display: flex;
  margin-bottom: 1.5rem;
}

.tab,
.med-tab {
  padding: 0.75rem 1rem;
  font-weight: 500;
  color: var(--black);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab.active,
.med-tab.active {
  color: var(--light-green);
  border-bottom-color: var(--yellow);
}

.tab-content,
.tabContent,
.medical-data-table,
.results-card {
  display: none;
}

.tab-content.active,
.medical-data-table.active,
.results-card.active {
  display: block;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--dark);
  cursor: pointer;
  padding: 0;
}

.tab-content,
.tabContent {
  display: none;
  padding-bottom: 1rem;
}

.tab-content.active,
.tabContent.active {
  display: block;
}

.flash-messages {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 100%;
  max-width: 400px;
  z-index: 1000;
  display: grid;
  gap: 0.75rem;
}

.flash-message {
  position: relative;
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  animation: slide-in 0.3s ease-out forwards;
  transition: all 0.3s ease;
  overflow: hidden;
}

.flash-message::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.1);
}

.flash-message::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: var(--progress, 100%);
  height: 4px;
  background: rgba(255, 255, 255, 0.5);
  animation: progress 10s linear forwards;
}

.flash-content {
  flex: 1;
  padding-right: 1rem;
}

.flash-content p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--white);
}

.flash-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0.7;
}

.flash-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.1);
}

.flash-close svg {
  width: 16px;
  height: 16px;
}

/* Category Colors */
.flash-success {
  background-color: #4caf50;
}

.flash-info {
  background-color: #2196f3;
}

.flash-warning {
  background-color: #ff9800;
}

.flash-danger {
  background-color: #f44336;
}

/* Animations */
@keyframes slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes progress {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}

/* Hover pause animation */
.flash-message:hover::before {
  animation-play-state: paused;
}

.header-logo {
  cursor: pointer;
}

@media screen and (max-width: 1000px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 100;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .hamburger,
  #close-sidebar {
    display: block;
  }
}

@media screen and (max-width: 900px) {
  #close-side-menu {
    display: block;
  }

  .side-nav-menu {
    transform: translateX(-150%);
    transition: 250ms ease-in;
    position: fixed;
    inset: 0;
  }
}

@media screen and (max-width: 800px) {
  .header-logo {
    width: 50px;
    height: 2rem;
  }

  #terra_heading {
    font-size: 1.5rem;
  }
}

@media screen and (max-width: 600px) {
  .link1,
  .link2 {
    display: none;
  }

  .flash-messages {
    max-width: calc(100% - 2rem);
    left: 1rem;
    right: 1rem;
    top: 1rem;
  }

  @keyframes slide-in {
    from {
      transform: translateY(-100%);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
}

/* === Hamburger Menu Styles (only under 500px) === */
/* Below 500px – collapse link1 into hamburger */
@media screen and (max-width: 500px) {
  .link1,
  #terra_heading {
    display: none;
  }

  .header-logo {
    height: 3rem;
  }
}

/* === 400px and below === */
@media screen and (max-width: 400px) {
  .header-logo {
    width: 18px;
    height: 1.3rem;
  }

  #terra_heading {
    font-size: 1.1rem;
  }

  .link1 {
    top: 3rem;
    right: 0.8rem;
    padding: 0.8rem;
  }

  .link1 a {
    font-size: 0.85rem;
    padding: 0.4rem 0;
  }

  .main-content {
    padding: 0.5rem 1rem 1rem;
  }
}

/* === 300px and below === */
@media screen and (max-width: 300px) {
  .header-logo {
    width: 15px;
    height: 1.1rem;
  }

  #terra_heading {
    font-size: 1rem;
  }

  .link1 {
    top: 2.8rem;
    right: 0.5rem;
    padding: 0.6rem;
  }

  .link1 a {
    font-size: 0.75rem;
    padding: 0.3rem 0;
  }

  /* Optional: hide heading if space is tight */
  #terra_heading {
    display: none;
  }
}
