/* ===== BASE STYLES ===== */
body {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  margin: 0;
}

/* ===== HEADER STYLES ===== */
.site-header {
  background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  width: 100%;
  box-sizing: border-box;
  color: white;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.home-icon {
  color: black;
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
}

.home-icon img {
  height: 28px;
  filter: invert(1);
}

.language-switcher {
  display: flex;
  gap: 5px;
}

.lang-btn {
  padding: 5px 10px;
  border: 1px solid #ccc;
  background: #f8f9fa;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  background: #e9ecef;
}

.lang-btn.active {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

.back-button {
  background: rgba(255,255,255,0.1);
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid rgba(255,255,255,0.2);
}

.back-button:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

/* ===== LAYOUT STYLES ===== */
.page-container {
  display: grid;
  grid-template-columns: 320px 1fr 1fr 320px;  /* Left Ad | Main | Instagram | Right Ad */
  gap: 1rem;
}

.content-area {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.05);
  padding: 2rem;
  margin: 20px 10px;
  display: flex;
  flex-direction: column;
}

.ad-sidebar {
  background: #fafafa;
  padding: 1rem;
  border-right: 1px solid #ddd;
}

.instagram-sidebar {
  background: #f9f9f9;
  padding: 1rem;
}

.right-ad-sidebar {
  background: #fafafa;
  padding: 1rem;
}

.ad-slot {
  width: 300px;
  height: 600px;
  background: #e0e0e0;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.spot-detail-content {
  display: flex;
  flex-direction: column;
  padding: 1rem 2rem;
  background: white;
  flex-grow: 1;
}

/* ===== SPOT HEADER STYLES ===== */
.spot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.spot-info {
  flex: 1;
}

.spot-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.spot-address {
  color: #666;
  margin-bottom: 1rem;
}

.share-icon {
  font-size: 0.8em;
  color: #666;
  cursor: pointer;
  margin-left: 8px;
  padding: 4px 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #f8f9fa;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
  display: inline-block;
}

.share-icon:hover {
  color: #007bff;
  border-color: #007bff;
  box-shadow: 0 2px 4px rgba(0,123,255,0.2);
  background-color: #fff;
}

/* ===== EMOJI STYLES ===== */
.emoji-panel {
  display: flex;
  gap: 10px;
}

.emoji-layout {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.emoji-big-column {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

.emoji-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.emoji-row {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.emoji-btn {
  font-size: 1.5rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #dee2e6;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  padding: 8px;
  cursor: pointer;
  text-align: center;
  position: relative;
}

.emoji-btn .count {
  font-size: 0.75rem;
  color: #555;
}

.emoji-btn.big {
  font-size: 2.5rem;
}

.emoji-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.emoji-section {
  background: #fefefe;
}

/* ===== TAG STYLES ===== */
.tags {
  margin-bottom: 1rem;
}

.tag {
  display: inline-block;
  background-color: #000;
  color: #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  margin: 0 0.5rem 0.5rem 0;
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tag:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  background-color: #333;
}

/* ===== SECTION STYLES ===== */
section.spot-section {
  background: #fff;
  margin-bottom: 1.5rem;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.section-title {
  color: #2c3e50;
  font-weight: 600;
  border-bottom: 2px solid #3498db;
  display: inline-block;
  padding-bottom: 5px;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.tooltip-icon {
  cursor: help;
  font-size: 0.9em;
  color: gray;
  margin-left: 0.5rem;
}

.twitter-section, .instagram-section {
  background: #f9f9f9;
}

.event-embed {
  border-radius: 10px;
  overflow: hidden;
  max-width: 100%;
}

/* ===== IMAGE GALLERY STYLES ===== */
.image-gallery-section {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
}

.image-gallery-section img {
  max-width: 30%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.image-gallery-section img:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* ===== IMAGE POPUP STYLES ===== */
#image-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

#image-popup img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 0 10px #000;
}

.popup-hidden {
  display: none !important;
  pointer-events: none;
}

/* ===== EMOJI POSITIONING ===== */
/* Desktop: Show reactions under address, hide original position */
@media (min-width: 769px) {
  .desktop-below-address {
    display: block;
    margin-top: 15px;
    margin-bottom: 20px;
  }
  
  .mobile-original-position {
    display: none;
  }
}

/* Mobile: Show reactions in original position, hide below-address version */
@media (max-width: 768px) {
  .desktop-below-address {
    display: none;
  }
  
  .mobile-original-position {
    display: block;
  }
}

/* ===== TABLET/LARGE MOBILE STYLES ===== */
@media (max-width: 1200px) {
  .page-container {
    grid-template-columns: 1fr;
    gap: 0;
    margin: 0;
  }

  .ad-sidebar,
  .right-ad-sidebar {
    display: none;
  }

  /* Show Instagram section on mobile but move it below Twitter */
  .instagram-sidebar {
    display: block !important;
    grid-column: 1;
    order: 3;
    margin: 1rem 0;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  }
  
  .instagram-sidebar iframe {
    width: 100% !important;
    height: 500px;
    border-radius: 8px;
  }
  
  /* Ensure Twitter section comes before Instagram */
  .twitter-section {
    order: 2;
  }
}

/* ===== MOBILE STYLES (768px and below) ===== */
@media (max-width: 768px) {
  /* Layout adjustments */
  .content-area {
    margin: 10px;
    padding: 1rem;
    border-radius: 8px;
  }

  .site-header {
    padding: 0.75rem;
    margin: 0;
    border-radius: 0;
  }

  .page-container {
    padding: 0;
  }

  /* Header controls */
  .header-controls {
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
  }
  
  .language-switcher {
    order: 2;
  }
  
  .back-button {
    order: 1;
  }

  /* Typography - FIXED SIZES (no more problematic scaling) */
  .spot-title {
    font-size: 1.6rem; /* Fixed size instead of 2.2em */
    font-weight: 600;
  }

  .spot-address {
    font-size: 1rem; /* Fixed size instead of 1.3em */
    margin-bottom: 1rem;
  }

  /* Emoji layout - REMOVED problematic transform scale */
  .emoji-layout {
    margin: 15px 0; /* Reduced margin */
    flex-wrap: wrap; /* Allow wrapping on very small screens */
    /* REMOVED: transform: scale(1.2); */
  }

  .emoji-btn {
    font-size: 1.6rem; /* Slightly larger but not scaled */
    padding: 10px;
  }

  .emoji-btn.big {
    font-size: 2.8rem; /* Slightly larger but not scaled */
  }

  /* Tags */
  .tag {
    font-size: 0.85rem; /* Keep original size */
    padding: 0.4rem 0.8rem; /* Keep original padding */
    margin: 0 0.5rem 0.5rem 0;
  }

  /* Section titles */
  .section-title {
    font-size: 1.2rem; /* Keep original size */
    margin-bottom: 1rem;
  }

  /* Content adjustments */
  .spot-detail-content {
    padding: 1rem;
  }

  /* Image gallery */
  .image-gallery-section {
    flex-direction: column; /* Stack images vertically on mobile */
  }

  .image-gallery-section img {
    max-width: 100%;
    max-height: 240px;
    height: auto;
  }

  /* Instagram sidebar on mobile */
  .instagram-sidebar {
    display: block !important;
    margin: 1rem 0;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  }
}

/* ===== MOBILE AD FOOTER ===== */
@media (max-width: 768px) {
  .mobile-ad-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    z-index: 998;
    min-height: 50px;
  }
  
  .mobile-ad-footer.hidden {
    display: none;
  }
  
  .mobile-ad-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .ad-placeholder {
    background: #e9ecef;
    border: 2px dashed #adb5bd;
    border-radius: 4px;
    padding: 10px 20px;
    text-align: center;
    color: #6c757d;
    font-size: 0.8rem;
    font-weight: 500;
    width: 100%;
    max-width: 300px;
  }
  
  .mobile-ad-close {
    background: #dc3545;
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    margin-left: 10px;
    flex-shrink: 0;
  }
  
  .mobile-ad-close:hover {
    background: #c82333;
  }
  
  /* Add space for mobile ad footer */
  .content-area:last-child {
    margin-bottom: 80px;
  }
}