/* --- START OF FILE style.css --- */

/* --- Global & Base --- */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  background-color: #f0f0f0;
}

/* --- Map Container --- */
#map {
  height: 100%;
  /* Should fill the .content div */
  width: 100%;
  z-index: 1;
  /* Ensure map is behind overlays */
}

/* --- Sidebar --- */
#sidebar {
  position: fixed;
  top: 0;
  right: 0;
  /* Start at the edge */
  width: 50%;
  /* Changed width */
  max-width: 95%;
  /* Keep max-width for smaller screens */
  height: 100%;
  background: #fff;
  box-shadow: -3px 0 8px rgba(0, 0, 0, 0.2);
  padding: 25px;
  /* Changed transition property */
  transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
  transform: translateX(100%);
  /* Hide using transform */
  z-index: 1001;
  box-sizing: border-box;
  overflow-y: auto;
}

#sidebar.show {
  transform: translateX(0);
  /* Show using transform */
  /* Removed right: 0; */
}

#sidebar h3 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #333;
  font-weight: 600;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

#sidebar label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  font-size: 14px;
  color: #555;
}

#sidebar input[type="text"],
#sidebar input[type="file"],
#sidebar textarea {
  width: 100%;
  margin-bottom: 15px;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

#sidebar input[type="text"]:focus,
#sidebar textarea:focus {
  border-color: #1a73e8;
  outline: none;
}

#sidebar textarea {
  resize: vertical;
  min-height: 60px;
}

#sidebar input[type="file"] {
  padding: 8px;
}

#sidebar button[type="submit"] {
  width: 100%;
  padding: 12px 20px;
  margin-top: 10px;
  background-color: #1a73e8;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#sidebar button[type="submit"]:hover {
  background-color: #155abf;
}

/* --- Context Menu --- */
.context-menu {
  display: none;
  position: absolute;
  z-index: 9999;
  background: white;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  padding: 10px 15px;
  min-width: 150px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
}

.context-menu:hover {
  background-color: #f8f9fa;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#contextMenu {
  display: none;
  padding: 10px 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

#contextMenu::before {
  content: "➕";
  font-size: 16px;
  margin-right: 4px;
}

/* --- Modal Styling --- */
#location-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: none;
  /* Hidden by default */
  justify-content: center;
  align-items: center;
  z-index: 1010;
  /* Above everything */
  padding: 15px;
  box-sizing: border-box;
}

#location-modal-content {
  background: white;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  width: 85vw;
  max-height: 80vh;
  max-width: 550px;
  /* Max width on larger screens */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Contain children */
  position: relative;
  /* For close button positioning */
}

#close-modal-button {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  font-size: 28px;
  line-height: 1;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
  padding: 5px;
  z-index: 1011;
  /* Above modal content */
}

#close-modal-button:hover {
  color: #333;
}

#location-modal-content h3 {
  font-size: 17px;
  margin: 0;
  padding: 12px 15px;
  padding-right: 40px;
  /* Space for close button */
  background: #1a73e8;
  color: white;
  font-weight: 500;
  flex-shrink: 0;
  box-sizing: border-box;
}

#location-modal-content .modal-content-wrapper {
  padding: 15px;
  overflow-y: auto;
  /* Scroll only this area */
  flex-grow: 1;
  /* Take available space */
  box-sizing: border-box;
  color: #333;
}

#location-modal-content .modal-summary {
  font-size: 15px;
  color: #202124;
  margin-bottom: 12px;
  line-height: 1.5;
  font-weight: 500;
}

/* Description hidden by default, can be enabled via media query below */
#location-modal-content .modal-description {
  display: none;
  font-size: 14px;
  line-height: 1.5;
  color: #5f6368;
  margin-bottom: 15px;
}

#location-modal-content .modal-audio-wrapper {
  background: #f8f9fa;
  padding: 10px 15px;
  border-top: 1px solid #eee;
  flex-shrink: 0;
  box-sizing: border-box;
}

#location-modal-content audio {
  width: 100%;
  height: 40px;
  display: block;
  margin: 0;
}

.modal-description {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eee;
  font-size: 0.95em;
  line-height: 1.5;
  color: #666;
  white-space: pre-line;
}

