/************************ RESOURCES SECTION CSS ************************/
.resources-wrapper {
  background-color: rgba(255, 255, 255, 0.8);
  padding: 3rem 0rem;
  font-family: 'Nunito', sans-serif;
  border-radius: 10px;
}

.resources-header {
  text-align: center;
  margin-bottom: 2rem;
}

.resources-header h2 {
  color: #2f5cb5;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.resources-header p {
  color: #1C1C1C;
  font-size: 1.15rem;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.resource-filters {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(3, 49, 161, 0.3);
  color: #003d7a;
  padding: 0.45rem 1rem;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  min-width: 44px;
  min-height: 44px;
}

.filter-btn.active,
.filter-btn:hover {
  background: #2a468f;
  color: white;
  border-color: rgba(3, 49, 161, 0.5);
  box-shadow: 0 4px 10px rgba(3, 49, 161, 0.2);
}

.resource-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(3, 1fr); /* Always 3 equal columns */
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 25px;
}

.resource-card {
  position: relative;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 75, 133, 10.4);
  box-shadow:0 8px 24px rgba(206, 230, 244, 0.4); /* Purple base shadow */
  display: flex;
  flex-direction: column;
  overflow: visible;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
  z-index: 1;
}

/* Move and glow on hover, focus, or active */
.resource-card:hover,
.resource-card:focus-within,
.resource-card:active {
  transform: translateY(-8px);
  box-shadow: 0 8px 24px rgba(0, 75, 133, 0.25);
}
.resource-card:hover::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  box-shadow: 0 0 30px rgba(131, 152, 255, 0.15);
  pointer-events: none;
}

.resource-card.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  transition: opacity 0.5s ease, height 0.5s ease, margin 0.5s ease, padding 0.5s ease;
}

.resource-card.show {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: scale(1);
  background-color: #fff;
}

.resource-illustration img {
  width: 100%;
  height: auto;
  display: block;
  border-bottom: 1px solid #eee;
  border-top-left-radius: 17px;
  border-top-right-radius: 17px;
}

.resource-content {
  padding: 1.08rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.resource-content a:not(.bottom-actions a) { 
  font-weight: bold;
  word-break: break-all;
  color: #003d7a ;
}

.resource-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  /*color: #699bff;*/
}

.resource-card h2 {
  color: var(--text-dark);
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
  font-weight: bold;
}

.resource-card p {
  color: #1C1C1C;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.tag-chip {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #333;
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.4);
  margin-bottom: 0.5rem;
  background-color: ghostwhite;
  border: 1px solid #ebdff3;
}

.resource-link {
  display: inline-block;
  background-color:#004b85; /* your primary color */
  color: white;
  padding: 0.5rem 1.2rem;
  border-radius: 25px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 8px rgba(11, 139, 255, 0.3);
  cursor: pointer;
  user-select: none;
}

.resource-link:hover,
.resource-link:focus {
  background-color: #0a5fa0;
  box-shadow: 0 4px 8px rgba(54, 130, 201, 0.3);
  text-decoration: none;
  color: #fff;
  outline: none;
}

.resource-card {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: auto;
  overflow: visible; /* important to allow dropdown visibility */
  position: relative; /* required for z-index to work properly */
  z-index: 1;
}

.resource-card:not(.show) {
  opacity: 0;
  transform: scale(0.98);
}

.resource-card.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden; /* hides visually but keeps layout space */
  transform: scale(1); /* don't scale down */
}

.resource-card.show {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  visibility: visible;
}

/* Responsive grid for mobile */
@media (max-width: 801px) {
  .resource-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets */
    gap: 1.5rem;
    padding: 0 1rem;
  }

  .bottom-actions {
    gap: 1rem !important;
  }
}

@media (max-width: 573px) {
  .resource-grid {
    grid-template-columns: 1fr; /* 1 column on phones */
    gap: 1rem;
    padding: 0 1rem;
  }

  .resources-wrapper {
    padding: 2rem 1rem;
  }
}

