/* ============================================
   Shared Sidebar Component Styles
   ============================================ */

:root {
  --sidebar-width: 220px;
  --sidebar-photo-size: 120px;
  --sidebar-photo-size-mobile: 48px;
  --sidebar-gap: 1rem;
}

/* ============================================
   Desktop Sidebar (≥900px)
   ============================================ */

.profile-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  padding: 0;
}

.sidebar-desktop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sidebar-gap);
}

.sidebar-photo {
  width: var(--sidebar-photo-size);
  height: var(--sidebar-photo-size);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
  transition: transform 200ms ease;
  margin-bottom: 0.5rem;
}

.sidebar-photo:hover {
  transform: scale(1.05);
}

.sidebar-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  margin-top: 0.75rem;
}

.sidebar-subtitle {
  font-size: 0.85rem;
  color: #478ac9;
  text-align: center;
  font-weight: 500;
}

.sidebar-divider {
  width: 40%;
  height: 1px;
  background: var(--color-border);
  margin: 0.5rem 0;
}

.sidebar-links {
  list-style: none;
  width: 100%;
  padding: 0;
  margin: 0.5rem 0;
}

.sidebar-links li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.5rem;
  margin: 0;
}

.sidebar-links a,
.sidebar-links span {
  text-decoration: none;
  border: none;
  color: #333;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 200ms ease, opacity 200ms ease;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  opacity: 0.65;
}

.sidebar-links a:hover {
  color: #478ac9;
  opacity: 1;
}

.sidebar-icon {
  width: 1.2rem;
  height: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.material-icons-sidebar {
  font-size: 1.2rem;
  line-height: 1;
}

/* ============================================
   Mobile Sidebar (<900px)
   ============================================ */

.sidebar-mobile {
  display: none;
}

.sidebar-mobile-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: white;
  border-bottom: 1px solid var(--color-border);
  margin: 0;
}

.sidebar-mobile-photo {
  width: var(--sidebar-photo-size-mobile);
  height: var(--sidebar-photo-size-mobile);
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

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

.sidebar-mobile-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-ink);
  margin: 0;
}

.follow-btn {
  padding: 0.5rem 1rem;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 200ms ease;
  flex-shrink: 0;
}

.follow-btn:hover {
  background: #2563eb;
}

/* ============================================
   Social Links Popup (Mobile)
   ============================================ */

.follow-popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.follow-popup.is-open {
  display: flex;
}

.follow-popup-content {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: popupSlideIn 300ms ease;
}

@keyframes popupSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.follow-popup-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-ink);
  margin: 0 0 1.5rem;
  text-align: center;
}

.follow-popup-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.follow-popup-links li {
  margin: 0;
}

.follow-popup-links a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--color-surface);
  color: var(--color-ink);
  text-decoration: none;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-weight: 500;
  transition: background 200ms ease, border-color 200ms ease;
}

.follow-popup-links a:hover {
  background: var(--primary-soft);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.follow-popup-links .sidebar-icon {
  width: 1.4rem;
  height: 1.4rem;
}

.follow-popup-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--color-ink-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 200ms ease;
}

.follow-popup-close:hover {
  color: var(--color-ink);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 899px) {
  .sidebar-desktop {
    display: none;
  }

  .sidebar-mobile {
    display: block;
  }

  .profile-sidebar {
    width: 100%;
    position: static;
    max-height: none;
    padding: 0;
  }
}

/* ============================================
   Scrollbar styling
   ============================================ */

.profile-sidebar::-webkit-scrollbar {
  width: 6px;
}

.profile-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.profile-sidebar::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

.profile-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--color-ink-muted);
}
