/**
 * Profile Pages Styling
 * 
 * Styles for user profile view and edit pages
 */

/* ============================================================================
   Profile View
   ============================================================================ */

/* Profile page uses explore-page as base for consistent styling */
.profile-page {
  /* Inherits from .explore-page in explore-v2.css */
}

/* Profile timeline area - wrapper for timeline sections */
.profile-timeline-area {
  position: relative;
  width: 100%;
}

/* Profile content container - centered content area */
.profile-content-container {
  /* Inherits from .section-container in explore-v2.css */
  padding-bottom: var(--spacing-xl);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  width: calc(100% - 160px);
  margin: 1.5rem auto 2rem;
  transition: all var(--transition-slower);
  position: relative;
  /* overflow: hidden removed - was clipping avatar */
}

.profile-header::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  padding: 1px;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.15), 
    rgba(255, 255, 255, 0.02)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(var(--color-primary-rgb), 0.5);
  box-shadow: 0 0 20px rgba(var(--color-primary-rgb), 0.3);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.profile-avatar img:hover {
  border-color: rgba(var(--color-primary-rgb), 0.8);
  box-shadow: 0 0 30px rgba(var(--color-primary-rgb), 0.5);
}

.profile-info {
  flex: 1;
}

.profile-info h1 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
}

.profile-joined {
  color: var(--text-secondary, #666);
  font-size: 0.9rem;
}

.profile-actions {
  flex-shrink: 0;
}

.profile-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.profile-section {
  background: rgba(24, 34, 54, 0.5);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid var(--color-border-secondary);
  border-radius: var(--radius-xl);
  box-shadow: 0 0 20px rgba(var(--color-primary-rgb), 0.15);
  padding: 2rem;
  transition: all var(--transition-slower);
  position: relative;
  overflow: hidden;
}

.profile-section::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  padding: 1px;
  background: linear-gradient(135deg, 
    rgba(var(--color-primary-rgb), 0.3), 
    rgba(var(--color-primary-rgb), 0.1)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.profile-section:hover {
  border-color: rgba(var(--color-primary-rgb), 0.4);
  box-shadow: 0 0 30px rgba(var(--color-primary-rgb), 0.25);
}

.profile-section h2 {
  margin: 0 0 1rem;
  font-size: 1.4rem;
  border-bottom: 2px solid rgba(var(--color-primary-rgb), 0.2);
  padding-bottom: 0.5rem;
  color: var(--color-text-primary);
  position: relative;
  z-index: 1;
}

.profile-bio {
  color: var(--color-text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
  position: relative;
  z-index: 1;
}

/* ============================================================================
   Favorite Teams
   ============================================================================ */

.favorite-teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(24, 34, 54, 0.4);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border: 1px solid var(--color-border-secondary);
  border-radius: var(--radius-lg);
  transition: all var(--transition-slow);
  cursor: pointer;
}

.team-card:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--color-primary-rgb), 0.5);
  box-shadow: 0 8px 20px rgba(var(--color-primary-rgb), 0.2);
  background: rgba(24, 34, 54, 0.6);
}

.team-card img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.team-card span {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text-primary);
}

/* ============================================================================
   Dashboards Grid
   ============================================================================ */

.dashboards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

/* ============================================================================
   Profile Edit
   ============================================================================ */

.profile-edit-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.profile-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.profile-edit-header h1 {
  margin: 0;
}

.profile-edit-form {
  background: rgba(24, 34, 54, 0.5);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid var(--color-border-secondary);
  border-radius: var(--radius-xl);
  box-shadow: 0 0 20px rgba(var(--color-primary-rgb), 0.15);
  padding: 2rem;
  transition: all var(--transition-slower);
  position: relative;
  overflow: hidden;
}

.profile-edit-form::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  padding: 1px;
  background: linear-gradient(135deg, 
    rgba(var(--color-primary-rgb), 0.3), 
    rgba(var(--color-primary-rgb), 0.1)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.form-section {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.2);
  position: relative;
  z-index: 1;
}

.form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.form-section h2 {
  margin: 0 0 1.5rem;
  font-size: 1.3rem;
  color: var(--color-text-primary);
}

/* ============================================================================
   Avatar Upload
   ============================================================================ */

.avatar-upload {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.avatar-preview {
  flex-shrink: 0;
}

.avatar-preview img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(var(--color-primary-rgb), 0.5);
  box-shadow: 0 0 20px rgba(var(--color-primary-rgb), 0.3);
  transition: all var(--transition-slow);
}

