/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #f5f5f5;
  padding: 0;
  margin: 0;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Device Container - Only visible in development */
@media (min-width: 500px) {
  body {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
  }
  
  .phone-container {
    width: 360px;
    height: 720px;
    background-color: #fff;
    border-radius: 40px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 10px solid #333;
  }
}

/* For mobile devices */
@media (max-width: 499px) {
  .phone-container {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
  }
}

/* Screen Transitions */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: white;
  overflow: hidden;
  transition: transform 0.5s ease;
  transform: translateX(100%);
  padding-top: 50px;
}

.screen.active {
  transform: translateX(0);
  z-index: 10;
}

/* Header Styling */
.header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background-color: #fff;
  display: flex;
  align-items: center;
  padding: 0 15px;
  border-bottom: 1px solid #f0f0f0;
  z-index: 20;
}

.header-title {
  font-size: 18px;
  font-weight: 500;
  color: #333;
  flex: 1;
  text-align: center;
  position: absolute;
  width: 100%;
  left: 0;
  z-index: -1;
}

.back-button {
  font-size: 24px;
  color: #333;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 10px;
}

/* Onboarding Screen */
.onboarding-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
}

.onboarding-slider {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 20px;
}

.onboarding-image {
  width: 200px;
  height: 200px;
  margin-bottom: 40px;
  background-color: #f8f8f8;
  border-radius: 20px;
  overflow: hidden;
}

.onboarding-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.onboarding-title {
  font-size: 22px;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}

.onboarding-text {
  font-size: 16px;
  color: #666;
  line-height: 1.5;
}

.pagination {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background-color: #e0e0e0;
  margin: 0 4px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.dot.active {
  width: 24px;
  background-color: #BA9E66;
}

.button {
  background-color: #BA9E66;
  color: white;
  border: none;
  padding: 16px 0;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  transition: background-color 0.3s ease;
}

.button:hover {
  background-color: #A88E56;
}

/* Tour List Screen */
.tour-list-container {
  height: 100%;
  padding: 20px;
  padding-bottom: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.header-text {
  font-size: 18px;
  color: #666;
  margin-bottom: 30px;
}

.stop-item {
  display: flex;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}

.stop-item:active {
  background-color: #f9f9f9;
}

.stop-number {
  width: 36px;
  height: 36px;
  border-radius: 18px;
  background-color: #BA9E66;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 16px;
  font-size: 14px;
  font-weight: 600;
  color: white;
}

.stop-info {
  flex: 1;
}

.stop-title {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  margin-bottom: 4px;
}

.chevron {
  font-size: 20px;
  color: #ccc;
  padding: 0 10px;
}

/* Stop Detail Screen */
.stop-detail-container {
  height: 100%;
  padding: 20px;
  padding-bottom: 70px; /* Add extra padding to account for fixed navigation */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.slideshow {
  height: 250px;
  background-color: #f8f8f8;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.slide-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer; /* Add cursor pointer to indicate it's clickable */
}

.slide-image:hover {
  opacity: 0.95; /* Subtle hover effect */
}

/* Enhance slideshow arrows */
.slide-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.7);
  color: #333;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: background-color 0.2s ease;
}

.slide-arrow:hover {
  background-color: rgba(255, 255, 255, 0.9);
}

.slide-arrow.left {
  left: 10px;
}

.slide-arrow.right {
  right: 10px;
}

.audio-player {
  display: flex;
  align-items: center;
  margin: 24px 0;
  background-color: #f8f8f8;
  border-radius: 12px;
  padding: 16px;
}

.play-button {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  background-color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.play-button:active {
  background-color: #f5f5f5;
}

.progress-bar {
  flex: 1;
  height: 4px;
  background-color: #e0e0e0;
  border-radius: 2px;
  margin-right: 12px;
  position: relative;
  cursor: pointer; /* Add cursor pointer to indicate it's clickable */
}

.progress-bar:hover {
  height: 6px; /* Slightly enlarge on hover for better UX */
  margin-top: -1px;
  margin-bottom: -1px;
}

.progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background-color: #BA9E66;
  border-radius: 2px;
  transition: width 0.1s linear;
}

.duration {
  font-size: 14px;
  color: #666;
}

.learn-more-container {
  margin-bottom: 30px;
  border-top: 1px solid #f0f0f0;
  padding-top: 20px;
}

.learn-more-container h3 {
  font-size: 18px;
  font-weight: 500;
  color: #333;
  margin-bottom: 16px;
}

.info-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}

.info-item:active {
  background-color: #f9f9f9;
}

.info-icon {
  width: 32px;
  height: 32px;
  border-radius: 16px;
  background-color: #f5f5f5;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 16px;
  font-size: 14px;
  color: #BA9E66;
}

.info-title {
  font-size: 16px;
  font-weight: 400;
  color: #333;
}

.navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: white;
  padding: 12px 20px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 30;
}

.nav-button {
  display: flex;
  align-items: center;
  color: #333;
  font-size: 16px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 20px;
}

.nav-button:active {
  background-color: #f5f5f5;
}

.nav-button.disabled {
  color: #ccc;
  cursor: default;
}

.nav-button.disabled:active {
  background-color: transparent;
}

.stop-indicator {
  padding: 6px 12px;
  background-color: #f5f5f5;
  border-radius: 16px;
  font-size: 14px;
  color: #666;
}

/* Offline notification */
.offline-notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: white;
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.offline-notification.visible {
  opacity: 1;
}

/* Install prompt */
.install-prompt {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #f8f8f8;
  padding: 16px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 50;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.install-prompt.visible {
  transform: translateY(0);
}

.install-text {
  flex: 1;
  font-size: 14px;
  color: #333;
  margin-right: 12px;
}

.install-button {
  background-color: #BA9E66;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.close-install {
  background: none;
  border: none;
  color: #999;
  font-size: 20px;
  padding: 0 10px;
  cursor: pointer;
}

/* Animation for screen transitions */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

/* Fullscreen Image Viewer */
.fullscreen-viewer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.fullscreen-viewer.active {
  opacity: 1;
  visibility: visible;
}

.fullscreen-image-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
}

.fullscreen-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 30px;
  cursor: pointer;
  z-index: 1001;
  transition: background-color 0.2s ease;
}

.fullscreen-close:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

/* Add styles for zoomable image */
#fullscreen-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  transform-origin: center;
  transition: transform 0.2s ease;
  touch-action: none; /* Disable browser's default touch actions */
}

/* Error notification */
.error-notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(204, 51, 51, 0.9);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  min-width: 200px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.error-notification.visible {
  opacity: 1;
  pointer-events: auto;
}

.error-notification #error-message {
  flex: 1;
  margin-right: 10px;
}

.error-notification #error-close {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 0 0 0 10px;
}

.error-notification .error-confirm {
  background-color: white;
  color: #333;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  margin-left: 10px;
}

/* Loading styles */
.loading-indicator {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-size: 16px;
}

.loading-indicator::after {
  content: "...";
  animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
  0% { content: "."; }
  33% { content: ".."; }
  66% { content: "..."; }
}

.error-message {
  background-color: #fff1f0;
  border: 1px solid #f5c6cb;
  color: #721c24;
  padding: 15px;
  border-radius: 6px;
  margin: 20px 0;
  text-align: center;
}

/* Loading image animation */
.slide-image.loading {
  opacity: 0.7;
  animation: image-loading 1s infinite alternate;
}

@keyframes image-loading {
  from { opacity: 0.7; }
  to { opacity: 0.4; }
}