/* Optional: Adjustments for slightly larger screens */
@media (min-width: 600px) {
  #location-modal-content h3 {
    font-size: 18px;
    padding: 15px 20px;
    padding-right: 45px;
    /* Space for close button */
  }

  #location-modal-content .modal-content-wrapper {
    padding: 20px;
  }

  /* Example: Show description on desktop */
  /* #location-modal-content .modal-description {
     display: block;
   }*/
}

/* --- Geolocation Marker Styling --- */
.leaflet-control-locate-location circle {
  /* Style for the main blue dot */
  fill: #1a73e8;
  /* Blue fill */
  stroke: white;
  /* White border */
  stroke-width: 2;
  fill-opacity: 0.9;
}

.leaflet-control-locate-location .accuracy {
  /* Style for the accuracy circle */
  fill: #1a73e8;
  /* Blue fill */
  stroke: #1a73e8;
  /* Blue border */
  stroke-width: 0.5;
  fill-opacity: 0.15;
  /* More transparent */
  stroke-opacity: 0.3;
  pointer-events: none;
  /* Allow clicks to pass through */
}

/* --- Marker Context Menu --- */
#markerContextMenu {
  transform: translate(-50%, -100%);
  margin-top: -10px;
}

/* Ensure context menu is above other elements */
#contextMenu,
#markerContextMenu {
  z-index: 9999;
}

#markerContextMenu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#markerContextMenu li {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#markerContextMenu li:hover {
  background-color: #f0f0f0;
  /* Highlight on hover */
}

/* Navigation Bar Styles */
.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  height: 64px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-left,
.nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
}

.nav-link i {
  font-size: 1.1em;
  opacity: 0.8;
}

.main-logo {
  color: #f1f5f9;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  padding-left: 0;
}

.main-logo i {
  color: #38bdf8;
  opacity: 1;
}

.nav-link:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.05);
}

.nav-divider {
  width: 1px;
  height: 32px;
  background-color: rgba(255, 255, 255, 0.1);
  margin: 0 8px;
}

.admin-link {
  color: #38bdf8;
}

.admin-link:hover {
  color: #7dd3fc;
  background-color: rgba(56, 189, 248, 0.08);
}

.nav-button {
  background-color: #38bdf8;
  color: #0f172a;
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-button:hover {
  background-color: #7dd3fc;
  filter: brightness(1.1);
}

.nav-button:active {
  transform: translateY(1px);
}

#search-box {
  background-color: #fff;
  font-family: Roboto;
  font-size: 15px;
  font-weight: 300;
  margin-left: 12px;
  padding: 0 11px 0 13px;
  text-overflow: ellipsis;
  width: 300px;
  height: 40px;
  margin-top: 5px;
  border: 1px solid transparent;
  border-radius: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

#search-box:focus {
  border-color: #4d90fe;
  outline: none;
}

.edit-mode-label {
  margin-left: 10px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s;
}

.edit-mode-label:hover {
  color: #fff;
  border-color: rgba(56, 189, 248, 0.3);
}

.edit-mode-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: #38bdf8;
}

.coordinates-container {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.coord-input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.coord-input-group:first-child {
  flex: 0 0 60px;
}

/* Sidebar Specific Buttons */
.button-primary {
  background-color: #1a73e8;
  color: white;
  border: 1px solid #1a73e8;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.button-primary:hover {
  background-color: #155abf;
  border-color: #155abf;
}

.button-secondary {
  background-color: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.button-secondary:hover {
  background-color: #f8f9fa;
  border-color: #dadce0;
}

.button-primary:disabled,
.button-secondary:disabled {
  background-color: #f1f3f4;
  color: #9aa0a6;
  border-color: #f1f3f4;
  cursor: not-allowed;
}

.button-ai {
  background-color: #6f42c1;
  color: white;
  border: 1px solid #6f42c1;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.button-ai:hover {
  background-color: #59359a;
  border-color: #59359a;
  box-shadow: 0 2px 5px rgba(111, 66, 193, 0.3);
}

.button-ai i {
  font-size: 0.9em;
}

/* ID field is already handled by flex: 0 0 60px */


.coord-input-group label {
  margin-bottom: 5px;
  font-size: 14px;
  color: #555;
}

.coord-input-group input,
.coord-input-group button {
  height: 38px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 100%;
  box-sizing: border-box;
}

#show-photos-button {
  background-color: #6c757d;
  color: white;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#show-photos-button:hover:not(:disabled) {
  background-color: #5a6268;
}

#show-photos-button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

#sidebar textarea[name="description"] {
  min-height: 150px;
}