.avatar-preview img:hover {
  border-color: rgba(var(--color-primary-rgb), 0.8);
  box-shadow: 0 0 30px rgba(var(--color-primary-rgb), 0.5);
}

.avatar-upload-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ============================================================================
   Team Selector
   ============================================================================ */

.team-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(24, 34, 54, 0.3);
  border: 1px solid var(--color-border-secondary);
  border-radius: var(--radius-lg);
  max-height: 400px;
  overflow-y: auto;
}

.team-selector-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem;
  background: rgba(24, 34, 54, 0.5);
  border: 2px solid var(--color-border-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-slow);
}

.team-selector-btn:hover {
  border-color: rgba(var(--color-primary-rgb), 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.2);
  background: rgba(24, 34, 54, 0.7);
}

.team-selector-btn.selected {
  border-color: rgba(var(--color-primary-rgb), 0.8);
  background: rgba(var(--color-primary-rgb), 0.2);
  box-shadow: 0 0 15px rgba(var(--color-primary-rgb), 0.3);
}

.team-selector-btn img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.team-selector-btn span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.selected-teams {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  min-height: 50px;
}

.team-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(var(--color-primary-rgb), 0.3);
  border: 1px solid rgba(var(--color-primary-rgb), 0.5);
  color: var(--color-text-primary);
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-slow);
}

.team-chip:hover {
  background: rgba(var(--color-primary-rgb), 0.4);
  border-color: rgba(var(--color-primary-rgb), 0.7);
}

.team-chip img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  padding: 2px;
}

.remove-team-btn {
  background: rgba(var(--color-primary-rgb), 0.3);
  border: 1px solid rgba(var(--color-primary-rgb), 0.5);
  color: var(--color-text-primary);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-slow);
}

.remove-team-btn:hover {
  background: rgba(var(--color-primary-rgb), 0.5);
  border-color: rgba(var(--color-primary-rgb), 0.8);
  transform: scale(1.1);
}

/* ============================================================================
   Buttons
   ============================================================================ */

.btn-primary,
.btn-secondary {
  padding: 0.75rem 1.5rem;
  border: 1px solid;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-slow);
  text-align: center;
  text-decoration: none;
  display: inline-block;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: rgba(var(--color-primary-rgb), 0.2);
  border-color: rgba(var(--color-primary-rgb), 0.5);
  color: var(--color-text-primary);
  box-shadow: 0 0 20px rgba(var(--color-primary-rgb), 0.3);
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, 
    rgba(var(--color-primary-rgb), 0.3), 
    rgba(var(--color-primary-rgb), 0.1)
  );
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.btn-primary:hover:not(:disabled) {
  background: rgba(var(--color-primary-rgb), 0.3);
  border-color: rgba(var(--color-primary-rgb), 0.8);
  box-shadow: 0 0 30px rgba(var(--color-primary-rgb), 0.5);
  transform: translateY(-2px);
}

.btn-primary:hover:not(:disabled)::before {
  opacity: 1;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: rgba(24, 34, 54, 0.5);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border-color: rgba(var(--color-primary-rgb), 0.3);
  color: var(--color-text-primary);
  box-shadow: 0 0 15px rgba(var(--color-primary-rgb), 0.2);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(24, 34, 54, 0.7);
  border-color: rgba(var(--color-primary-rgb), 0.5);
  box-shadow: 0 0 25px rgba(var(--color-primary-rgb), 0.3);
  transform: translateY(-2px);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Edit profile button in header */
.profile-actions .btn-secondary {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* Cancel/Back link button */
.btn-link {
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  transition: all var(--transition-slow);
  display: inline-block;
}

.btn-link:hover {
  color: rgba(var(--color-primary-rgb), 1);
  text-decoration: none;
}

/* ============================================================================
   Form Actions
   ============================================================================ */

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-start;
  align-items: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(var(--color-primary-rgb), 0.2);
  position: relative;
  z-index: 1;
}

/* ============================================================================
   Profile Topics Section (Scrollable Topic Cards Row)
   ============================================================================ */

.profile-topics-section {
  margin-bottom: 2.5rem;
}

.profile-topics-section .section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.profile-topics-section .section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
}

.profile-topics-section .section-title-text {
  position: relative;
  display: inline-block;
  padding-bottom: 6px;
}

