body {
  font-family: "Inter", sans-serif;
  background: linear-gradient(
    to right,
    #f3f4f6 0%,
    #ede9fe 20%,
    #ede9fe 80%,
    #f3f4f6 100%
  );
}
/* Animation Keyframes */
@keyframes wiggle-attention {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(-15deg) scale(1.3);
  }
  50% {
    transform: rotate(15deg) scale(1.3);
  }
  75% {
    transform: rotate(-15deg) scale(1.3);
  }
}

/* Class added by JS only on first visit */
.wiggle-effect {
  display: inline-block;
  transform-origin: bottom center;
  animation: wiggle-attention 1.2s ease-in-out;
  animation-delay: 1s;
  animation-iteration-count: 3;
}
.line-break {
  height: 1px;
  width: 100%;
}
.topic-button {
  background-color: #a855f7;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  width: 100%;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  padding-right: 3rem;
}
.topic-button:hover {
  background-color: #9333ea;
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}
.topic-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.info-link {
  color: #6b46c1;
  font-weight: 600;
  text-decoration: none;
  transition:
    color 0.2s ease-in-out,
    text-decoration 0.2s ease-in-out;
}

.info-link:hover {
  color: #805ad5;
  text-decoration: underline;
}
.info-link i {
  margin-right: 0.5rem;
}

.action-button {
  background: linear-gradient(to right, #1a1a1a, #4a4a4a);
  color: white;
  font-weight: bold;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 1.125rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  width: 100%;
  transition: all 0.2s ease-in-out;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  padding-right: 3rem;
}
.action-button:hover {
  background: linear-gradient(to right, #000000, #333333);
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}
.action-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* IMPROVEMENT #4: Modal Background Blur */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Lighter alpha to compensate for blur intensity */
  background-color: rgba(0, 0, 0, 0.4);
  /* Blur effect */
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5000;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease-in-out,
    visibility 0.3s ease-in-out;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: white;
  padding: 2rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width: 300px;
  width: 90%;
  transform: translateY(-20px);
  transition: transform 0.3s ease-in-out;
}

.modal-overlay.show .modal-content {
  transform: translateY(0);
}

.modal-button {
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}
.modal-button.cancel {
  background-color: #e2e8f0;
  color: #4a5568;
}
.modal-button.cancel:hover {
  background-color: #cbd5e0;
}

.social-icons a {
  color: #a855f7;
  font-size: 1.8rem;
  transition:
    color 0.2s ease-in-out,
    transform 0.2s ease-in-out;
}
.social-icons a:hover {
  color: #9333ea;
  transform: scale(1.1);
}

.live-discussion-style {
  background: linear-gradient(to right, #10b981, #06b6d4);
  color: white;
  padding: 1rem 1.5rem;
  margin-top: 0.15rem;
  border-radius: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  width: 100%;
  text-align: left;
  display: block;
}
.live-discussion-style:hover {
  background: linear-gradient(to right, #059669, #0891b2);
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}
.live-discussion-style:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* REFINED SKELETON LOADER */
.skeleton-loader {
  background-color: #f9fafb; /* Light grey base */
  border: 1px solid #e5e7eb; /* Subtle border to match real buttons */
  border-radius: 0.5rem;
  width: 100%;
  height: 4.5rem;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden; /* Confine the shimmer */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem; /* Match button padding */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* The "Text" Line Placeholder */
.skeleton-text {
  height: 1rem;
  width: 60%; /* Simulate random text width */
  background-color: #e5e7eb;
  border-radius: 0.25rem;
}

/* The "Icon" Circle Placeholder */
.skeleton-icon {
  height: 1.25rem;
  width: 1.25rem;
  background-color: #e5e7eb;
  border-radius: 50%;
}

/* The Shimmer Animation Overlay */
.skeleton-loader::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0,
    rgba(255, 255, 255, 0.5) 20%,
    /* Stronger white highlight */ rgba(255, 255, 255, 0.8) 60%,
    rgba(255, 255, 255, 0)
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Keep legacy spinner class just in case, but unused for main list */
.loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #a855f7;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

#spotlight-section {
  background-color: #fdf2f8;
  border-left: 5px solid #ec4899;
  padding: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  text-align: center;
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    padding 0.3s ease-in-out; /* <-- This is the new part */
}

/* When toggled to Question Mode */
#spotlight-section.mode-question {
  background-color: #f0fdfa; /* Light Teal */
  border-left-color: #14b8a6; /* Teal */
}

/* When toggled to Quote Mode */
#spotlight-section.mode-quote {
  background-color: #f5f3ff; /* Light Purple */
  border-left-color: #a855f7; /* Purple */
}

#spotlight-display {
  font-size: 1rem;
  color: #374151;
  margin-bottom: 0.68rem;
  transition: opacity 0.3s ease-in-out; /* Lengthened and smoothed */
}

#spotlight-section.mode-quote #spotlight-display {
  font-style: italic;
}

#spotlight-author {
  font-size: 0.85rem;
  color: #6b7280;
  opacity: 0.9;
  font-weight: 600;
  font-size: smaller;
  transition: opacity 0.3s ease-in-out; /* Added transition to author */
}

