/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  height: 100vh;
  overflow: hidden;
  background: #f5f5f5;
}

/* Map Container */
#map {
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

/* Top Bar */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: white;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.top-bar h1 {
  font-size: 24px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-bar h1 i {
  color: #4285f4;
}

.locate-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #4285f4;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.locate-btn:hover {
  background: #3367d6;
  transform: scale(1.05);
}

.top-bar-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.zoom-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  backdrop-filter: blur(4px);
}

.zoom-indicator i {
  font-size: 12px;
  color: #6b7280;
}

.zoom-indicator.low-zoom {
  background: rgba(251, 191, 36, 0.9);
  color: #92400e;
}

.zoom-indicator.low-zoom i {
  color: #92400e;
}

/* Left Panel */
.left-panel {
  position: fixed;
  top: 60px;
  left: -400px;
  width: 400px;
  height: calc(100vh - 60px);
  background: white;
  box-shadow: 2px 0 8px rgba(0,0,0,0.15);
  transition: left 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  z-index: 999;
  overflow-y: auto;
}

.left-panel.show {
  left: 0;
}

.panel-header {
  position: sticky;
  top: 0;
  background: white;
  padding: 15px 20px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: flex-end;
  z-index: 10;
}

.close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f1f3f4;
  color: #5f6368;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: #e8eaed;
}

.edit-btn {
  background: #90b9fc;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  min-width: 100px;
  gap: 8px;
}

.edit-btn:hover {
  background: #6e9cff;
}

.panel-content {
  padding: 20px;
}

.panel-content h2 {
  font-size: 24px;
  color: #202124;
  margin-bottom: 20px;
  font-weight: 400;
}

/* Photo Section */
.photo-section {
  margin-bottom: 20px;
}

.photo-placeholder {
  width: 100%;
  height: 200px;
  border: 2px dashed #dadce0;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #5f6368;
  cursor: pointer;
  transition: all 0.2s ease;
}

.photo-placeholder:hover {
  border-color: #4285f4;
  color: #4285f4;
}

.photo-placeholder i {
  font-size: 32px;
}

.photo-placeholder span {
  font-size: 14px;
  font-weight: 500;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #3c4043;
  font-size: 14px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #4285f4;
  box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* Star Rating */
.star-rating {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.star {
  font-size: 24px;
  color: #dadce0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.star:hover,
.star.active {
  color: #fbbc04;
  transform: scale(1.1);
}

.star.active {
  animation: starPulse 0.3s ease-out;
}

@keyframes starPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1.1); }
}

/* Rating Display */
.rating-display {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.stars-display {
  display: flex;
  gap: 2px;
}

.stars-display i {
  font-size: 16px;
  color: #dadce0;
}

.stars-display i.active {
  color: #fbbc04;
}

.rating-text {
  font-size: 14px;
  color: #5f6368;
}

/* Tabs */
.tab-nav {
  display: flex;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 20px;
  gap: 0;
}

.tab-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: none;
  color: #5f6368;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: #4285f4;
  background: rgba(66, 133, 244, 0.04);
}

.tab-btn.active {
  color: #4285f4;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #4285f4;
}

.tab-content {
  min-height: 200px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Checkbox Group */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.checkbox-item:hover {
  background: #f8f9fa;
  border-color: #4285f4;
}

.checkbox-item input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.checkbox-item i {
  color: #5f6368;
  width: 20px;
  text-align: center;
}

.checkbox-item:hover i {
  color: #4285f4;
}

/* Info Display */
/* tranculate text */

#infoTitle {
  font-size: 24px;
  color: #202124;
  margin-bottom: 10px;
  font-weight: 400;
  white-space: wrap;
  overflow: visible;
}

#infoTitle.truncated {
  font-size: 24px;
  color: #202124;
  margin-bottom: 10px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.info-item {
  margin-bottom: 16px;
}