.profile-topics-section .section-title-text::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #00a8ff 0%, #33c4ff 50%, #00a8ff 100%);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(0, 168, 255, 0.5);
}

.profile-topics-grid {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  overflow-y: visible;
  padding: 0.75rem 0 0.5rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.profile-topics-grid::-webkit-scrollbar {
  display: none;
}

/* Topic cards in profile - uses topic-preview-card base from explore-v2 */
.profile-topics-grid .topic-preview-card {
  flex: 0 0 200px;
  height: 120px;
  min-height: 120px;
}

/* Topic rank pill - top right corner */
.profile-topics-grid .topic-rank-pill {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 3;
  padding: 0.25rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-pill);
  box-shadow:
    0 0 12px rgba(255, 255, 255, 0.15),
    0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* ============================================================================
   Profile Timeline Section (Horizontal Carousel - uses explore-v2.css styles)
   ============================================================================ */

/* Profile timeline section - positioned outside container like explore page */
.profile-timeline-section {
  position: relative;
  margin-bottom: 2rem;
  overflow: visible;
}

/* Override explore-v2 carousel padding to accommodate topic pills and action buttons */
.profile-timeline-section .timeline-carousel-wrapper {
  overflow: visible;
  padding-bottom: 80px; /* Space for timeline bar */
  min-height: 400px;
}

.profile-timeline-section .timeline-carousel {
  /* No topic pills on profile page, so less top padding needed */
  padding-top: 12px;
  padding-bottom: 16px;
  overflow-x: auto;
  overflow-y: visible;
  min-height: 320px;
}

/* Ensure cards can show content above/below */
.profile-timeline-section .carousel-post-card {
  overflow: visible;
}

/* Twitter embed cards - ALL transparent (matching explore page behavior) */
.profile-timeline-section .carousel-post-card.twitter-embed-card {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.profile-timeline-section .carousel-post-card.twitter-embed-card.featured {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  height: auto !important;
  min-height: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.profile-timeline-section .carousel-post-card.twitter-embed-card.featured .post-embed-container {
  height: auto;
  flex: 0 0 auto;
}

.profile-timeline-section .carousel-post-card.twitter-embed-card.featured .tweet-container {
  height: auto;
}

.profile-timeline-section .carousel-post-card.twitter-embed-card.featured .carousel-card-actions {
  position: relative;
  bottom: auto;
  margin-top: -20px;
}

.profile-timeline-section .carousel-post-card.twitter-embed-card:not(.featured) {
  opacity: 0.5;
  filter: brightness(0.7);
  transform: scale(0.9);
  overflow: hidden;
}

/* Post embed container - transparent and overflow visible for Twitter cards */
.profile-timeline-section .carousel-post-card.twitter-embed-card .post-embed-container {
  background: transparent !important;
  overflow: visible;
}

/* Tweet container - overflow visible to prevent border clipping at corners */
.profile-timeline-section .carousel-post-card .tweet-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  width: 100%;
  background: transparent !important;
  border-radius: 12px !important;
  overflow: visible !important;
}

/* Twitter tweet element - overflow visible to prevent border clipping */
.profile-timeline-section .carousel-post-card .twitter-tweet {
  margin: 0 auto !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  border-radius: 12px !important;
  overflow: visible !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Twitter iframe - keep overflow hidden to clip iframe content */
.profile-timeline-section .carousel-post-card .twitter-tweet iframe {
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  box-shadow: none !important;
}

/* Target the Twitter widget wrapper after it renders */
.profile-timeline-section .carousel-post-card .twitter-tweet-rendered-true {
  border-radius: 12px !important;
  overflow: visible !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Timeline bar positioning - override default margin-top */
.profile-timeline-section .carousel-timeline-bar {
  margin-top: 360px; /* Default, JS will adjust based on card height */
}

/* Timeline empty state */
.timeline-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-secondary);
}

.timeline-empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.timeline-empty-state h3 {
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
  color: var(--color-text-primary);
}

.timeline-empty-state p {
  font-size: 0.9rem;
  margin: 0;
  color: var(--color-text-muted);
}

/* ============================================================================
   Responsive Timeline & Topics
   ============================================================================ */

@media (max-width: 768px) {
  .profile-topics-section {
    margin-bottom: 1.5rem;
  }

  .profile-topics-section .section-title {
    font-size: 1.1rem;
  }

  .profile-topics-grid .topic-preview-card {
    flex: 0 0 160px;
    height: 100px;
    min-height: 100px;
  }

  .profile-timeline-section {
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 480px) {
  .profile-topics-grid .topic-preview-card {
    flex: 0 0 140px;
    height: 90px;
    min-height: 90px;
  }
}

/* ============================================================================
   Loading & Empty States
   ============================================================================ */

.loading-state,
.empty-state,
.error-state {
  text-align: center;
  padding: var(--spacing-4xl) var(--spacing-xl);
  color: var(--color-text-secondary);
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(var(--color-primary-rgb), 0.1);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto var(--spacing-xl);
}

/* @keyframes spin defined in loading-states.css */

.error-icon {
  font-size: 4rem;
  margin-bottom: var(--spacing-xl);
}

.empty-state p {
  font-size: var(--font-size-lg);
  margin-bottom: var(--spacing-xl);
}

.empty-state .btn {
  display: inline-block;
  padding: var(--spacing-md) var(--spacing-2xl);
  background: rgba(var(--color-primary-rgb), 0.2);
  color: var(--color-primary);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  transition: all var(--transition-base);
  box-shadow: 0 0 16px rgba(var(--color-primary-rgb), 0.3);
}

.empty-state .btn:hover {
  background: rgba(var(--color-primary-rgb), 0.3);
  box-shadow: 0 0 24px rgba(var(--color-primary-rgb), 0.5);
  transform: translateY(-1px);
}

/* ============================================================================
   Edit Profile Button
   ============================================================================ */

.btn-edit-profile {
  padding: var(--spacing-sm) var(--spacing-xl);
  background: rgba(var(--color-primary-rgb), 0.2);
  color: var(--color-primary);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 0 16px rgba(var(--color-primary-rgb), 0.3);
}

.btn-edit-profile:hover {
  background: rgba(var(--color-primary-rgb), 0.3);
  box-shadow: 0 0 24px rgba(var(--color-primary-rgb), 0.5);
  transform: translateY(-1px);
}

.profile-username {
  font-size: 2rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin: 0 0 var(--spacing-sm);
}

.profile-bio {
  font-size: var(--font-size-md);
  color: var(--color-text-secondary);
  margin: 0;
}

/* ============================================================================
   Profile Social Links
   ============================================================================ */

.profile-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
}

.profile-social-link {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: var(--spacing-xs) var(--spacing-sm);
  background: rgba(var(--color-primary-rgb), 0.1);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.profile-social-link:hover {
  background: rgba(var(--color-primary-rgb), 0.2);
  color: var(--color-primary);
}

.profile-social-link svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

/* Legacy support */
.profile-twitter-link {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: var(--spacing-xs) var(--spacing-sm);
  background: rgba(var(--color-primary-rgb), 0.1);
  border-radius: var(--radius-sm);
  margin-top: var(--spacing-sm);
  transition: all 0.2s ease;
}

.profile-twitter-link:hover {
  background: rgba(var(--color-primary-rgb), 0.2);
  color: var(--color-primary);
}

.profile-twitter-link svg {
  flex-shrink: 0;
}

/* Social Links Edit Form Group */
.social-links-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.social-link-input {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.social-link-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
}

.social-link-icon svg {
  width: 18px;
  height: 18px;
}

.social-link-input input {
  flex: 1;
  padding: var(--spacing-sm) var(--spacing-md);
  background: rgba(var(--color-primary-rgb), 0.05);
  border: 1px solid rgba(var(--color-primary-rgb), 0.2);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.social-link-input input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

.social-link-input input::placeholder {
  color: var(--color-text-disabled);
}

/* ============================================================================
   Profile Favorites Display
   ============================================================================ */

.profile-favorites,
.profile-favorites-tab {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: var(--spacing-lg);
}

.favorites-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: var(--spacing-md);
  background: rgba(var(--color-bg-card-rgb), 0.5);
  border-radius: var(--radius-md);
  border: 1px solid rgba(var(--color-primary-rgb), 0.1);
}

.favorites-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: #33c4ff;
  text-shadow: 0 0 10px rgba(0, 168, 255, 0.6), 0 0 20px rgba(0, 168, 255, 0.4);
  min-width: 80px;
  flex-shrink: 0;
  padding-top: 0.125rem;
}

.favorites-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
  flex: 1;
}

.favorite-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-sm, 4px);
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  transition: all var(--transition-fast);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.favorite-pill:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.favorite-pill.sport,
.favorite-pill.league,
.favorite-pill.topic {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ============================================================================
   Multi-Select Dropdowns (Edit Modal)
   ============================================================================ */

.multi-select-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.selected-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 32px;
}

