/* Base Styles */
:root {
  --background-color: #FFFFFF;
  --text-color: #333333;
  --accent-color: #EEEEEE;
  --overlay-background: rgba(255, 255, 255, 0.8);
  --transition-speed: 0.3s;
  --grid-gap: 2rem;
  --content-max-width: 1200px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-color);
  background-color: var(--background-color);
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  /* Ensure a background color is set for semi-transparency */
  background-color: #ffffff; /* White background */
}

.app {
  min-height: 100%;
  width: 100%;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 300;
  margin-bottom: 1rem;
}

a {
  color: var(--text-color);
  text-decoration: none;
  transition: opacity var(--transition-speed);
}

a:hover {
  opacity: 0.8;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Landing Page */
.landing {
  padding: 2rem;
  max-width: var(--content-max-width);
  margin: 0 auto;
  text-align: center;
}

.landing h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.landing .subtitle {
  font-size: 1.2rem;
  margin-bottom: 3rem;
  opacity: 0.8;
}

/* Hero Grid Layout (CSS Grid - potentially conflicting, keep for now but be aware) */
.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: var(--grid-gap);
  margin-top: 2rem;
}

/* Hero Item (CSS Grid - potentially conflicting, keep for now but be aware) */
.hero-item {
  position: relative; /* Keep relative for info overlay */
  overflow: hidden;
  border-radius: 4px;
  transition: transform var(--transition-speed);
  cursor: pointer;
}

.hero-item:hover {
  transform: scale(1.02);
}

/* Hero Image (CSS Grid - potentially conflicting) */
.hero-image {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Hero Info Overlay (CSS Grid - potentially conflicting) */
.hero-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  background: var(--overlay-background);
  transform: translateY(100%);
  transition: transform var(--transition-speed);
}

.hero-item:hover .hero-info {
  transform: translateY(0);
}

.hero-info h2 {
  margin-bottom: 0.5rem;
}

.hero-info p {
  opacity: 0.8;
}

/* Theme Page */
.theme-page {
  padding: 2rem;
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.theme-header {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.back-link {
  position: absolute;
  left: 0;
  top: 0.5rem;
  font-size: 1.5rem;
  opacity: 0.6;
  transition: opacity var(--transition-speed);
}

.back-link:hover {
  opacity: 1;
}

/* Photo Grid Layout (CSS Grid - potentially conflicting, keep for now but be aware) */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--grid-gap);
  margin-bottom: 3rem;
}

/* Photo Item (CSS Grid - potentially conflicting, keep for now but be aware) */
.photo-item {
  position: relative; /* Keep relative for info overlay */
  overflow: hidden;
  border-radius: 4px;
  transition: transform var(--transition-speed);
  cursor: pointer;
}

.photo-item:hover {
  transform: scale(1.02);
}