/* Container for main content */
.content {
  padding-top: 64px;
  height: 100vh;
  /* <<< SET height to full viewport height */
  box-sizing: border-box;
  /* Include padding in height calculation */
  background-color: #fff;
  /* <<< ADDED background color */
}

/* Basic table styling */
.poi-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 0.9em;
  /* Slightly smaller font for tables */
}

.poi-table th,
.poi-table td {
  border: 1px solid #ccc;
  padding: 6px 8px;
  /* Adjusted padding */
  text-align: left;
  vertical-align: top;
}

.poi-table th {
  background-color: #e9e9e9;
  /* Lighter header */
  font-weight: bold;
}

/* Specific styles for action buttons/indicators in tables */
.db-actions a,
.db-actions span {
  display: inline-block;
  padding: 4px 8px;
  font-size: 0.9em;
  text-decoration: none;
  border-radius: 4px;
  margin-right: 5px;
  /* Add some spacing between actions */
  vertical-align: middle;
}

.db-actions .status-registered {
  background-color: #d4edda;
  /* Bootstrap success light */
  color: #155724;
  /* Bootstrap success dark */
  border: 1px solid #c3e6cb;
  /* Bootstrap success border */
  padding: 2px 5px;
  /* Smaller padding for icon-like status */
}

.db-actions .import-link

/* Changed class name */
  {
  background-color: #cce5ff;
  /* Bootstrap info light */
  color: #004085;
  /* Bootstrap info dark */
  border: 1px solid #b8daff;
  /* Bootstrap info border */
  cursor: pointer;
}

.db-actions .import-link:hover {
  background-color: #b8daff;
}

.db-actions a[target="_blank"]

/* Style details link */
  {
  background-color: #f8f9fa;
  /* Bootstrap light grey */
  color: #212529;
  /* Bootstrap dark */
  border: 1px solid #dee2e6;
  /* Bootstrap grey border */
}

.db-actions a[target="_blank"]:hover {
  background-color: #e2e6ea;
}

/* --- NEW: Photos Modal Styling --- */
#photos-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: none;
  /* Hidden by default */
  justify-content: center;
  align-items: center;
  z-index: 1012;
  /* Above POI modal */
  padding: 20px;
  box-sizing: border-box;
}

#photos-modal-content {
  background: white;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  width: 90vw;
  max-height: 85vh;
  max-width: 800px;
  /* Max width */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

#close-photos-modal-button {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  font-size: 24px;
  line-height: 1;
  font-weight: bold;
  color: white;
  cursor: pointer;
  padding: 5px 10px;
  z-index: 1013;
  border-radius: 50%;
}

#close-photos-modal-button:hover {
  background: rgba(0, 0, 0, 0.8);
}

#photos-modal-content h3 {
  font-size: 17px;
  margin: 0;
  padding: 12px 15px;
  background: #6c757d;
  /* Match button color */
  color: white;
  font-weight: 500;
  flex-shrink: 0;
  box-sizing: border-box;
}

#photos-modal-grid {
  padding: 15px;
  overflow-y: auto;
  /* Scroll only this area */
  flex-grow: 1;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  /* Responsive grid */
  gap: 10px;
  background-color: #f1f1f1;
  /* Light background for grid */
}

#photos-modal-grid img {
  width: 100%;
  height: 120px;
  /* Fixed height for consistency */
  object-fit: cover;
  /* Crop images nicely */
  border-radius: 4px;
  cursor: pointer;
  /* Keep cursor pointer for selection */
  transition: box-shadow 0.2s ease;
  /* Only transition shadow if kept for selected */
  /* Added position relative from previous step */
  position: relative;
  display: block;
}


#photos-modal-grid p {
  /* Style for loading/no photos message */
  grid-column: 1 / -1;
  /* Span full width */
  text-align: center;
  color: #666;
  padding: 20px;
}

/* --- NEW: Styling for photo selection and upload button --- */
#photos-modal-grid img.selected {
  /* Add a more prominent border */
  outline: 4px solid #1a73e8;
  outline-offset: -2px;
  /* Adjust offset for thickness */
  box-shadow: 0 0 12px rgba(26, 115, 232, 0.6);
  /* Slightly stronger shadow */
}