.selected-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.5rem 0.25rem 0.625rem;
  border-radius: var(--radius-sm, 4px);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  cursor: default;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.selected-pill.sport,
.selected-pill.league,
.selected-pill.topic {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.selected-pill .remove-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  border-radius: 50%;
  font-size: 10px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.selected-pill .remove-pill:hover {
  background: rgba(255, 255, 255, 0.2);
}

.multi-select-dropdown {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(24, 34, 54, 0.8);
  border: 1px solid rgba(var(--color-primary-rgb), 0.3);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.multi-select-dropdown:hover {
  border-color: rgba(var(--color-primary-rgb), 0.5);
  background: rgba(24, 34, 54, 0.9);
}

.multi-select-dropdown:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.2);
}

.multi-select-dropdown option {
  background: rgb(24, 34, 54);
  color: var(--color-text-primary);
  padding: 0.5rem;
}

/* Topics Search Input */
.topics-search-wrapper {
  position: relative;
  z-index: 10;
}

/* Ensure the form group containing topics allows overflow */
.edit-form-group:has(.topics-search-wrapper) {
  overflow: visible;
}

.topics-search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(var(--color-bg-base-rgb), 0.5);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
}

.topics-search-input:focus {
  outline: none;
  border-color: var(--color-border-primary);
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.2);
}