.info-item label {
  display: block;
  font-weight: 500;
  color: #3c4043;
  font-size: 14px;
  margin-bottom: 4px;
}

.info-item p {
  color: #5f6368;
  font-size: 14px;
  line-height: 1.4;
  background: #f8f9fa;
  padding: 12px;
  border-radius: 8px;
  margin: 0;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: #e8f0fe;
  border-radius: 6px;
  color: #1967d2;
  font-size: 14px;
}

.feature-item i {
  width: 16px;
  text-align: center;
}

/* Buttons */
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  justify-content: flex-end;
}

.btn-primary,
.btn-secondary {
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
}

.btn-primary {
  background: #4285f4;
  color: white;
}

.btn-primary:hover {
  background: #3367d6;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-secondary {
  background: white;
  color: #5f6368;
  border: 1px solid #dadce0;
}

.btn-secondary:hover {
  background: #f8f9fa;
  border-color: #4285f4;
  color: #4285f4;
}

/* Animations */
@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutLeft {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(-100%);
    opacity: 0;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .left-panel {
    width: 100vw;
    left: -100vw;
  }
  
  .top-bar {
    padding: 0 15px;
  }
  
  .top-bar h1 {
    font-size: 20px;
  }
}

/* Custom Scrollbar */
.left-panel::-webkit-scrollbar {
  width: 6px;
}

.left-panel::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.left-panel::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.left-panel::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Custom Marker Styles */
.custom-marker-icon {
  background: transparent !important;
  border: none !important;
}