/* Photo Thumbnail (CSS Grid - potentially conflicting) */
.photo-thumbnail {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* Photo Info Overlay (CSS Grid - potentially conflicting) */
.photo-info {
  position: absolute;
  bottom: 5px; /* Adjust for border */
  left: 5px; /* Adjust for border */
  right: 5px; /* Adjust for border */
  background: rgba(46, 46, 46, 0.8); /* 18% grey with 80% opacity */
  color: white;
  padding: 1.5rem;
  transform: translateY(100%);
  transition: transform var(--transition-speed);
}

.metadata-overlay.visible {
  transform: translateY(0);
}

.related-themes {
  margin-top: 3rem;
  text-align: center;
}

.theme-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.theme-link {
  padding: 0.5rem 1rem;
  background-color: var(--accent-color);
  border-radius: 20px;
  transition: background-color var(--transition-speed);
}

.theme-link:hover {
  background-color: #DDDDDD;
}

/* Photo Viewer / Detail View */
.photo-viewer {
  position: fixed !important; /* Position fixed to cover the entire viewport */
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important; /* Remove any default margin */
  padding: 0 !important; /* Remove any default padding */
  background-color: rgba(0, 0, 0, 0.8); /* Semi-transparent black background (more transparent) */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999 !important; /* Increase z-index to be absolutely sure it's on top */
  overflow: hidden; /* Hide overflow during transitions */
  
  /* Add animation for appearing */
  animation: fadeIn 0.8s ease-in-out forwards;
}

/* Animation for fading in */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.photo-container {
  position: relative; /* Needed for absolute positioning of nav indicators and metadata */
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-full {
  display: block; /* Ensure image is a block element */
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* Contain the image within the container */
  margin: auto; /* Center the image */
  
  /* Add animation for image loading */
  animation: imageAppear 0.6s ease-in-out;
}

/* Animation for image appearing */
@keyframes imageAppear {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Add a subtle pulse animation when src changes */
.photo-full:not([src=""]) {
  animation: imagePulse 0.6s ease-in-out;
}

/* Animation for image changing */
@keyframes imagePulse {
  0% { opacity: 0.8; }
  50% { opacity: 0.95; }
  100% { opacity: 1; }
}

.nav-indicator {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem; /* Larger indicators */
  color: rgba(255, 255, 255, 0.5); /* Semi-transparent white */
  cursor: pointer;
  padding: 1rem;
  z-index: 10; /* Above the image */
  transition: color 0.6s ease-in-out, transform 0.6s ease-in-out;
}

.nav-indicator:hover {
  color: rgba(255, 255, 255, 0.9); /* More opaque on hover */
  transform: translateY(-50%) scale(1.1); /* Slightly larger on hover */
}

.nav-left {
  left: 2rem; /* Position from the left */
}

.nav-right {
  right: 2rem; /* Position from the right */
}

/* Metadata overlay in detail view */
.photo-viewer .metadata-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  background: rgba(46, 46, 46, 0.8); /* 18% grey with 80% opacity */
  color: white;
  transform: translateY(100%);
  transition: transform 0.6s ease-in-out;
  z-index: 9; /* Below nav indicators */
}

.photo-viewer .metadata-overlay.visible {
  transform: translateY(0);
}

/* Close button for detail view */
.back-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.5); /* Semi-transparent white */
  cursor: pointer;
  z-index: 10; /* Above the image and metadata */
  transition: color 0.6s ease-in-out, transform 0.6s ease-in-out;
  background: none; /* Remove background */
  border: none; /* Remove border */
  padding: 0.5rem; /* Add some padding for easier clicking */
}

.back-button:hover {
  color: rgba(255, 255, 255, 0.9); /* More opaque on hover */
  transform: rotate(90deg); /* Rotate on hover for a subtle effect */
}

/* Styles for metadata content within the overlay */
.photo-viewer .metadata-overlay p {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
}

.photo-viewer .metadata-overlay p:last-child {
  margin-bottom: 0;
}

/* Options menu (can be reused or restyled for detail view) */
.options-menu {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(46, 46, 46, 0.95); /* Slightly less transparent grey */
  color: white;
  padding: 1.5rem;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
  z-index: 10;
}

.options-menu.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.option {
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: background-color var(--transition-speed);
  border-radius: 4px;
}

.option:hover {
  background-color: rgba(255, 255, 255, 0.1); /* Subtle hover effect */
}

.print-form {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-speed);
}

.print-form.visible {
  opacity: 1;
  pointer-events: auto;
}

.form-container {
  background: var(--background-color);
  padding: 2rem;
  border-radius: 8px;
  width: 100%;
  max-width: 500px;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--accent-color);
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.form-actions button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color var(--transition-speed);
}

#cancel-print {
  background-color: var(--accent-color);
}

button[type="submit"] {
  background-color: var(--text-color);
  color: var(--background-color);
}

.back-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  opacity: 0.6;
  transition: opacity var(--transition-speed);
  z-index: 5;
}

.back-button:hover {
  opacity: 1;
}

.related-photos {
  padding: 2rem;
  background-color: var(--accent-color);
  margin-top: 2rem;
}