.topics-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  margin-top: 4px;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.topics-dropdown-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background var(--transition-fast);
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
}

.topics-dropdown-item:hover {
  background: rgba(var(--color-primary-rgb), 0.1);
}

.topics-dropdown-empty {
  padding: 0.75rem 1rem;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  text-align: center;
}

/* ============================================================================
   Toast Notification
   ============================================================================ */

.toast-saved {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  padding: 12px 24px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-md);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast-saved.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-saved .toast-icon {
  font-size: 1.2em;
}

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

@media (max-width: 1200px) {
  .indexes-grid {
    grid-template-columns: repeat(2, 340px);
  }
}

@media (max-width: 768px) {
  .profile-content-container {
    padding: 0 var(--spacing-lg) var(--spacing-xl);
  }

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

  .profile-avatar {
    width: 100px;
    height: 100px;
  }

  .profile-actions {
    width: 100%;
  }

  .profile-actions .btn-secondary {
    width: 100%;
  }

  .avatar-upload {
    flex-direction: column;
    text-align: center;
  }

  .team-selector {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  }

  .favorite-teams-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }

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

  .indexes-grid .index-card {
    max-width: none;
  }

  .profile-tabs {
    overflow-x: auto;
  }
}

@media (max-width: 480px) {
  .profile-edit-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .form-actions .btn-primary {
    width: 100%;
  }
}

/* ============================================================================
   Edit Profile Modal
   ============================================================================ */

.edit-profile-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: var(--spacing-lg);
}

.edit-profile-modal-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.edit-profile-modal {
  background: var(--color-bg-card);
  border: 1px solid rgba(var(--color-primary-rgb), 0.3);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: visible;
  display: flex;
  flex-direction: column;
  box-shadow: 
    0 0 40px rgba(var(--color-primary-rgb), 0.2),
    0 20px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s ease;
}

.edit-profile-modal-overlay.show .edit-profile-modal {
  transform: translateY(0) scale(1);
}

.edit-profile-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-lg) var(--spacing-xl);
  border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.2);
}

.edit-profile-modal-header h3 {
  margin: 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
}

.edit-profile-modal-body {
  padding: var(--spacing-xl);
  padding-bottom: calc(var(--spacing-xl) + 60px); /* Extra padding for dropdown overflow */
  overflow-y: auto;
  overflow-x: visible;
  flex: 1;
  min-height: 0; /* Important for flex overflow */
}

.edit-profile-form {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: calc(90vh - 60px); /* Account for header */
  overflow: hidden;
}

.edit-form-group {
  margin-bottom: var(--spacing-xl);
}

.edit-form-group:last-child {
  margin-bottom: 0;
}