.marker-container {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.marker-icon {
  background: white;
  border: 2px solid #3388ff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}

.marker-icon:hover {
  transform: scale(1.1);
}

.marker-label {
  border-radius: 0px;
  padding: 0px 0px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: white;
  text-shadow:
    -1px -1px 0 black, /* Top-left shadow */
    1px -1px 0 black,  /* Top-right shadow */
    -1px 1px 0 black,  /* Bottom-left shadow */
    1px 1px 0 black;   /* Bottom-right shadow */
  box-shadow: 0 0px 0px rgba(0,0,0,0.1);
}

/* Form Validation Styles */
.form-group {
  position: relative;
}

.form-group input.error,
.form-group textarea.error {
  border: 2px solid #ef4444 !important;
  background-color: #fef2f2;
}

.error-message {
  color: #ef4444;
  font-size: 12px;
  margin-top: 4px;
  display: none;
}

.error-message.show {
  display: block;
}

.char-count {
  font-size: 11px;
  color: #6b7280;
  margin-top: 4px;
  text-align: right;
}

.char-count.error {
  color: #ef4444;
}

/* Info title section styles */
.info-title-section {
  margin-bottom: 20px;
}

.info-title {
  font-size: 24px;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.4;
  margin-bottom: 8px;
  word-wrap: break-word;
  transition: all 0.3s ease;
}

.info-title.truncated {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.show-more-btn {
  background: none;
  border: none;
  color: #3b82f6;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  transition: color 0.2s ease;
}

.show-more-btn:hover {
  color: #1d4ed8;
}

.show-more-btn i {
  font-size: 12px;
  transition: transform 0.3s ease;
}

.show-more-btn.expanded i {
  transform: rotate(180deg);
}

/* Section Headers */
.section-header {
  margin: 20px 0 15px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #e5e7eb;
}

.section-header h4 {
  font-size: 16px;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-header:first-child {
  margin-top: 0;
}

/* About Sections in Info Panel */
.about-section {
  margin-bottom: 30px;
}

.about-section h4 {
  font-size: 16px;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e5e7eb;
}

.about-section:last-child {
  margin-bottom: 0;
}

/* Reviews Styles */
.review-item {
  padding: 15px 0;
  border-bottom: 1px solid #e5e7eb;
}

.review-item:last-child {
  border-bottom: none;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.review-rating {
  display: flex;
  gap: 2px;
}

.review-rating i {
  font-size: 14px;
  color: #d1d5db;
}

.review-rating i.active {
  color: #fbbf24;
}

.review-date {
  font-size: 12px;
  color: #6b7280;
}

.review-text {
  font-size: 14px;
  color: #374151;
  line-height: 1.5;
  margin-bottom: 8px;
}

.review-author {
  font-size: 12px;
  color: #6b7280;
  font-style: italic;
}

.reviews-list {
  max-height: 300px;
  overflow-y: auto;
}

/* Rating Summary */
.rating-summary {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 15px;
}

.average-rating {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rating-number {
  font-size: 28px;
  font-weight: 600;
  color: #1f2937;
}

.rating-stars {
  display: flex;
  gap: 2px;
}

.rating-stars i {
  font-size: 16px;
  color: #d1d5db;
}

.rating-stars i.active {
  color: #fbbf24;
}

.review-count {
  font-size: 14px;
  color: #6b7280;
}

.reviews-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 15px 0;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #e5e7eb;
}

.pagination-btn {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s ease;
}

.pagination-btn:hover {
  background: #2563eb;
}

.pagination-btn:disabled {
  background: #d1d5db;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 14px;
  color: #6b7280;
}

/* Write Review Section */
.write-review-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.write-review-section h4 {
  color: #374151;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}

.write-review-section .form-group {
  margin-bottom: 12px;
}

.write-review-section textarea {
  min-height: 60px;
  resize: vertical;
}

.form-actions-inline {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.form-actions-inline .btn-primary {
  padding: 8px 16px;
  font-size: 14px;
}

/* Auth Controls */
.auth-controls, .user-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-btn {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.2s ease;
}

.auth-btn:hover {
  background: #2563eb;
}

.welcome-text {
  color: #374151;
  font-size: 14px;
  margin-right: 8px;
}

#currentUsername {
  font-weight: 600;
  color: #3b82f6;
}

/*
  The Overlay: Covers the screen and centers its child.
*/
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
  background: white;
  border-radius: 12px;
  padding: 0;
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
  margin: 0;
  color: #1f2937;
  font-size: 18px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6b7280;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.modal-close:hover {
  background: #f3f4f6;
}

.modal form {
  padding: 20px 24px 24px;
}

.modal .form-group {
  margin-bottom: 16px;
}

.modal .form-group label {
  display: block;
  margin-bottom: 6px;
  color: #374151;
  font-weight: 500;
  font-size: 14px;
}

.modal .form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.modal .form-group input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal .form-group input:invalid {
  border-color: #ef4444;
}

.modal .form-group input:disabled {
  background-color: #f3f4f6;
  cursor: not-allowed;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.modal-actions .btn-secondary,
.modal-actions .btn-primary {
  padding: 10px 16px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease;
}

.modal-actions .btn-secondary {
  background: #f3f4f6;
  color: #374151;
}

.modal-actions .btn-secondary:hover {
  background: #e5e7eb;
}

.modal-actions .btn-primary {
  background: #3b82f6;
  color: white;
}

.modal-actions .btn-primary:hover {
  background: #2563eb;
}

.modal-actions .btn-primary:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.modal-actions .btn-secondary:disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
}

/* Error message styling */
.error-message {
  color: #ef4444;
  font-size: 12px;
  margin-top: 4px;
  display: block;
  min-height: 16px;
}

/* Success animation keyframes */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Modal animation */
.modal {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    transform: translateX(-50%) translateY(calc(-50% - 50px));
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(-50%);
    opacity: 1;
  }
}

/* Google Sign-In styling */
.g-signin2 {
  display: inline-block;
  width: 100%;
  margin: 0 auto;
}

.g-signin2 > div {
  width: 100% !important;
  justify-content: center !important;
}

.google-signin-divider {
  text-align: center;
  margin: 20px 0;
  border-top: 1px solid #e5e7eb;
  padding-top: 20px;
}

.google-signin-text {
  margin-bottom: 10px;
  color: #6b7280;
  font-size: 14px;
}