/* Reset */
* {
  box-sizing: border-box;
}

/* SEO and Accessibility */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body, html {
  margin: 0;
  padding: 0;
  height: 100vh;
  width: 100vw;
  color: #ffffffd7;
  font-family: "Helvetica Neue";
  background-image: url(assets/concrete5.jpg);
  background-size: cover;
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-position: center;
}

main {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  position: relative;
}

.gl {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 1;
}

canvas {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 5; /* Higher z-index to ensure ripples are visible over background */
  opacity: 1;
  margin: 0 !important;
  padding: 0 !important;
  /* Performance optimizations */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  will-change: transform;
  transform: translateZ(0); /* Force hardware acceleration */
  backface-visibility: hidden;
  perspective: 1000px;
  /* Reduce repaints */
  contain: layout style paint;
}
.mobile {
  display: none;
}
.modern {
  padding-bottom: 0px;
}

.desktop {
  display: inline;
}
a {
  color: inherit;
  text-decoration: none;
  z-index: 10;
}
a:hover {
  opacity: 0.8;
}

/* Header */
.top-row {
  margin-top: 1rem;
  margin-left: 1rem;
  margin-right: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center; /* Center align logo with BOOK text */
  position: relative;
  z-index: 25;
  pointer-events: auto;
}

.top-row img {
  height: 3.5vh;
  min-height: 24px; /* Ensure minimum visibility */
}
.book1 {
  padding-right: 10px;
  font-weight: light;
  transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  cursor: pointer;
}

.book1:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

.book1.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* === FOOTER LOGO BOTTOM LEFT === */
.footer {
  pointer-events: auto;
  position: fixed;
  bottom: 0.5rem; /* Close to bottom, matching header distance from top */
  left: 1rem;
  z-index: 25;
}
.footer img {
  height: 5vh;
  min-height: 32px; /* Ensure minimum visibility */
  transition: all 0.3s ease;
}



