/* Map Page Specific Styles */

/* Mobile Navigation Styles */
@media (max-width: 768px) {
  .header-top .nav {
    display: none;
  }

  .mobile-nav {
    display: flex;
  }
}

@media (min-width: 769px) {
  .mobile-nav {
    display: none;
  }
}

/* Dark Mode Styles */
[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --text-color: #ffffff;
  --border-color: #333333;
  --card-bg: #2d2d2d;
  --input-bg: #3a3a3a;
  --hover-bg: #404040;
}

[data-theme="dark"] body {
  background-color: var(--bg-color) !important;
  color: var(--text-color) !important;
}

[data-theme="dark"] html {
  background-color: var(--bg-color) !important;
}

[data-theme="dark"] .map-controls {
  background: var(--card-bg);
  border-color: var(--border-color);
}

[data-theme="dark"] .map-search {
  background: var(--input-bg);
  color: var(--text-color);
  border-color: var(--border-color);
}

[data-theme="dark"] .map-search::placeholder {
  color: #999;
}

[data-theme="dark"] .category-chips {
  background: var(--bg-color);
}

[data-theme="dark"] .category-chip {
  background: var(--card-bg);
  color: var(--text-color);
  border-color: var(--border-color);
}

[data-theme="dark"] .category-chip:hover,
[data-theme="dark"] .category-chip.active {
  background: var(--hover-bg);
  color: var(--text-color);
}

[data-theme="dark"] .map-actions {
  background: var(--card-bg);
  border-color: var(--border-color);
}

[data-theme="dark"] .map-actions button {
  background: var(--input-bg);
  color: var(--text-color);
  border-color: var(--border-color);
}

[data-theme="dark"] .map-actions button:hover {
  background: var(--hover-bg);
}

[data-theme="dark"] .business-list {
  background: var(--card-bg);
  border-color: var(--border-color);
}

[data-theme="dark"] .business-item {
  background: var(--bg-color);
  border-color: var(--border-color);
  color: var(--text-color);
}

[data-theme="dark"] .business-item:hover {
  background: var(--hover-bg);
}

[data-theme="dark"] .business-item h4 {
  color: var(--text-color);
}

[data-theme="dark"] .business-item p {
  color: var(--text-color);
  opacity: 0.8;
}

[data-theme="dark"] .business-rating {
  color: #ffd700;
}

[data-theme="dark"] .business-address {
  color: var(--text-color);
  opacity: 0.7;
}

[data-theme="dark"] .business-phone {
  color: var(--text-color);
  opacity: 0.7;
}

[data-theme="dark"] .map-footer {
  background: var(--card-bg);
  border-color: var(--border-color);
}

[data-theme="dark"] .map-footer h3 {
  color: var(--text-color);
}

[data-theme="dark"] .map-footer p {
  color: var(--text-color);
  opacity: 0.8;
}

/* Map Controls */
.map-controls {
  background: #f8f9fa;
  padding: 1rem 0;
  border-bottom: 1px solid #e9ecef;
  position: sticky;
  top: 80px;
  z-index: 1000;
}

.controls-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-section {
  display: flex;
  justify-content: center;
}

.search-container {
  display: flex;
  max-width: 500px;
  width: 100%;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  outline: none;
  font-size: 0.9rem;
  color: #333;
}

.search-input::placeholder {
  color: #999;
}