/* Add this to your <style> block */
#spotlight-collapsible-content {
  transition: all 0.3s ease-in-out;
  overflow: hidden;
  max-height: 200px; /* Arbitrary max-height larger than content */
  opacity: 1;
}

#spotlight-section.collapsed #spotlight-collapsible-content {
  max-height: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

#spotlight-section.collapsed {
  padding-bottom: 0.75rem; /* Shrink the bottom padding when collapsed */
}

#spotlight-section.collapsed #spotlight-toggle-icon {
  transform: rotate(180deg); /* Flips the chevron down */
}

/* --- SPOTLIGHT HEADER TRANSITIONS --- */
#spotlight-collapsed-title {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
}

#spotlight-controls {
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}

/* Swap visibilities when the parent is collapsed */
#spotlight-section.collapsed #spotlight-collapsed-title {
  opacity: 1;
}

#spotlight-section.collapsed #spotlight-controls {
  opacity: 0;
  pointer-events: none;
}

.fade-out-streak {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.5s ease-in-out !important;
}

#quote-display {
  font-size: 1rem;
  font-style: italic;
  color: #374151;
  margin-bottom: 0.5rem;
}

#quote-author {
  font-size: 0.85rem;
  color: #6b7280;
  font-weight: 600;
}

.star-icon {
  font-size: 1.17rem;
  color: white;
  cursor: pointer;
  transition: color 0.2s ease-in-out;
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
}

.star-icon.fa-solid {
  color: #ffd700;
}
.star-icon:hover {
  color: #ffea00;
}

#add-to-homescreen-btn {
  position: fixed;
  bottom: 1.1rem;
  right: 1.1rem;
  z-index: 3000;
  background: #fff;
  color: #9333ea;
  font-size: 1.02rem;
  font-weight: 600;
  border: 2px solid #a855f7;
  border-radius: 1.6rem;
  padding: 0.66rem 1.08rem;
  box-shadow: 0 6px 24px rgba(80, 30, 120, 0.08);
  cursor: pointer;
  display: none;
  transition:
    background 0.2s,
    color 0.2s;
}

#add-to-homescreen-btn.show {
  display: block;
}

#add-to-homescreen-btn:hover {
  background: #f3e8ff;
  color: #7c3aed;
}

#ios-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.44);
  display: none;
  z-index: 4000;
  justify-content: center;
  align-items: center;
}
#ios-modal-overlay.show {
  display: flex;
}
#ios-modal-content {
  background: white;
  border-radius: 1.2rem;
  box-shadow: 0 8px 32px rgba(50, 0, 80, 0.19);
  padding: 2rem 1.2rem 1.5rem 1.2rem;
  max-width: 350px;
  width: 90vw;
  text-align: center;
}
#ios-modal-content img {
  width: 38px;
  margin: 0.5rem 0 0.8rem 0;
}
#ios-modal-content .close-modal {
  background: #e5e7eb;
  color: #555;
  border: none;
  border-radius: 9999px;
  padding: 0.4rem 1.1rem;
  font-size: 1rem;
  margin-top: 1.2rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}
#ios-modal-content .close-modal:hover {
  background: #c7d2fe;
}

@media (max-width: 600px) {
  #add-to-homescreen-btn {
    padding: 0.55rem 0.9rem;
    font-size: 0.96rem;
    border-radius: 1.35rem;
  }
}

[data-injected-starred-action="1"] {
  margin-bottom: 1rem;
}
#topics-list {
  margin-top: 0;
}

#topics-list.has-starred-actions-above {
  margin-top: 1rem;
}

/* CSS to hide topics when list is collapsed, EXCEPT All-in-One */
#topics-list.collapsed .topic-button:not([data-all-in-one="true"]) {
  display: none !important;
}

#getting-started-modal .getting-started-list a {
  color: #0000ee !important;
  font-weight: normal !important;
  background: none !important;
  border: none !important;
  text-decoration: none !important;
  cursor: pointer;
}
#getting-started-modal .getting-started-list a:hover,
#getting-started-modal .getting-started-list a:focus {
  color: #551a8b !important;
  text-decoration: underline !important;
  outline: none;
}
#getting-started-modal .getting-started-list a:active {
  color: #551a8b !important;
}

/* --- STICKY TOOLBAR STYLES (IMPROVEMENT #6) --- */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 3200;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  /* border-bottom: 1px solid #e5e7eb; */

  margin-left: -2rem;
  margin-right: -2rem;

  /* Increased padding for better spacing */
  padding: 1.25rem 2rem;

  display: flex;
  flex-direction: column;
  gap: 0.75rem;

  /* Transition for the shadow logic */
  transition:
    box-shadow 0.3s ease,
    background-color 0.3s ease,
    padding 0.3s ease;
}

/* Stronger shadow state when scrolled */
.toolbar.scrolled {
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.98); /* Slightly less transparent */
  border-bottom-color: rgba(0, 0, 0, 0.05); /* Softer border */
}

