@font-face {
  font-family: 'Cascadia Code';
  src: url('CascadiaCode.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}
body {
  margin: 0;
  font-family: 'Cascadia Code', 'Noto Sans SC', sans-serif;
  background-color: #121212;
  color: #f1f1f1;
}
.container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  padding: 1rem;
}
.card {
  background: #1e1e1e;
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: transform 0.2s, background 0.3s;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: attr(data-drug-name);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(30deg);
  font-size: 8rem;
  font-weight: 900;
  color: #333;
  pointer-events: none;
  z-index: 1;
  clip-path: inset(0 0 0 0);
  transition: font-size 1s ease, color 3s ease;
}

.card:hover::before {
  font-size: 10rem;
  color:#666;
  animation: 3s infinite alternate;
}



.card.favorite {
  border: 2px solid gold;
}

.favorite-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: gray;
  cursor: pointer;
  z-index: 10;
}

.favorite-btn.favorited {
  color: gold;
}

.menu-bar {
  display: flex;
  justify-content: center;
  padding: 1rem;
  background-color: #1e1e1e;
  border-radius: 12px;
  margin: 1rem;
  flex-wrap: wrap;
}

.category-filter {
  margin: 0.1rem;
  padding: 0.3rem 0.8rem;
  font-size: 0.9rem;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.category-filter:hover {
  opacity: 0.8;
}

/* Category-specific styles */
.category-button {
  padding: 0.5em 1em;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1em;
  margin-right: 0.5em;
}

  .card {
    overflow: hidden;
    position: relative;
  }

  .card-content {
    position: relative;
    z-index: 2;
  }
.card:hover {
  background: #2c2c2c;
  transform: scale(1.02);
}
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.6);
  opacity: 0;
  transition: opacity 0.5s ease, background-color 0.5s ease;
}

.modal.show {
  display: block;
  opacity: 1;
  animation: fadeIn 0.5s forwards, fadeOut 0.5s 3s forwards;
}

@keyframes fadeIn {
  0% {
    background-color: rgba(0,0,0,0.6);
  }
  100% {
    background-color: rgba(0,0,0,0.9);
  }
}

@keyframes fadeOut {
  0% {
    background-color: rgba(0,0,0,0.9);
  }
  100% {
    background-color: rgba(0,0,0,0.6);
  }
}

.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 1.5em;
  border-radius: 10px;
  width: 90%;
  max-width: 600px;
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal-content.show {
  opacity: 1;
  transform: scale(1);
}
.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  background: #ff4444;
  border: none;
  color: white;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
}
.dosage {
  margin-top: 1rem;
}
.danger {
  color: red;
  font-weight: bold;
}
.category-button {
  padding: 0.5em 1em;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1em;
  margin-right: 0.5em;
}
@media (max-width: 600px) {
  .modal-content {
    padding: 1rem;
  }
}

/* Sticky Bottom Bar */
.sticky-bottom-bar {
  position: fixed;
  bottom: 0;
  width: 100%;
  height: 50px;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  z-index: 1000;
}

.sticky-bottom-bar:hover .disclaimer-panel {
  display: block;
}

.disclaimer-panel {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  display: block;
  width: 80%;
  max-width: 400px;
  text-align: center;
  opacity: 0;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  display: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in, visibility 0.3s ease-in;
}

.modal.show {
  display: flex;
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: #1e1e1e;
  border-radius: 16px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  position: relative;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
  display: flex; /* Added for layout */
  flex-direction: column; /* Added for layout */
  max-height: 80vh; /* Added for scrollability */
}

.modal-content.show {
  opacity: 1;
  transform: scale(1);
}

#modalBody {
  overflow-y: auto; /* Make this part scrollable */
  flex-grow: 1; /* Allow body to take available space */
  padding-right: 10px; /* Adjust padding for custom scrollbar */
  /* Hide default scrollbar for Webkit browsers */
  &::-webkit-scrollbar {
    width: 8px;
  }
  /* Hide default scrollbar for Firefox */
  scrollbar-width: thin;
  scrollbar-color: #555 #1e1e1e; /* thumb and track color for Firefox */
  /* Hide default scrollbar for IE/Edge */
  -ms-overflow-style: none;
}

/* Custom Scrollbar for Webkit browsers */
#modalBody::-webkit-scrollbar-track {
  background: #1e1e1e; /* Color of the tracking area */
  border-radius: 10px;
}

#modalBody::-webkit-scrollbar-thumb {
  background-color: #555; /* Color of the scroll thumb */
  border-radius: 10px;
  border: 2px solid #1e1e1e; /* Creates padding around scroll thumb */
}

#modalBody::-webkit-scrollbar-thumb:hover {
  background-color: #777; /* Color of the scroll thumb on hover */
}


/* Styling for sections within modalBody */
#modalBody h2 {
  margin-top: 0;
  color: #eee;
}

#modalBody p {
  margin-bottom: 0.8rem;
  line-height: 1.6;
  color: #ccc;
}

#modalBody strong {
  color: #f0f0f0;
}

#modalBody a {
  color: #61dafb;
  text-decoration: none;
}

#modalBody a:hover {
  text-decoration: underline;
}

.modal-section {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #333;
}

.modal-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}