.edit-form-group label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.edit-form-group input[type="text"],
.edit-form-group textarea {
  width: 100%;
  padding: var(--spacing-md);
  background: rgba(var(--color-primary-rgb), 0.05);
  border: 1px solid rgba(var(--color-primary-rgb), 0.2);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: var(--font-size-md);
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.edit-form-group input[type="text"]:focus,
.edit-form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

.edit-form-group input[type="text"]::placeholder,
.edit-form-group textarea::placeholder {
  color: var(--color-text-disabled);
}

.edit-form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.field-hint {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: var(--spacing-xs);
}

.field-error {
  display: block;
  font-size: var(--font-size-xs);
  color: #ef4444;
  margin-top: var(--spacing-xs);
  min-height: 1.2em;
}

/* Avatar Upload Section */
.avatar-upload-section {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-lg);
}

.avatar-preview-container {
  flex-shrink: 0;
}

.avatar-preview-container img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(var(--color-primary-rgb), 0.3);
  box-shadow: 0 0 15px rgba(var(--color-primary-rgb), 0.2);
}

.avatar-upload-controls {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.btn-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm) var(--spacing-lg);
  background: rgba(var(--color-primary-rgb), 0.1);
  border: 1px solid rgba(var(--color-primary-rgb), 0.3);
  border-radius: var(--radius-md);
  color: var(--color-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-upload:hover {
  background: rgba(var(--color-primary-rgb), 0.2);
  border-color: var(--color-primary);
}

.btn-remove-avatar {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-remove-avatar:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
}

/* Modal Footer */
.edit-profile-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-md);
  padding: var(--spacing-lg) var(--spacing-xl);
  border-top: 1px solid rgba(var(--color-primary-rgb), 0.2);
  background: var(--color-bg-card);
  flex-shrink: 0; /* Prevent footer from shrinking */
}

.edit-profile-modal-footer .btn {
  padding: var(--spacing-sm) var(--spacing-xl);
  border-radius: var(--radius-md);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all 0.2s ease;
}

.edit-profile-modal-footer .btn-close-x {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.2) 0%, rgba(220, 53, 69, 0.15) 100%);
  color: #ff6b6b;
  border: 2px solid rgba(220, 53, 69, 0.5);
  min-width: 44px;
  padding: 0.5rem 0.75rem;
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 300;
  border-radius: var(--radius-md);
}

.edit-profile-modal-footer .btn-close-x:hover {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.35) 0%, rgba(220, 53, 69, 0.3) 100%);
  border-color: rgba(220, 53, 69, 0.8);
  box-shadow: 0 0 20px rgba(220, 53, 69, 0.4);
  transform: translateY(-2px);
  color: #ff8a8a;
}

.edit-profile-modal-footer .btn-primary {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.15));
  border: 2px solid #22c55e;
  color: #22c55e;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
  font-weight: var(--font-weight-bold);
  min-width: 140px;
}

.edit-profile-modal-footer .btn-primary:hover:not(:disabled) {
  background: rgba(34, 197, 94, 0.3);
  box-shadow: 0 0 25px rgba(34, 197, 94, 0.5);
}

.edit-profile-modal-footer .btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.edit-profile-modal-footer .btn-loading {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
}

/* Privacy Settings Toggle */
.privacy-settings-group {
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-lg);
  border-top: 1px solid rgba(var(--color-primary-rgb), 0.15);
}

.privacy-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-lg);
  padding: var(--spacing-md);
  background: rgba(var(--color-primary-rgb), 0.05);
  border-radius: var(--radius-md);
  border: 1px solid rgba(var(--color-primary-rgb), 0.1);
}