.related-photos h3 {
  margin-bottom: 1.5rem;
  text-align: center;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.related-thumbnail {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.related-info {
  margin-top: 0.5rem;
  text-align: center;
}

.related-info h4 {
  font-size: 1rem;
  margin-bottom: 0;
}

/* Wander Page */
.wander-page {
  padding: 2rem;
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.wander-header {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.wander-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.featured-photo {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.wander-photo {
  width: 100%;
  border-radius: 8px;
}

.wander-actions {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 2rem;
}

.wander-button,
.explore-button {
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 500;
  transition: background-color var(--transition-speed);
}

.wander-button:hover {
  background-color: var(--accent-color);
}

.explore-button {
  background-color: var(--text-color);
  color: var(--background-color);
}


/* Theme Pill Styles (Revised Interaction Model) */
.theme-pill {
  display: inline-block;
  padding: 0.3em 0.8em;
  margin: 0.2em;
  border-radius: 1em; /* Pill shape */
  font-size: 0.8rem;
  cursor: pointer;
  transition: transform 0.3s ease-in-out, background-color 0.2s ease-out, opacity 0.2s ease-out, box-shadow 0.3s ease-in-out;
  background-color: rgba(200, 220, 255, 0.6); /* Slight bluish tint, muted initially */
  color: #111; /* Darker text for contrast */
  border: 1px solid rgba(150, 180, 220, 0.5);
  user-select: none; /* Prevent text selection during hold */
}

/* Active Theme Pill */
.theme-pill--active {
  background-color: rgba(180, 210, 255, 0.9); /* Brighter blue */
  font-weight: 500;
  border-color: rgba(120, 160, 210, 0.8);
  opacity: 1.0; /* Ensure active is fully opaque */
}

/* Inactive Theme Pill */
.theme-pill--inactive {
   opacity: 0.7; /* Muted */
}

/* Hover Effect (Desktop) - Breathing */
@media (hover: hover) {
  .theme-pill:hover {
    transform: scale(1.05); /* Slight expansion */
    background-color: rgba(190, 215, 255, 0.8); /* Slightly brighter on hover */
  }
  .theme-pill--active:hover {
     background-color: rgba(170, 200, 255, 1.0); /* Even brighter active hover */
  }
}

/* Hold Effect (Visual Feedback) */
.theme-pill--holding {
  transform: scale(1.1); /* More noticeable expansion during hold */
  box-shadow: 0 0 0 4px rgba(100, 150, 255, 0.7); /* Brighter, larger radial halo */
}

/* Transition Feedback Message */
.transition-feedback {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1rem;
    z-index: 100000; /* Ensure it's above everything */
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none; /* Don't interfere with clicks */
}

.transition-feedback--visible {
    opacity: 1;
}

/* Theme Pill Styles (Revised Interaction Model) */
.theme-pill {
  display: inline-block;
  padding: 0.3em 0.8em;
  margin: 0.2em;
  border-radius: 1em; /* Pill shape */
  font-size: 0.8rem;
  cursor: pointer;
  transition: transform 0.2s ease-out, background-color 0.2s ease-out, opacity 0.2s ease-out, box-shadow 0.2s ease-out;
  background-color: rgba(200, 220, 255, 0.6); /* Slight bluish tint, muted initially */
  color: #111; /* Darker text for contrast */
  border: 1px solid rgba(150, 180, 220, 0.5);
  user-select: none; /* Prevent text selection during hold */
}

/* Active Theme Pill */
.theme-pill--active {
  background-color: rgba(180, 210, 255, 0.9); /* Brighter blue */
  font-weight: 500;
  border-color: rgba(120, 160, 210, 0.8);
  opacity: 1.0; /* Ensure active is fully opaque */
}

/* Inactive Theme Pill */
.theme-pill--inactive {
   opacity: 0.7; /* Muted */
}

/* Hover Effect (Desktop) - Breathing */
@media (hover: hover) {
  .theme-pill:hover {
    transform: scale(1.05); /* Slight expansion */
    background-color: rgba(190, 215, 255, 0.8); /* Slightly brighter on hover */
  }
  .theme-pill--active:hover {
     background-color: rgba(170, 200, 255, 1.0); /* Even brighter active hover */
  }
}

/* Hold Effect (Visual Feedback) - Expansion */
.theme-pill--holding {
  transform: scale(1.1); /* More noticeable expansion during hold */
  box-shadow: 0 0 0 4px rgba(100, 150, 255, 0.7); /* Brighter, larger radial halo */
}

/* Transition Feedback Message */
.transition-feedback {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1rem;
    z-index: 100000; /* Ensure it's above everything */
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none; /* Don't interfere with clicks */
}

.transition-feedback--visible {
    opacity: 1;
}