/* Checkmark overlay using pseudo-element */
#photos-modal-grid img.selected::after {
  content: '✔';
  /* Checkmark symbol */
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: rgba(26, 115, 232, 0.8);
  /* Blue background */
  color: white;
  font-size: 16px;
  font-weight: bold;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.modal-upload-button {
  padding: 8px 15px;
  background-color: #28a745;
  /* Green color */
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.modal-upload-button:hover:not(:disabled) {
  background-color: #218838;
}

.modal-upload-button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.thumbnails-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 20px 0;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  min-height: 100px;
  background-color: #f8f9fa;
}

.thumbnails-container img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #ddd;
}

/* --- ΝΕΟ: Styling for Manage POIs Overlay --- */
.overlay {
  display: none;
  /* Κρυφό εξ ορισμού */
  position: fixed;
  /* Καλύπτει όλη την οθόνη */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  /* Ημιδιάφανο μαύρο φόντο */
  z-index: 10000;
  /* Πολύ υψηλό z-index για να είναι πάνω απ' όλα */
  padding: 0;
  /* Αφαιρώ το padding από τον γονέα */
  box-sizing: border-box;
  display: flex;
  /* Χρησιμοποιώ flexbox για στοίχιση */
  justify-content: center;
  /* Κεντράρισμα οριζόντια */
  align-items: flex-start;
  /* Στοίχιση περιεχομένου στην κορυφή */
}

.overlay-content {
  background-color: #fff;
  padding: 25px;
  /* Λίγο μικρότερο padding */
  border-radius: 5px;
  /* CHANGE: Adjust width/height and margin */
  width: 90vw;
  height: 85vh;
  margin: 3vh auto 0 auto;
  /* 3% από πάνω, αυτόματα περιθώρια δεξιά/αριστερά, 0 κάτω */
  position: relative;
  overflow: hidden;
  /* Κρύβει το scroll του εσωτερικού περιεχομένου */
  display: flex;
  flex-direction: column;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  /* Προσθήκη σκιάς */
}

.close-overlay-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  color: #555;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  padding: 5px;
}

.close-overlay-btn:hover {
  color: #000;
}

.overlay-content h2 {
  text-align: center;
  margin-top: 0;
  margin-bottom: 20px;
  color: #333;
}

.table-container-overlay {
  overflow-y: auto;
  flex-grow: 1;
}

#manage-poi-table-overlay {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

#manage-poi-table-overlay th,
#manage-poi-table-overlay td {
  border: 1px solid #ddd;
  padding: 8px 12px;
  text-align: left;
  font-size: 14px;
  /* Λίγο μικρότερο font για να χωράνε περισσότερα */
}

#manage-poi-table-overlay th {
  background-color: #f2f2f2;
  position: sticky;
  /* Κρατάει τα headers ορατά κατά το scroll */
  top: 0;
  z-index: 1;
  /* Πάνω από το περιεχόμενο του πίνακα */
}

#manage-poi-table-overlay tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

#manage-poi-table-overlay tbody tr:hover {
  background-color: #e9e9e9;
}

#manage-poi-table-overlay .action-button {
  padding: 4px 8px;
  margin-right: 4px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid #ccc;
  border-radius: 3px;
  background-color: #eee;
}

#manage-poi-table-overlay .action-button:hover {
  background-color: #ddd;
}

/* NEW: Style for clickable title cell */
#manage-poi-table-overlay td.editable-title {
  cursor: pointer;
  color: #0056b3;
}

/* --- Mobile Sidebar Full-Screen Adjustments --- */
@media (max-width: 768px) {
  #sidebar {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    z-index: 9999 !important;
    padding: 20px !important;
    border-radius: 0 !important;
    top: 0 !important;
    left: 0 !important;
    display: flex;
    flex-direction: column;
  }

  .sidebar-close-btn {
    top: 10px !important;
    right: 10px !important;
    font-size: 32px !important;
    width: 44px !important;
    height: 44px !important;
    background: #f1f5f9 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  #sidebar h3 {
    margin-top: 5px;
    font-size: 1.5rem;
    padding-bottom: 12px;
    margin-bottom: 25px;
    border-bottom: 2px solid #38bdf8;
    color: #0f172a;
  }

  #sidebar form {
    padding-bottom: 60px;
    /* Space for easier scrolling/submitting */
  }
}

#manage-poi-table-overlay td.editable-title:hover {
  text-decoration: underline;
  color: #003d80;
  /* Darker blue on hover */
}