.search-btn {
  background: #2ec4b6;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

.search-btn:hover {
  background: #26a69a;
}

.filter-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-chip {
  background: #e9ecef;
  color: #666;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 16px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.filter-chip.active,
.filter-chip:hover {
  background: #2ec4b6;
  color: white;
}

.control-buttons {
  display: flex;
  gap: 0.5rem;
}

.control-btn {
  background: #1e4da1;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.control-btn:hover {
  background: #153a7a;
  transform: translateY(-1px);
}

.control-btn.secondary {
  background: #6c757d;
}

.control-btn.secondary:hover {
  background: #5a6268;
}

.btn-icon {
  font-size: 0.9rem;
}

/* Map Container */
.map-container {
  position: relative;
  height: calc(100vh - 200px);
  min-height: 500px;
}

.map-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Desktop List Panel */
.desktop-list {
  position: absolute;
  left: 0;
  top: 0;
  width: 350px;
  height: 100%;
  background: white;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.desktop-list.visible {
  transform: translateX(0);
}

.list-header {
  padding: 1rem;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
}

.list-header h3 {
  color: #1e4da1;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.result-count {
  color: #666;
  font-size: 0.9rem;
}

.list-content {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.list-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
  margin-bottom: 0.5rem;
}

.list-item:hover {
  background: #f8f9fa;
}

.list-item.active {
  background: #e3f2fd;
  border: 2px solid #2ec4b6;
}

.list-item-thumbnail {
  width: 60px;
  height: 45px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.list-item-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-item-info {
  flex: 1;
  min-width: 0;
}

.list-item-name {
  color: #1e4da1;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-category {
  color: #2ec4b6;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.list-item-address {
  color: #666;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-rating {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.list-item-stars {
  color: #ffc107;
  font-size: 0.7rem;
}

.list-item-rating-text {
  color: #666;
  font-size: 0.7rem;
}

/* Mobile Bottom Sheet */
.mobile-bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  transform: translateY(calc(100% - 60px));
  transition: transform 0.3s ease;
  max-height: 70vh;
  display: none;
}

.mobile-bottom-sheet.visible {
  transform: translateY(0);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  margin: 0.75rem auto;
  cursor: pointer;
}

.sheet-header {
  padding: 0 1rem 1rem;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sheet-header h3 {
  color: #1e4da1;
  font-size: 1.1rem;
  font-weight: 600;
}

.sheet-content {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 1rem 2rem;
  max-height: calc(70vh - 100px);
}

/* Map Popup Styles */
.map-popup {
  width: 280px;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.popup-image {
  width: 100%;
  height: 120px;
  overflow: hidden;
}

.popup-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.popup-content {
  padding: 1rem;
}

.popup-name {
  color: #1e4da1;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.popup-name-en {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.popup-category {
  color: #2ec4b6;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.popup-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.popup-stars {
  color: #ffc107;
  font-size: 0.9rem;
}

.popup-rating-text {
  color: #666;
  font-size: 0.8rem;
}

.popup-address {
  color: #666;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.popup-status {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.popup-status.open {
  background: #d4edda;
  color: #155724;
}

.popup-status.closed {
  background: #f8d7da;
  color: #721c24;
}

.popup-btn {
  width: 100%;
  background: #2ec4b6;
  color: white;
  border: none;
  padding: 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

.popup-btn:hover {
  background: #26a69a;
}

/* Custom Map Markers */
.custom-marker {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #2ec4b6;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.custom-marker:hover {
  transform: scale(1.1);
}

.custom-marker.restaurant {
  background: #ff6b6b;
}

.custom-marker.grocery {
  background: #4ecdc4;
}

.custom-marker.medical {
  background: #45b7d1;
}

.custom-marker.legal {
  background: #96ceb4;
}

.custom-marker.realestate {
  background: #feca57;
}

.custom-marker.beauty {
  background: #ff9ff3;
}

.custom-marker.education {
  background: #54a0ff;
}

/* Minimal Footer */
.minimal-footer {
  background: #f8f9fa;
  padding: 2rem 0 1rem;
  border-top: 1px solid #e9ecef;
}

.minimal-footer .footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.minimal-footer .footer-section h4 {
  color: #1e4da1;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.minimal-footer .footer-section ul {
  list-style: none;
}

.minimal-footer .footer-section ul li {
  margin-bottom: 0.25rem;
}

.minimal-footer .footer-section ul li a {
  color: #666;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.minimal-footer .footer-section ul li a:hover {
  color: #2ec4b6;
}

.minimal-footer .social-links {
  display: flex;
  gap: 0.75rem;
}

.minimal-footer .social-link {
  display: inline-block;
  font-size: 1.2rem;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.minimal-footer .social-link:hover {
  transform: scale(1.2);
}

.minimal-footer .footer-bottom {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid #e9ecef;
  color: #666;
  font-size: 0.8rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .desktop-list {
    display: none;
  }

  .mobile-bottom-sheet {
    display: block;
  }

  .map-container {
    height: calc(100vh - 160px);
  }

  .filter-section {
    flex-direction: column;
    align-items: stretch;
  }

  .control-buttons {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .map-controls {
    padding: 0.75rem 0;
  }

  .search-container {
    max-width: 100%;
  }

  .category-chips {
    justify-content: center;
  }

  .filter-chip {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }

  .control-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }

  .map-container {
    height: calc(100vh - 140px);
  }

  .mobile-bottom-sheet {
    max-height: 60vh;
  }

  .sheet-content {
    max-height: calc(60vh - 100px);
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }

  .search-container {
    flex-direction: column;
  }

  .search-btn {
    border-radius: 0 0 12px 12px;
  }

  .category-chips {
    gap: 0.25rem;
  }

  .filter-chip {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
  }

  .control-buttons {
    flex-direction: column;
    gap: 0.25rem;
  }

  .control-btn {
    width: 100%;
    justify-content: center;
  }

  .map-container {
    height: calc(100vh - 120px);
  }

  .mobile-bottom-sheet {
    max-height: 50vh;
  }

  .sheet-content {
    max-height: calc(50vh - 100px);
  }

  .map-popup {
    width: 250px;
  }
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Map Overlay */
.map-overlay {
  position: absolute;
  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: 2000;
}

.map-overlay-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  max-width: 300px;
}

.map-overlay h3 {
  color: #1e4da1;
  margin-bottom: 1rem;
}

.map-overlay p {
  color: #666;
  margin-bottom: 1.5rem;
}

.map-overlay button {
  background: #2ec4b6;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

.map-overlay button:hover {
  background: #26a69a;
}

/* Scroll to Top Button */
.scroll-to-top {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: #1e4da1;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: bold;
  box-shadow: 0 4px 15px rgba(30, 77, 161, 0.3);
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  z-index: 1000;
}

.scroll-to-top.show {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  background: #2c5aa0;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30, 77, 161, 0.4);
}

/* Dark Mode Styles */
[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --text-color: #ffffff;
  --border-color: #333333;
  --card-bg: #2d2d2d;
  --input-bg: #3a3a3a;
  --hover-bg: #404040;
}

[data-theme="dark"] body {
  background-color: var(--bg-color) !important;
  color: var(--text-color) !important;
}

[data-theme="dark"] html {
  background-color: var(--bg-color) !important;
}

[data-theme="dark"] main {
  background-color: var(--bg-color) !important;
}

[data-theme="dark"] section {
  background-color: transparent;
}

/* Header and Footer Dark Mode */
[data-theme="dark"] .header {
  background: var(--card-bg) !important;
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .footer {
  background: var(--card-bg) !important;
  border-top-color: var(--border-color);
}

[data-theme="dark"] .header h1,
[data-theme="dark"] .header .logo-subtitle {
  color: var(--text-color);
}

[data-theme="dark"] .nav-link {
  color: var(--text-color);
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
  color: #2ec4b6;
}

[data-theme="dark"] .footer h3,
[data-theme="dark"] .footer h4,
[data-theme="dark"] .footer p,
[data-theme="dark"] .footer a {
  color: var(--text-color);
}

[data-theme="dark"] .footer a:hover {
  color: #2ec4b6;
}

/* Map Controls Dark Mode */
[data-theme="dark"] .map-controls {
  background: var(--card-bg);
  border-color: var(--border-color);
}

[data-theme="dark"] .map-search {
  background: var(--input-bg);
  color: var(--text-color);
  border-color: var(--border-color);
}

[data-theme="dark"] .map-search::placeholder {
  color: #999;
}

[data-theme="dark"] .category-chips {
  background: var(--bg-color);
}

[data-theme="dark"] .category-chip {
  background: var(--card-bg);
  color: var(--text-color);
  border-color: var(--border-color);
}

[data-theme="dark"] .category-chip:hover,
[data-theme="dark"] .category-chip.active {
  background: var(--hover-bg);
  color: var(--text-color);
}

[data-theme="dark"] .filter-controls {
  background: var(--card-bg);
  border-color: var(--border-color);
}

[data-theme="dark"] .filter-controls select {
  background: var(--input-bg);
  color: var(--text-color);
  border-color: var(--border-color);
}

[data-theme="dark"] .toggle-switch {
  background: var(--input-bg);
}

[data-theme="dark"] .toggle-switch.active {
  background: #2ec4b6;
}

[data-theme="dark"] .toggle-switch::before {
  background: var(--text-color);
}

/* Map Container Dark Mode */
[data-theme="dark"] .map-container {
  background: var(--bg-color);
}

/* Business List Dark Mode */
[data-theme="dark"] .business-list {
  background: var(--card-bg);
  border-color: var(--border-color);
}

[data-theme="dark"] .business-list h3 {
  color: var(--text-color);
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .business-item {
  background: var(--bg-color);
  border-color: var(--border-color);
}

[data-theme="dark"] .business-item:hover {
  background: var(--hover-bg);
}

[data-theme="dark"] .business-item h4 {
  color: var(--text-color);
}

[data-theme="dark"] .business-item p {
  color: var(--text-color);
  opacity: 0.8;
}

[data-theme="dark"] .business-item .category {
  background: var(--input-bg);
  color: var(--text-color);
}

[data-theme="dark"] .business-item .address {
  color: var(--text-color);
  opacity: 0.7;
}

[data-theme="dark"] .business-item .phone {
  color: var(--text-color);
  opacity: 0.7;
}

/* Map Overlay Dark Mode */
[data-theme="dark"] .map-overlay {
  background: rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .map-overlay-content {
  background: var(--card-bg);
  color: var(--text-color);
}

[data-theme="dark"] .map-overlay h3 {
  color: #2ec4b6;
}

[data-theme="dark"] .map-overlay p {
  color: var(--text-color);
  opacity: 0.8;
}

[data-theme="dark"] .map-overlay button {
  background: #2ec4b6;
  color: white;
}

[data-theme="dark"] .map-overlay button:hover {
  background: #26a69a;
}

/* Scroll to Top Button Dark Mode */
[data-theme="dark"] .scroll-to-top {
  background: #1e4da1;
  color: white;
  box-shadow: 0 4px 15px rgba(30, 77, 161, 0.3);
}

[data-theme="dark"] .scroll-to-top:hover {
  background: #2c5aa0;
  box-shadow: 0 6px 20px rgba(30, 77, 161, 0.4);
}

/* General Dark Mode Text */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
  color: var(--text-color) !important;
}

[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] div {
  color: var(--text-color);
}

/* Mobile Dark Mode Adjustments */
@media (max-width: 768px) {
  [data-theme="dark"] .map-controls {
    background: var(--card-bg);
  }

  [data-theme="dark"] .business-list {
    background: var(--card-bg);
  }

  [data-theme="dark"] .business-item {
    background: var(--bg-color);
  }

  .scroll-to-top {
    bottom: 80px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .scroll-to-top {
    bottom: 70px;
    right: 15px;
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }
}