.privacy-toggle-info {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.privacy-toggle-label {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
}

.privacy-toggle-hint {
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
}

/* Privacy Status Indicator */
.privacy-status {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: all 0.3s ease;
}

.privacy-status .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

/* Private state (default) */
.privacy-status.private {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.privacy-status.private .status-dot {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* Public state */
.privacy-status.public {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.privacy-status.public .status-dot {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(var(--color-primary-rgb), 0.2);
  border: 1px solid rgba(var(--color-primary-rgb), 0.3);
  transition: all 0.3s ease;
  border-radius: 28px;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: var(--color-text-tertiary);
  transition: all 0.3s ease;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background: rgba(var(--color-primary-rgb), 0.4);
  border-color: var(--color-primary);
  box-shadow: 0 0 15px rgba(var(--color-primary-rgb), 0.4);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(24px);
  background: var(--color-primary);
  box-shadow: 0 0 10px rgba(var(--color-primary-rgb), 0.6);
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.3);
}

/* Responsive */
@media (max-width: 480px) {
  .edit-profile-modal-overlay {
    padding: var(--spacing-md);
  }
  
  .edit-profile-modal {
    max-height: 95vh;
  }
  
  .edit-profile-modal-header,
  .edit-profile-modal-body,
  .edit-profile-modal-footer {
    padding: var(--spacing-md);
  }
  
  .avatar-upload-section {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .edit-profile-modal-footer {
    flex-direction: row;
    justify-content: space-between;
  }
  
  .edit-profile-modal-footer .btn-secondary {
    width: 40px;
  }
  
  .edit-profile-modal-footer .btn-primary {
    flex: 1;
    max-width: none;
  }
}

/* ============================================================================
   Profile Overview Section - Three Block Layout
   ============================================================================ */

.profile-overview-section {
  margin-bottom: 2rem;
}

/* Featured Header (matches explore page) */
.profile-overview-section .featured-header {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
}

.profile-overview-section .featured-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
  flex-shrink: 0;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.profile-overview-section .featured-title-text {
  position: relative;
  display: inline-block;
  padding-bottom: 6px;
}

.profile-overview-section .featured-title-text::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #00a8ff 0%, #33c4ff 50%, #00a8ff 100%);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(0, 168, 255, 0.5);
}

.profile-overview-section .featured-description {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  opacity: 0.75;
}

/* Three Block Row Layout */
.overview-blocks-row {
  display: flex;
  gap: 1rem;
}

.overview-block {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.overview-block:hover {
  border-color: rgba(0, 168, 255, 0.4);
  box-shadow: 0 0 20px rgba(0, 168, 255, 0.15);
}

.overview-block-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.75rem;
}

.overview-block-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
}

.overview-block-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Block 1: Total Influence */
.overview-influence-block {
  background: rgba(0, 168, 255, 0.05);
  border-color: rgba(0, 168, 255, 0.2);
}

.overview-influence-block:hover {
  border-color: rgba(0, 168, 255, 0.5);
  box-shadow: 0 0 30px rgba(0, 168, 255, 0.25);
}

.influence-display {
  text-align: center;
}

.influence-value {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.1;
}

.influence-glow {
  color: #33c4ff;
  text-shadow: 
    0 0 10px rgba(0, 168, 255, 0.7),
    0 0 20px rgba(0, 168, 255, 0.5),
    0 0 30px rgba(0, 168, 255, 0.3),
    0 0 40px rgba(0, 168, 255, 0.2);
}

.influence-number {
  display: inline-block;
  animation: influence-pulse 2s ease-in-out infinite;
}

@keyframes influence-pulse {
  0%, 100% {
    text-shadow: 
      0 0 10px rgba(0, 168, 255, 0.7),
      0 0 20px rgba(0, 168, 255, 0.5),
      0 0 30px rgba(0, 168, 255, 0.3);
  }
  50% {
    text-shadow: 
      0 0 15px rgba(0, 168, 255, 0.9),
      0 0 30px rgba(0, 168, 255, 0.7),
      0 0 45px rgba(0, 168, 255, 0.5),
      0 0 60px rgba(0, 168, 255, 0.3);
  }
}

.influence-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.5rem;
}

.influence-loading,
.stat-loading {
  opacity: 0.5;
}

/* Block 2: Total Indexes */
.overview-indexes-block .indexes-display {
  text-align: center;
}

.indexes-value {
  font-size: 3rem;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.1;
}

.indexes-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.5rem;
}

/* Block 3: Top Rankings */
.overview-rankings-block {
  min-height: 200px;
}

.overview-rankings-block .overview-block-content {
  justify-content: flex-start;
  align-items: stretch;
}

.rankings-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.ranking-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.15s ease;
}

.ranking-row:hover {
  background: rgba(0, 168, 255, 0.15);
  transform: translateX(2px);
}

.ranking-badge {
  flex-shrink: 0;
  width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rank-medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

.rank-medal.gold {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #000;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

.rank-medal.silver {
  background: linear-gradient(135deg, #d1d5db 0%, #9ca3af 100%);
  color: #000;
  box-shadow: 0 0 10px rgba(156, 163, 175, 0.4);
}

.rank-medal.bronze {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #fff;
  box-shadow: 0 0 10px rgba(217, 119, 6, 0.4);
}

.rank-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.05);
}

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

.ranking-topic-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.ranking-influence {
  flex-shrink: 0;
  text-align: right;
}

.ranking-influence-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: #33c4ff;
}

