:root {
  --primary: #E11D48;
  --primary-hover: #BE185D;
  --primary-light: #FFDADA;
  --primary-soft: #FFF1F3;
  --background: #F8FAFC;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.5;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.app-header {
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #FF4D6D 0%, #E11D48 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
}

.brand-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.brand-info h1 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.badge-guest {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-download-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.28);
}

.btn-download-top:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.35);
}

/* Main Layout */
.app-container {
  flex: 1;
  display: flex;
  height: calc(100vh - 64px);
  position: relative;
  overflow: hidden;
}

/* Sidebar / Feed Column */
.sidebar {
  width: 460px;
  max-width: 100%;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
  z-index: 500;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

/* Location Control Box */
.location-panel {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  background: var(--surface);
}

.search-box {
  position: relative;
  margin-bottom: 12px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--primary);
  background: var(--surface);
}

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 220px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.search-item {
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-item:last-child {
  border-bottom: none;
}

.search-item:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

/* Active Location Card */
.active-location-card {
  background: var(--primary-soft);
  border: 1px solid #FFCCD5;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.loc-details {
  flex: 1;
  min-width: 0;
}

.loc-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.loc-title svg {
  color: var(--primary);
  flex-shrink: 0;
}

.loc-address {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.btn-locate {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--primary);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  transition: all 0.2s;
}

.btn-locate:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Nearby Venues Chips */
.nearby-venues-container {
  padding: 12px 20px 8px 20px;
  border-bottom: 1px solid var(--border-light);
  background: var(--surface);
}

.nearby-venues-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.radius-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

.venue-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.venue-chips::-webkit-scrollbar {
  display: none;
}

.venue-chip {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.venue-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.venue-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Feed Tabs */
.feed-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.feed-tab {
  flex: 1;
  text-align: center;
  padding: 12px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.feed-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Feed Scrollable List */
.feed-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--background);
}

/* Announcement Card */
.anons-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
  position: relative;
}

.anons-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #CBD5E1;
}

.anons-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.anons-venue-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.megaphone-circle {
  width: 36px;
  height: 36px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.venue-texts {
  min-width: 0;
}

.anons-place-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.anons-place-address {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.distance-pill {
  background: #F1F3FF;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  flex-shrink: 0;
}

.anons-body {
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 14px;
  word-break: break-word;
}

.anons-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-muted);
}

.anons-time {
  display: flex;
  align-items: center;
  gap: 4px;
}

.anons-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #F1F3FF;
  border: none;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.action-btn-pill:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.action-btn-pill.comment {
  background: var(--primary-soft);
  color: var(--primary);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto;
}

.empty-icon {
  width: 64px;
  height: 64px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.empty-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-desc {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 320px;
  margin-bottom: 20px;
}

.btn-post-anons {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.2s;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.2);
}

.btn-post-anons:hover {
  opacity: 0.9;
}

/* Loading Skeleton */
.skeleton-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border);
}

.skeleton-line {
  height: 12px;
  background: #E2E8F0;
  border-radius: 6px;
  margin-bottom: 8px;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}

/* Map Column */
.map-view-wrapper {
  flex: 1;
  height: 100%;
  position: relative;
}

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

/* Floating Controls on Map */
.map-floating-bar {
  position: absolute;
  top: 16px;
  left: 20px;
  right: 20px;
  z-index: 400;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.map-floating-bar > * {
  pointer-events: auto;
}

.map-hint-pill {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.map-hint-pill svg {
  color: var(--primary);
}

.map-radius-selector {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-radius-selector label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.map-radius-selector select {
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  outline: none;
  cursor: pointer;
}

/* Mobile Toggle Switch */
.mobile-view-toggle {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: white;
  border-radius: var(--radius-full);
  padding: 8px 18px;
  z-index: 1000;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  border: none;
  font-size: 14px;
  font-weight: 700;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

/* Custom Marker CSS */
.custom-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.pin-center {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 4px 10px rgba(225, 29, 72, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.pin-pulse {
  position: absolute;
  width: 48px;
  height: 48px;
  background: rgba(225, 29, 72, 0.25);
  border-radius: 50%;
  animation: markerPulse 2s infinite;
  pointer-events: none;
}

@keyframes markerPulse {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

.venue-marker {
  background: white;
  border: 2px solid var(--primary);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transform: translate(-50%, -100%);
  cursor: pointer;
}

.venue-marker:hover {
  background: var(--primary);
  color: white;
}

.venue-marker .count-badge {
  background: var(--primary);
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.venue-marker:hover .count-badge {
  background: white;
  color: var(--primary);
}

/* Dialog / Download Modal (Modern Native <dialog>) */
dialog.app-modal {
  margin: auto;
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  background: var(--surface);
  overflow: hidden;
}

dialog.app-modal::backdrop {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  padding: 32px 28px;
  position: relative;
  text-align: center;
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--background);
  border: 1px solid var(--border);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: #E2E8F0;
  color: var(--text-primary);
}

.modal-icon-badge {
  width: 68px;
  height: 68px;
  background: var(--primary-light);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  color: var(--primary);
}

.modal-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.modal-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

.feature-benefits {
  background: var(--background);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: left;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.benefit-item svg {
  color: var(--primary);
  flex-shrink: 0;
}

.store-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.store-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.store-btn.google-play {
  background: #0F172A;
  color: white;
}

.store-btn.google-play:hover {
  background: #1E293B;
  transform: translateY(-1px);
}

.store-btn.app-store {
  background: #000000;
  color: white;
}

.store-btn.app-store:hover {
  background: #1C1C1E;
  transform: translateY(-1px);
}

.store-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.qr-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.qr-box {
  width: 80px;
  height: 80px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-box img {
  width: 100%;
  height: 100%;
}

.qr-text {
  text-align: left;
  font-size: 12px;
  color: var(--text-secondary);
}

.qr-text strong {
  display: block;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 2px;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #0F172A;
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  .app-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: 50%;
  }

  .map-view-wrapper {
    height: 50%;
  }
}

@media (max-width: 640px) {
  .app-header {
    padding: 0 16px;
  }

  .badge-guest {
    display: none;
  }

  .btn-download-top span {
    display: none;
  }

  .btn-download-top {
    padding: 8px 12px;
  }

  .mobile-view-toggle {
    display: flex;
  }

  .app-container {
    position: relative;
    height: calc(100vh - 64px);
  }

  .sidebar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    transition: transform 0.3s ease;
  }

  .sidebar.view-map {
    transform: translateY(100%);
    pointer-events: none;
  }

  .map-view-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    z-index: 100;
  }
}
