/* ============================================
   PinDrop Responsive Styles
   ============================================ */

/* ---- Tablet (≤ 1024px) ---- */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 360px;
  }

  .navbar-center {
    padding: 0 var(--space-4);
  }

  .search-bar {
    max-width: 400px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
}


/* ---- Mobile (≤ 768px) ---- */
@media (max-width: 768px) {
  :root {
    --nav-height: 56px;
    --sidebar-width: 100%;
  }

  .navbar {
    padding: 0 var(--space-4);
  }

  .navbar-brand span {
    display: none;
  }

  .navbar-center {
    padding: 0 var(--space-2);
  }

  .search-bar {
    max-width: none;
  }

  .user-menu-name {
    display: none;
  }

  /* Side panel takes full width on mobile */
  .side-panel {
    width: 100%;
    top: var(--nav-height);
    height: calc(100vh - var(--nav-height));
  }

  .side-panel-hero {
    height: 180px;
  }

  /* Map category bar */
  .map-category-bar {
    bottom: var(--space-4);
    left: var(--space-3);
    right: var(--space-3);
    transform: none;
    max-width: none;
    border-radius: var(--radius-lg);
  }

  .add-place-fab {
    bottom: 76px;
    right: var(--space-4);
    width: 48px;
    height: 48px;
  }

  .add-place-fab-tooltip {
    display: none;
  }

  /* Modal */
  .modal-overlay {
    padding: var(--space-3);
    align-items: flex-end;
  }

  .modal {
    max-height: 85vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }

  .modal-lg,
  .modal-xl {
    max-width: 100%;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  /* Toast */
  .toast-container {
    left: var(--space-3);
    right: var(--space-3);
  }

  .toast {
    min-width: auto;
    max-width: none;
  }

  /* Dashboard */
  .dashboard-container {
    padding: var(--space-4);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Profile */
  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .profile-stats {
    justify-content: center;
  }

  /* Gallery */
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  /* Map instruction */
  .map-instruction {
    left: var(--space-3);
    right: var(--space-3);
    transform: none;
    text-align: center;
    justify-content: center;
  }
}


/* ---- Small Mobile (≤ 480px) ---- */
@media (max-width: 480px) {
  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }
  h3 { font-size: var(--text-lg); }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .modal-header h3 {
    font-size: var(--text-base);
  }

  .btn-lg {
    padding: 0.625rem 1.25rem;
    font-size: var(--text-sm);
  }

  .image-preview-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}


/* ---- Dashboard Layout ---- */
.dashboard-view {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface-secondary);
  overflow-y: auto;
  z-index: var(--z-base);
}

.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-8);
}

.dashboard-header {
  margin-bottom: var(--space-8);
}

.dashboard-header h2 {
  margin-bottom: var(--space-2);
}

.dashboard-header p {
  color: var(--text-secondary);
  font-size: var(--text-base);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-6);
}

.dashboard-section {
  background: var(--surface-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.dashboard-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-light);
}

.dashboard-section-header h4 {
  font-size: var(--text-base);
  font-weight: 600;
}

.dashboard-section-content {
  padding: 0;
}


/* ---- Profile View ---- */
.profile-view {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface-secondary);
  overflow-y: auto;
  z-index: var(--z-base);
}

.profile-container {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-8);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  background: var(--surface-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  margin-bottom: var(--space-6);
}

.profile-info {
  flex: 1;
}

.profile-name {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.profile-email {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.profile-bio {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
}

.profile-stats {
  display: flex;
  gap: var(--space-6);
}

.profile-stat {
  text-align: center;
}

.profile-stat-value {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-primary-600);
}

.profile-stat-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-section {
  background: var(--surface-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  overflow: hidden;
}

.profile-section-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-light);
}

.profile-section-header h4 {
  font-size: var(--text-base);
  font-weight: 600;
}

.profile-places-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-4);
  padding: var(--space-4);
}


/* ---- Activity Feed Item ---- */
.activity-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--color-gray-100);
  transition: background var(--transition-fast);
}

.activity-item:hover {
  background: var(--color-gray-50);
}

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

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-primary-500);
  flex-shrink: 0;
  margin-top: 6px;
}

.activity-dot.review { background: var(--color-warning-500); }
.activity-dot.place { background: var(--color-success-500); }

.activity-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

.activity-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.activity-time {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}


/* ---- Leaderboard Item ---- */
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--color-gray-100);
}

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

.leaderboard-rank {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--color-gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.leaderboard-item:nth-child(1) .leaderboard-rank {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
}

.leaderboard-item:nth-child(2) .leaderboard-rank {
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
  color: white;
}

.leaderboard-item:nth-child(3) .leaderboard-rank {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: white;
}

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

.leaderboard-name {
  font-size: var(--text-sm);
  font-weight: 600;
}

.leaderboard-detail {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.leaderboard-score {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-primary-600);
}