/* Rankings loading/empty states */
.rankings-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 150px;
}

.rankings-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* Responsive Design for Overview */
@media (max-width: 992px) {
  .overview-blocks-row {
    flex-wrap: wrap;
  }
  
  .overview-block {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: calc(50% - 0.5rem);
  }
  
  .overview-rankings-block {
    flex: 1 1 100%;
    min-width: 100%;
  }
}

@media (max-width: 768px) {
  .profile-overview-section .featured-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .profile-overview-section .featured-title {
    font-size: 1.25rem;
  }
  
  .overview-blocks-row {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  
  .overview-block {
    flex: 1 1 calc(50% - 0.375rem);
    min-width: calc(50% - 0.375rem);
    padding: 0.875rem;
  }
  
  .overview-rankings-block {
    flex: 1 1 100%;
    min-width: 100%;
  }
  
  .influence-value,
  .indexes-value {
    font-size: 2.25rem;
  }
  
  .overview-block-title {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .overview-blocks-row {
    gap: 0.5rem;
  }
  
  .overview-block {
    padding: 0.75rem;
  }
  
  .influence-value,
  .indexes-value {
    font-size: 2rem;
  }
  
  .ranking-row {
    padding: 0.4rem 0.5rem;
    gap: 0.5rem;
  }
  
  .ranking-badge {
    width: 30px;
  }
  
  .rank-medal,
  .rank-number {
    width: 24px;
    height: 24px;
    font-size: 0.65rem;
  }
  
  .ranking-topic-name {
    font-size: 0.8rem;
  }
  
  .ranking-influence-value {
    font-size: 0.75rem;
  }
}

/* ============================================================================
   Profile Topic Filter Bar
   Styles now in components/discovery-bar.css
   ============================================================================ */

/* ============================================================================
   Profile Influence Chart Section
   ============================================================================ */

.profile-influence-chart-section {
  padding: 2rem 0 3rem;
  margin-top: 1rem;
}

.profile-influence-chart-section .section-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.influence-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.influence-chart-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text-primary, rgba(255, 255, 255, 0.9));
  margin: 0;
}

.influence-chart-timeframe-selector {
  display: flex;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem;
  border-radius: 8px;
}

.timeframe-btn {
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.timeframe-btn:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
}

.timeframe-btn.active {
  background: rgba(59, 130, 246, 0.2);
  color: rgba(59, 130, 246, 1);
}

.influence-chart-container {
  position: relative;
  width: 100%;
  height: 350px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1rem;
}

.influence-chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

.influence-chart-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(15, 20, 30, 0.8);
  border-radius: 12px;
  z-index: 10;
}

.influence-chart-loading span {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
  .influence-chart-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .influence-chart-timeframe-selector {
    width: 100%;
    justify-content: space-between;
  }

  .timeframe-btn {
    padding: 0.5rem 0.75rem;
    flex: 1;
    text-align: center;
    font-size: 0.8rem;
  }

  .influence-chart-container {
    height: 280px;
  }

  .influence-chart-title {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .profile-influence-chart-section {
    padding: 1.5rem 0 2rem;
  }

  .influence-chart-container {
    height: 240px;
    padding: 0.75rem;
  }

  .timeframe-btn {
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
  }
}

/* ============================================================================
   Profile Timeline - View Toggle and No Discussion Layout
   ============================================================================ */

/* Full-width vertical timeline when no discussion panel */
.topic-panels-no-discussion {
  display: flex;
  justify-content: center;
}

.topic-panels-no-discussion .topic-panel-timeline-full {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

/* View toggle wrapper on profile pages */
.profile-timeline-section .timeline-view-toggle-wrapper {
  display: flex;
  justify-content: center;
  padding: 1rem 0 2rem;
}

/* Vertical timeline loading overlay */
.vertical-timeline-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: rgba(var(--color-bg-primary-rgb, 26, 28, 30), 0.9);
  z-index: 10;
}

/* Ensure vertical timeline posts container has proper styling */
.topic-panels-no-discussion .vertical-timeline-posts {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem 1rem 3rem; /* Left padding for timeline bar */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.topic-panels-no-discussion .vertical-timeline-posts::-webkit-scrollbar {
  display: none;
}