.pill {
  border: 1px solid #d1d5db;
  background-color: #ffffff;
  color: #4b5563;
  font-weight: 600;
  border-radius: 9999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.9rem;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.pill:hover {
  background-color: #f3f4f6;
}
.pill.active {
  background-color: #8b5cf6;
  color: #ffffff;
  border-color: #8b5cf6;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.pill.muted {
  background-color: #f3f4f6;
  color: #374151;
  border-color: #e5e7eb;
}
.pill.muted:hover {
  background-color: #e5e7eb;
}

.hidden-content-placeholder {
  padding: 1rem;
  text-align: center;
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  border-radius: 0.5rem;
  color: #6b7280;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 1rem;
}
.hidden-content-placeholder:hover {
  background: #f3f4f6;
  color: #4b5563;
}

#search-bar {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
#search-bar:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

#share-link-modal .modal-buttons {
  flex-direction: column;
  gap: 0.75rem;
}
#share-from-modal-btn {
  background: linear-gradient(135deg, #a855f7, #ec4899);
  color: white;
}
#share-from-modal-btn:hover {
  background-color: #9333ea;
}

.badge-new {
  background-color: #6b46c1;
  color: white;
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 99px;
  margin-left: 8px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  vertical-align: middle;
  display: inline-block;
}

.modal-button:hover .badge-new {
  background-color: #4c1d95;
}

/* NEW: Floating Join Session Button */
#floating-join {
  position: fixed;
  bottom: 148px; /* dice bottom (80) + dice height (56) + 12px gap */
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  background: linear-gradient(
    135deg,
    #3b82f6,
    #10b981
  ); /* blue to green */
  color: #ffffff;
  display: flex; /* Visible by default on index page */
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  z-index: 3500; /* Match Dice z-index */
  transition:
    transform 0.15s ease-in-out,
    box-shadow 0.2s ease-in-out,
    filter 0.2s;
  display: none !important; /* <--- ADD !important HERE */
}
#floating-join i {
  font-size: 1.17rem;
}
#floating-join:hover,
#floating-join:focus {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.2);
  outline: none;
  filter: brightness(1.05);
}
#floating-join:active {
  transform: translateY(0) scale(0.98);
}

/* Mobile adjustments */
@media (max-width: 480px) {
  #floating-join {
    width: 52px;
    height: 52px;
    right: 16px;
    bottom: 140px; /* mobile dice bottom (76) + height (52) + 12px gap */
  }
  #floating-join i {
    font-size: 1.15rem;
  }
}
#join-live-room-primary-container > .live-discussion-style {
  margin-bottom: 0.75rem;
}
/* UPDATED: Removed color/text-decoration from ID to let classes rule */
#inline-share-trigger {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  /* Font styles inherited from class */
}

/* --- Facilitator/PRO Lock UI & Modal --- */
.locked-feature {
  opacity: 0.85;
  filter: grayscale(0.5);
  position: relative;
}
.locked-feature::after {
  content: "\f023";
  font-family:
    "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome";
  font-weight: 900;
  position: absolute;
  top: -6px;
  right: -6px;
  background: #fbbf24;
  color: white;
  width: 22px;
  height: 22px;
  font-size: 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

#spotlight-section.collapsed #spotlight-collapsible-content button {
  pointer-events: none !important;
}
.shake {
  animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-5px);
  }
  40%,
  80% {
    transform: translateX(5px);
  }
}
/* --- Tap-to-Focus (Zen Mode) Styles --- */

/* 1. Tell the header how to transition its size smoothly */
#spotlight-header {
  transition:
    opacity 0.3s ease-in-out,
    max-height 0.3s ease-in-out,
    margin-bottom 0.3s ease-in-out;
  max-height: 2rem; /* Matches the h-6 Tailwind class */
}

/* 2. When Zen Mode is active, shrink the header layout */
#spotlight-section.zen-mode #spotlight-header {
  pointer-events: none !important;
  max-height: 0 !important;
  margin-bottom: 0.5rem !important;
  /* We removed opacity:0 and overflow:hidden here so the absolute badge survives */
}

/* 2.5 explicitly hide the text/icons inside the header, EXCEPT the streak badge */
#spotlight-section.zen-mode #spotlight-collapsed-title,
#spotlight-section.zen-mode #spotlight-controls,
#spotlight-section.zen-mode #spotlight-toggle-icon {
  opacity: 0 !important;
}

/* 3. Hide the absolute bottom buttons (they don't take up layout space anyway) */
#spotlight-section.zen-mode
  #spotlight-collapsible-content
  .absolute.bottom-1 {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* 4. The interactive text container */
#spotlight-collapsible-content > .min-h-\[3\.5rem\] {
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
}

/* 5. The subtle zoom effect on the text */
#spotlight-section.zen-mode
  #spotlight-collapsible-content
  > .min-h-\[3\.5rem\] {
  transform: scale(1.04);
}

/* 6. Hide the floating countdown timer */
#spotlight-section.zen-mode #daily-countdown {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* 7. Float the streak badge in the white space above the Daily Spark box permanently */
#spotlight-section #streak-badge {
  top: -43px;
  left: 5px; /* Aligns it nicely near the left edge */
  margin: 0; /* Clears any other margins */
}
