/* pill-info-modal.css
   Self-contained styles for the YesRX "More Info" pill overlay.
   Safe to include in any project: all selectors are prefixed with .pill-info-
*/

:root {
  --pill-info-bg-start: #45B7E9;
  --pill-info-bg-end: #2B3990;
  --pill-info-success: #4EA747;
  --pill-info-success-dark: #275C2E;
  --pill-info-yellow: #FFE300;
  --pill-info-yellow-dark: #F7EC13;
  --pill-info-blue-light: #7CD2F0;
  --pill-info-text: rgba(255,255,255,0.95);
}

.pill-info-hidden { display: none !important; }

/* Overlay */
.pill-info-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: transparent; /* Start with transparent background */
  color: #fff;
  font-family: "Didact Gothic", sans-serif;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  transition: background 0.3s ease 1.6s, opacity 0.3s ease, visibility 0.3s ease; /* Background reveal on open, fade on close */
}

/* Full viewport background to prevent gaps */
.pill-info-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(135deg, #2c3e50, #34495e);
  opacity: 0;
  transition: opacity 0.3s ease 1.6s; /* Appears after bars complete */
}

/* Staggered bar animation system */
.pill-info-bars {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.pill-info-bar {
  position: absolute;
  top: 0;
  height: 100%;
  width: 10%;
  background: linear-gradient(135deg, #2c3e50, #34495e);
  transform: translateY(100%);
  opacity: 0.1; /* Start semi-transparent */
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease; /* Smooth transitions for both directions */
}

/* Bar positioning */
.pill-info-bar:nth-child(1) { left: 0%; }
.pill-info-bar:nth-child(2) { left: 10%; }
.pill-info-bar:nth-child(3) { left: 20%; }
.pill-info-bar:nth-child(4) { left: 30%; }
.pill-info-bar:nth-child(5) { left: 40%; }
.pill-info-bar:nth-child(6) { left: 50%; }
.pill-info-bar:nth-child(7) { left: 60%; }
.pill-info-bar:nth-child(8) { left: 70%; }
.pill-info-bar:nth-child(9) { left: 80%; }
.pill-info-bar:nth-child(10) { left: 90%; }

/* Opening animation delays (left to right) */
.pill-info-modal.pill-info-visible .pill-info-bar:nth-child(1) { transition-delay: 0.0s; }
.pill-info-modal.pill-info-visible .pill-info-bar:nth-child(2) { transition-delay: 0.1s; }
.pill-info-modal.pill-info-visible .pill-info-bar:nth-child(3) { transition-delay: 0.2s; }
.pill-info-modal.pill-info-visible .pill-info-bar:nth-child(4) { transition-delay: 0.3s; }
.pill-info-modal.pill-info-visible .pill-info-bar:nth-child(5) { transition-delay: 0.4s; }
.pill-info-modal.pill-info-visible .pill-info-bar:nth-child(6) { transition-delay: 0.5s; }
.pill-info-modal.pill-info-visible .pill-info-bar:nth-child(7) { transition-delay: 0.6s; }
.pill-info-modal.pill-info-visible .pill-info-bar:nth-child(8) { transition-delay: 0.7s; }
.pill-info-modal.pill-info-visible .pill-info-bar:nth-child(9) { transition-delay: 0.8s; }
.pill-info-modal.pill-info-visible .pill-info-bar:nth-child(10) { transition-delay: 0.9s; }

/* Closing animation delays (right to left) - Start after content disappears */
.pill-info-modal.pill-info-closing .pill-info-bar:nth-child(1) { transition-delay: 1.2s; }
.pill-info-modal.pill-info-closing .pill-info-bar:nth-child(2) { transition-delay: 1.1s; }
.pill-info-modal.pill-info-closing .pill-info-bar:nth-child(3) { transition-delay: 1.0s; }
.pill-info-modal.pill-info-closing .pill-info-bar:nth-child(4) { transition-delay: 0.9s; }
.pill-info-modal.pill-info-closing .pill-info-bar:nth-child(5) { transition-delay: 0.8s; }
.pill-info-modal.pill-info-closing .pill-info-bar:nth-child(6) { transition-delay: 0.7s; }
.pill-info-modal.pill-info-closing .pill-info-bar:nth-child(7) { transition-delay: 0.6s; }
.pill-info-modal.pill-info-closing .pill-info-bar:nth-child(8) { transition-delay: 0.5s; }
.pill-info-modal.pill-info-closing .pill-info-bar:nth-child(9) { transition-delay: 0.4s; }
.pill-info-modal.pill-info-closing .pill-info-bar:nth-child(10) { transition-delay: 0.3s; }

.pill-info-modal.pill-info-visible .pill-info-bar {
  transform: translateY(0);
  opacity: 1; /* Become fully opaque after animation completes */
}

.pill-info-modal.pill-info-visible {
  opacity: 1;
  visibility: visible;
  transition: background 0.3s ease 1.6s, opacity 0.3s ease, visibility 0.3s ease; /* Delayed background on open */
}

.pill-info-modal.pill-info-visible .pill-info-backdrop {
  opacity: 1; /* Backdrop becomes visible after bars complete */
}

/* Closing animation states */
.pill-info-modal.pill-info-closing {
  background: transparent; /* Background fades immediately on close */
  transition: background 0.3s ease, opacity 0.3s ease 2.1s, visibility 0.3s ease 2.1s; /* Delayed hide after bars finish */
}

.pill-info-modal.pill-info-closing .pill-info-backdrop {
  opacity: 0; /* Backdrop disappears immediately on close */
  transition: opacity 0.3s ease; /* Fast fade out */
}

.pill-info-modal.pill-info-closing .pill-info-bar {
  transform: translateY(100%); /* Bars slide down */
  opacity: 0.1; /* Bars become transparent */
}

.pill-info-backdrop { position:absolute; inset:0; z-index: 1; }

.pill-info-close {
  position: absolute; top: 24px; right: 24px;
  width: 48px; height: 48px; border-radius: 50%;
  border: none; cursor: pointer; color:#fff; font-size: 22px; line-height: 1;
  background: rgba(255,255,255,0.2); backdrop-filter: blur(10px);
  z-index: 4;
}
.pill-info-close:hover { background: rgba(255,255,255,0.3); }

/* Layout */
.pill-info-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6px 10px 60px; /* Increased bottom padding from 40px to 60px */
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  z-index: 3;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease 1.2s, transform 0.4s ease 1.2s; /* Opening transition */
  /* Hide scrollbar */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer 10+ */
}

/* Hide scrollbar for WebKit browsers */
.pill-info-shell::-webkit-scrollbar {
  display: none;
}

.pill-info-modal.pill-info-visible .pill-info-shell {
  opacity: 1;
  transform: translateY(0);
}

/* Content disappears immediately on close */
.pill-info-modal.pill-info-closing .pill-info-shell {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease; /* Fast disappear on close */
}
.pill-info-header { text-align: center; margin: 12px 0 28px; }
.pill-info-title {
  font-size: 32px; font-weight: 800; margin: 10px 0 0; letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--pill-info-bg-start), var(--pill-info-bg-end));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.pill-info-logo { max-width: 120px; height: auto; filter: invert(100%); }