/* === TOGGLE BUTTON BOTTOM RIGHT === */
.toggle-btn {
  position: fixed;
  bottom: 0.5rem; /* Close to bottom, matching header distance from top */
  right: 1rem;
  font-size: 2.5rem;
  font-weight: lighter;
  color: #fff;
  cursor: pointer;
  z-index: 300; /* Higher than modal (200) to ensure it's always clickable */
  pointer-events: auto;
  transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
.toggle-btn:hover {
  transform: scale(1.1);
  opacity: 0.8;
}
.toggle-btn:active {
  transform: scale(0.95);
}

/* === INFO PANEL === */
.info-panel {
  color: white;
  position: absolute;
  bottom: 2rem;
  right: 3rem;
  display: none;
  flex-direction: column;
  max-width: 600px;
  font-size: 1rem;
  pointer-events: auto;
  z-index: 19;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.info-panel.visible {
  opacity: 1;
  display: flex;
}

.definition {
  margin-bottom: 1.2rem;
  font-weight: normal;
  line-height: 1.4;
  color: #ffffffd7;
  font-size: 1rem;
}

.phonetic {
  font-style: italic;
  opacity: 1;
  font-size: 1rem;
  color: #ffffffd7;
  font-weight: normal;
}

em {
  color: #ffffffd7;
  opacity: 1;
  font-weight: normal;
  font-size: 1rem;
}

.modern p, .lead  {
  margin-bottom: 0rem;
  font-weight: normal; /* Same as definition and circuit */
  color: #ffffffd7;
  font-size: 1rem;
  opacity: 1;
}

.circuit-title {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: normal; /* Same as all info panel text */
  letter-spacing: 0.1em;
  font-size: 1rem;
  opacity: 1;
  color: #ffffffd7;
}

.circuit ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.circuit li {
  margin-bottom: 4px;
  color: #ffffffd7;
  font-weight: normal;
  font-size: 1rem;
  opacity: 1;
}



.modal {
  display: none;
  position: fixed;
  z-index: 200;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  overflow: auto;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.modal.show {
  opacity: 1;
}

/* === MODAL CONTENT === */
.modal-content {
  position: relative;
  margin: auto;
  font-family: "Helvetica Neue";
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  padding: 2rem 1rem 1rem 1rem; /* More top padding for close button */
  overflow: auto;
  display: flex;
  flex-direction: column;
  color: #ffffffd7;
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

/* Modal title alignment */
.modal-content h2 {
  margin: 0 0 1.5rem 0;
  padding: 0;
  font-size: 1.2rem;
  font-weight: 200;
  color: #fff;
  text-align: left;
}

.appointments-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0; /* Remove top margin to align with title */
  padding-left: 0; 
  font-weight: 300;

}

.appointment {
  background: #1a1a1a0b;
  padding-top: 1rem;
  padding-bottom: 1rem;
font-weight: 400;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "Helvetica Neue", sans-serif;
  gap: 1rem; /* Better spacing between text and button */
  position: relative; /* For button alignment */
}

.appointment button {
  background: transparent; /* See-through background */
  color: #fff;
  border: 1px solid transparent; /* Transparent border initially */
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 400;
  text-transform: uppercase; /* Make button text uppercase */
  transition: all 0.3s ease; /* Smooth transition */
  white-space: nowrap; /* Prevent button text wrapping */
  min-width: 80px; /* Ensure consistent button width */
  margin-left: auto; /* Align to the right */
}

.appointment button:hover {
  background: rgba(255, 255, 255, 0.1); /* Subtle white background on hover */
  border: 1px solid #fff; /* White border on hover */
  color: #fff;
}




/* Make modal headings and text normal weight */
.modal h2 {
  font-weight: normal;
}

.appointment h3 {
  font-weight: normal;
}

/* Close button */
.close-btn {
  position: absolute;
  top: 2rem; /* Align with title */
  right: 1rem; /* Match modal padding */
  font-size: 1.5rem;
  font-weight: 300; /* Thinner stroke */
  color: #fff;
  cursor: pointer;
  transition: 0.3s ease;
  line-height: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
}
.close-btn:hover {
  color: #ccc;
}

/* Iframe styling */
.modal-content iframe {
  width: 100%;
  height: 100vh;
  border: none;
  border-radius: 8px;
  background: #fff;
  overflow: scroll;
}


/* === RESPONSIVE === */
@media (max-width: 768px) {

  body {
    overflow: hidden;
    background-image: url(assets/concrete5copy.jpg);
    /* Mobile performance optimizations */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  /* Enhanced mobile canvas performance */
  canvas {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: pixelated;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
    /* Ensure canvas covers full screen on mobile */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 5 !important; /* Higher z-index to ensure ripples are visible over background */
    /* Force hardware acceleration */
    -webkit-transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    -webkit-perspective: 1000px;
  }
  
  /* Fallback shimmer effect for mobile when ripples fail */
  body.no-webgl::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, rgba(255,255,255,0.03) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.03) 50%, rgba(255,255,255,0.03) 75%, transparent 75%, transparent);
    background-size: 40px 40px;
    animation: shimmer 8s linear infinite;
    z-index: 2;
    pointer-events: none;
  }
  
  @keyframes shimmer {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
  }
  

  

  .mobile {
    display: inline;
  }
.desktop {
  display: none;
}
  .modern p{
    margin-bottom: 0px;
  }
  .top-row {
    margin-top: 1rem;
    margin-left: 1rem;
    margin-right: 1rem;
    z-index: 30;
    align-items: center; /* Ensure logo and BOOK are aligned */
  }
  
  .top-row img {
    height: 4.5vh;
    min-height: 28px;
  }



  .definition {
    margin-bottom: 1.4rem;
  } 

.phonetic {
color: white;}
  .info-panel {
    padding: 0.5vh;
    line-height: 1.2rem;
    max-height: 70vh; /* Don't take full height */
    max-width: 95vw;
    font-size: 1rem;
    right: 0.5rem;
    left: 0.5rem;
    position: fixed;
    bottom: 15%; /* Higher up to not cover footer */
    overflow-y: auto; /* Allow scrolling */
  }

  
  .footer img {
    height: 6.5vh;
    min-height: 40px; /* Larger minimum for better visibility */
  }

  .toggle-btn {
    font-size: 3.8rem;
    right: 0.5rem !important;
    bottom: 0.5rem !important;
    z-index: 300 !important; /* Higher than modal (200) to ensure it's always clickable */
  }

  .footer,
  .toggle-btn {
    position: fixed !important;
    bottom: 0.5rem !important; /* Very close to bottom, matching header distance from top */
    z-index: 300 !important; /* Higher than modal (200) to ensure it's always clickable */
  }

  .footer {
    left: 1rem !important;
  }

  .toggle-btn {
    right: 1rem !important;
  }

  .book1 {
    margin-bottom:0.5vh;
    font-weight: 400;
    font-size: 1.2rem;
  }

  .book1 {
    margin-bottom: 0vh;
    font-weight: 400;
    font-size: 1.2rem;
    padding-right: 0.5rem;
  }

  .circuit li {
    line-height: 1.1rem;
  }
}

@media (orientation: landscape) and (max-height: 700px) {
  .info-panel {
    max-height: 60vh;
    overflow-y: hidden;
  }
}

/* iPhone 13 Pro and general mobile adjustments */
@media only screen and (max-width: 768px) {

  .info-panel {
    margin-left: 0.5rem;
  }

  .book1 {
    margin-bottom:0vh;
  }

  
  .footer img {
    min-height: 50px !important; /* Larger for mobile visibility */
    height: 50px !important;
  }
  
  .toggle-btn {
    bottom: 0.5rem !important; /* Close to bottom, matching header distance from top */
    right: 1rem !important;
    z-index: 300 !important; /* Higher than modal (200) to ensure it's always clickable */
  }
  
  .footer {
    bottom: 0.5rem !important; /* Close to bottom, matching header distance from top */
    left: 1rem !important;
  }
}