/* Prevent horizontal overflow */
html, body {
  width: 100%;
  overflow-x: hidden;
  position: relative;
}

body {
  background-color: #082c41;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  overflow-x: hidden; /* Add this */
}

.transcript-group {
  scroll-margin-top: 2rem;
}

.summary-sidebar {
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}

/* Mobile screenshot layout styles */
@media (max-width: 768px) {
  .screenshot-container {
    padding-bottom: 0.5rem;
    min-height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
  }
  
  .screenshot-item {
    height: auto;
    margin: 0 0.25rem;
  }
}

#words {
  transition: opacity 0.3s ease-out;
}
.bmc-btn svg {
  height: 32px !important;
  margin-bottom: 0px !important;
  box-shadow: none !important;
  border: none !important;
  vertical-align: middle !important;
  transform: scale(0.9);
  flex-shrink: 0;
}

.scrollbar-hide {
  scrollbar-width: none; 
  -ms-overflow-style: none; 
}

.scrollbar-hide::-webkit-scrollbar {
  display: none; 
}

.heimdall-timeline {
  background-color: #f9fafb;
  border-radius: 4px;
  padding: 4px;
}

.heimdall-timeline .vis-item {
  border-color: #3b82f6;
  background-color: #dbeafe;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.heimdall-timeline .vis-item.vis-selected {
  border-color: #1d4ed8;
  background-color: #bfdbfe;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.heimdall-timeline .vis-time-axis .vis-text {
  font-size: 10px;
  color: #4b5563;
}
.bmc-btn {
  min-width: 210px;
  color: #ffffff;
  background-color: rgb(31, 41, 55) !important;
  height: 60px;
  border-radius: 12px;
  border: none;
  padding: 0px 24px;
  line-height: 27px;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center;
  font-family: 'Poppins', sans-serif !important;
  -webkit-box-sizing: border-box !important;
  box-sizing: border-box !important;
}

.bmc-btn:hover, .bmc-btn:active, .bmc-btn:focus {
  text-decoration: none !important;
  cursor: pointer;
}

.bmc-btn-text {
margin-left: 8px;
display: inline-block;
line-height: 0;
width: 100%;
flex-shrink: 0;
}

.logo-outline {
  fill: #ffffff;
}

.main-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #082c41;
}

.content-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.logo-coffee {
  fill: #601e62;
}

#word-tags span {
  color: white;
  cursor: default;
}

.sticky {
  position: sticky;
  top: 1rem;
}

.bg-clip-text {
  -webkit-background-clip: text;
  background-clip: text;
}
.hidden {
  display: none !important;
}
.spinner {
  position: fixed;
  left: 48%;
  top: 60%;
  width: 64px;
  height: 64px;
  display: none;
  z-index: 9999;
}

.dnd-book-spinner {
  animation: pageFlip 2s linear infinite;
  transform-origin: center;
}

.pixel-book-spinner {
  animation: pixelFlip 1.5s linear infinite;
  transform-origin: center;
}

#book {
  perspective: 500px; /* Crucial for 3D effect */
}

.page {
  transform-origin: left center; /* Rotate from the left edge */
  animation: flip 2s linear infinite; /* Adjust duration and timing */
  backface-visibility: hidden; /* Hide the back of the pages during rotation */
}

#page1 { animation-delay: 0s; }
#page2 { animation-delay: 0.2s; }
#page3 { animation-delay: 0.4s; }
/*More delays*/

@keyframes flip {
  0% { transform: rotateY(0deg); opacity:1;}
  50% { transform: rotateY(-90deg); opacity:0;}
  100%{transform: rotateY(-180deg); opacity:0;}
}


@keyframes pageFlip {
  0%   { transform: rotateY(0deg); }
  25%  { transform: rotateY(30deg); }
  50%  { transform: rotateY(60deg); }
  75%  { transform: rotateY(90deg); }
  100% { transform: rotateY(120deg); }
}

@keyframes pixelFlip {
  0%, 100% {
    transform: rotateY(0deg);
  }
  50% {
    transform: rotateY(180deg);
  }
}

/* Handle container widths */
.container {
  width: 100%;
  max-width: 100%;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

svg {
  max-width: 100%;
  height: auto;
}

.tooltip-container {
  position: relative;
  display: inline-block;
}

.tooltip {
  position: absolute;
  z-index: 10;
  max-width: calc(100vw - 2rem);
  width: max-content;
  left: 50%;
  transform: translateX(-50%);
  white-space: normal;
  word-wrap: break-word;
}

@keyframes bounce {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

.bounce {
  animation: bounce 0.5s ease-in-out;
}

.error-message {
  color: #ffd68b;
  font-size: 0.9rem;
  margin-top: -0.5rem;
  margin-bottom: 0.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.error-message.show {
  opacity: 1;
}

/* Ensure images and other content don't cause overflow */
img, svg, video {
  max-width: 100%;
  height: auto;
}

/* Add padding for notched displays */
main {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right); 
}

@media (max-width: 640px) {
  .tooltip {
    width: calc(100vw - 2rem);
    left: -100%;
  }
}

.loading-bar-container {
  position: relative;
  min-height: 24px;
}

.loading-square {
  transform-origin: center;
}