@media (max-width: 330px) {
  .bottom-actions {
    gap: .5rem !important;
  }
}

.resource-dropdown {
  position: relative;
  display: inline-block;
}

.resource-card {
  position: relative;
  z-index: 1;
}

.resource-card:hover,
.resource-card:focus-within {
  z-index: 2; /* Bring hovered card and its dropdown above */
}

.resource-link:focus {
  outline: none;
}
.resource-dropdown {
  position: relative;
  z-index: 10; /* ensure it's higher than the card */
}

.bottom-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.subheader {
    padding: 0.4em 0.8em;
    background: #5a007a;      /* Light purple background */
    color: #f3e8ff;           /* Dark purple text */
    border-bottom-right-radius: 10px;
    border-top-right-radius: 10px;
    width: 100%;
    max-width: 950px;
    font-size: 1.6rem;
    font-weight: 500;
}

.resource-group {
  margin-bottom: 2rem;
}

.resource-card.hidden {
  display: none !important;
}

.resource-icon .fa-hand-holding-medical, .resource-icon .fa-building-columns, .resource-icon .fa-shield-virus, .resource-icon .fa-folder-open, .resource-icon .fa-book, .resource-icon .fa-database, .resource-icon .fa-spa .resourc-icon .fa-leaf, .resource-icon .fa-file-alt {
  color: #004b85;
}

.resource-icon{
  text-align: center;
}

.bckgrnd-resource-color{
  background-color: rgb(230 240 255 / 30%);
  border-radius: 10px;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 25px;
  box-shadow: 0 4px 12px rgba(0, 75, 133, 0.25);
  border: 1px solid #c8e1f6;
}

#asthma-page .box-new {
  border-radius: 10px;
}

@media (max-width: 845px){
  .bottom-actions {
    gap: 0.25rem;
  }

  .resource-content {
    padding: .75rem;
  }
}

/* ASTHMA BUTTON CSS */
.center-btn{
  text-align: center;
  margin: 0 auto;
}

.asthma-btn {
  align-items: center;
  appearance: none;
  background-color: #004b85;
  border-radius: 4px;
  border: none;
  box-shadow: 
    rgba(61, 147, 191, 0.4) 0 2px 4px,
    rgba(61, 147, 191, 0.3) 0 7px 13px -3px,
    #0862a7 0 -3px 0 inset;
  box-sizing: border-box;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  line-height: 1.4;     
  padding: 0.75em 1.5em;   
  position: relative;
  text-align: center;
  text-decoration: none;
  transition: box-shadow 0.15s, transform 0.15s;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  white-space: normal;   
  overflow: visible; 
  font-size: 1.2rem; 
  min-height: 3rem;     
  flex-wrap: wrap; 
}

/* Focus */
.asthma-btn:focus {
  box-shadow:
    #004b85 0 0 0 1.5px inset,
    rgba(45, 35, 66, 0.4) 0 2px 4px,
    rgba(45, 35, 66, 0.3) 0 7px 13px -3px,
    #004b85 0 -3px 0 inset;
  text-decoration: none;
  color: #fff;
}

/* Hover */
.asthma-btn:hover {
  box-shadow:
    rgba(45, 35, 66, 0.4) 0 4px 8px,
    rgba(45, 35, 66, 0.3) 0 7px 13px -3px,
    #004b85 0 -3px 0 inset;
  transform: translateY(-2px);
  text-decoration: none;
  color: #fff;
}

/* Active */
.asthma-btn:active {
  box-shadow: #004b85 0 3px 7px inset;
  transform: translateY(2px);
  text-decoration: none;
  color: #fff;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .asthma-btn {
    font-size: 1rem;
    padding: 0.5em 1em;
    min-height: 2.5rem;
  }
}
/************************* END OF RESOURCES SECTION CSS ***********************/