.pill-info-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
@media (max-width: 860px){ .pill-info-grid-2 { grid-template-columns: 1fr; } }

.pill-info-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 40px; }
@media (max-width: 1000px){ .pill-info-grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px){ .pill-info-grid-3 { grid-template-columns: 1fr; } }

/* Cards */
.pill-info-card {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px; padding: 20px; backdrop-filter: blur(8px);
}
.pill-info-card-title { 
  font-size: 18px;
font-weight: 700;
margin: 0 0 12px;
color: #94c0ee;
text-align: left;
}
.pill-info-card .pill-info-muted { opacity: .9; font-size: 13px; color: rgba(255,255,255,0.8); text-align: center; }

/* Hyperlink styling for clickable text */
.pill-info-link {
  color: var(--pill-info-yellow);
  text-decoration: underline;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
}

.pill-info-link:hover,
.pill-info-link:focus {
  color: var(--pill-info-yellow-dark);
  text-decoration: none;
  text-shadow: 0 0 8px rgba(255, 227, 0, 0.4);
  outline: none;
}

.pill-info-link:focus {
  outline: 2px solid var(--pill-info-yellow);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Donation integration */
.pill-info-card--donation {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.pill-info-donation-content {
  flex: 1; /* Takes up available space, pushing footer to bottom */
}
.pill-info-donation-desc { text-align: center; color: rgba(255,255,255,0.8); font-size: 13px; margin: 12px 0 16px; }
.pill-info-cta-row { display: flex; flex-direction: column-reverse; gap: 8px; margin: 16px 0; }
.pill-info-cta { border: none; cursor: pointer; padding: 22px 16px; border-radius: 8px; font-weight: 600; font-size: 14px; transition: all 0.2s ease; }
.pill-info-cta.primary { background: #FFE300; color: #111; }
.pill-info-cta.primary:hover { background: #E6CC00; }
.pill-info-cta.secondary { background: rgba(255,255,255,0.15); color:#fff; }
.pill-info-cta.secondary:hover { background: rgba(255,255,255,0.2); }

/* Activity stream */
.pill-info-activity { max-height: 200px; overflow: auto; padding-right: 6px; margin: 16px 0; }
.pill-info-activity::-webkit-scrollbar { width: 4px; }
.pill-info-activity::-webkit-scrollbar-track { background: rgba(255,255,255,0.1); border-radius: 2px; }
.pill-info-activity::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 2px; }
.pill-info-activity-item { display:flex; align-items:center; gap:12px; padding:12px; background: rgba(255,255,255,0.05); border-radius:8px; margin-bottom:8px; border-left: 4px solid #FFE300; }
.pill-info-activity-avatar { width: 32px; height: 32px; border-radius: 50%; background: #FFE300; display:flex; align-items:center; justify-content:center; color:#111; font-weight:800; font-size: 14px; flex-shrink: 0; }
.pill-info-activity-text { font-size: 13px; line-height: 1.4; color: rgba(255,255,255,0.9); }
.pill-info-activity-text .donation-amount { color: rgba(255,255,255,0.9); font-weight: normal; }
.pill-info-activity-text .donation-location { color: rgba(255,255,255,0.9); }
.pill-info-activity-text .donation-date { color: rgba(255,255,255,0.6); font-size: 11px; }
.pill-info-stats { display:flex; gap:40px; justify-content:center; margin: 16px 0 20px; }
.pill-info-stat { text-align: center; }
.pill-info-stat .num { color: #FFE300; font-weight: 800; font-size: 24px; display:block; line-height: 1.1; }
.pill-info-stat .lbl { font-size: 11px; color: rgba(255,255,255,0.7); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }

/* Expandable info cards */
.pill-info-learn-label { text-align:center; font-style: italic; color: rgba(255,255,255,0.85); margin: 6px 0 10px; }
.pill-info-how-visuals { display:grid; grid-template-columns: repeat(2,1fr); gap:12px; justify-items:center; margin-bottom:10px; }
@media (max-width: 640px){ .pill-info-how-visuals { grid-template-columns: 1fr 1fr; } }
.pill-info-how-visuals--single { grid-template-columns: 1fr !important; }
.pill-info-how-visual { width: 100%; max-width: 160px; aspect-ratio: 1/1; border-radius: 9999px; background-size: cover; background-position: center; border:4px solid var(--pill-info-yellow); box-shadow: 0 2px 10px rgba(0,0,0,0.25); }
.pill-info-how-buttons { display:grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin: 6px 0; }
.pill-info-how-btn { background: rgba(255,255,255,0.92); color:#111; border:1px solid rgba(0,0,0,0.15); border-radius:8px; padding: 8px 10px; font-weight: 800; cursor:pointer; }
.pill-info-how-btn--full { grid-column: 1/-1; width: 100%; }

.pill-info-details { max-height: 0; overflow:hidden; opacity: 0; transition: max-height .3s ease, opacity .25s ease; }
.pill-info-card.pill-info-expanded .pill-info-details { opacity: 1; }

/* Remove list styling and format as paragraphs */
.pill-info-details ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pill-info-details li {
  margin-bottom: 12px;
  line-height: 1.5;
  color: rgba(255,255,255,0.9);
  text-align: left;
}

.pill-info-details li:last-child {
  margin-bottom: 0;
}

.pill-info-collapse { display:flex; justify-content:center; align-items:center; background: rgba(255,255,255,0.15); border:1px solid rgba(255,255,255,0.25); color:#fff; padding:8px 12px; border-radius:999px; cursor:pointer; font-weight:700; margin:10px auto 0; }



/* Optional: external trigger button style */
.info-pill-btn { width:auto; height:44px; padding:0 18px; border-radius: 9999px; font-size:14px; background: rgba(255,255,255,0.15); color:#fff; display:inline-flex; align-items:center; justify-content:center; border:1px solid rgba(255,255,255,0.2); }
.info-pill-btn:hover { background: rgba(255,255,255,0.25); }


/* Removed old list styling - now using paragraph formatting */
