/* =============================================
   SOCIAL SIDEBAR - TheGaming.co
   Include this on every page
   ============================================= */

/* Friends Icon in Header */
.friends-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.friends-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.friends-btn svg {
  width: 20px;
  height: 20px;
  fill: rgba(255, 255, 255, 0.8);
}

.friends-btn:hover svg {
  fill: white;
}

/* Notification dot for pending requests */
.friends-btn .notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: #ff6b9d;
  border-radius: 50%;
  display: none;
}

.friends-btn .notification-dot.visible {
  display: block;
  animation: pulse-dot 2s ease-in-out infinite;
}

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

/* Sidebar Overlay */
.social-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.social-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Sidebar Container */
.social-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  max-width: 85vw;
  height: 100%;
  background: linear-gradient(180deg, rgba(15, 15, 25, 0.98), rgba(10, 10, 18, 0.98));
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
}

.social-sidebar.open {
  transform: translateX(0);
}

/* Sidebar Header */
.social-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.social-header h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 2px;
  color: white;
  margin: 0;
}

.social-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

/* Your Profile Card */
.social-profile-card {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.social-profile-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.social-profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b9d, #a445b2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: white;
  flex-shrink: 0;
}

.social-profile-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: white;
}

.social-profile-handle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  font-size: 0.8rem;
}

.social-profile-handle span {
  color: rgba(255, 255, 255, 0.5);
}

.social-profile-handle code {
  color: #ff6b9d;
  font-family: monospace;
  font-weight: 600;
  flex: 1;
}

.social-profile-handle button {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 2px;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.social-profile-handle button:hover {
  color: white;
}

/* Tabs */
.social-tabs {
  display: flex;
  padding: 0 16px;
  gap: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.social-tab {
  flex: 1;
  padding: 10px 6px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  position: relative;
}

.social-tab:hover {
  color: rgba(255, 255, 255, 0.8);
}

.social-tab.active {
  color: white;
  border-bottom-color: #ff6b9d;
}

.social-tab .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #ff6b9d;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
  margin-left: 4px;
}

/* Tab Content */
.social-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.social-panel {
  display: none;
  padding: 12px 16px;
}

.social-panel.active {
  display: block;
}

/* Section Labels */
.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 10px;
  padding-left: 2px;
}

/* Friend Item */
.friend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.friend-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.friend-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b9d, #a445b2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  flex-shrink: 0;
}

.friend-avatar .status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(15, 15, 25, 0.98);
}

.friend-avatar .status-dot.online {
  background: #34d399;
}

.friend-avatar .status-dot.in_game {
  background: #fbbf24;
}

.friend-avatar .status-dot.offline {
  background: #6b7280;
}

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

.friend-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-status {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-status.in-game {
  color: #fbbf24;
}

.friend-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Action Buttons */
.action-btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: 'Inter', sans-serif;
}

.action-btn.primary {
  background: linear-gradient(135deg, #ff6b9d, #a445b2);
  color: white;
}

.action-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

.action-btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.action-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.action-btn.icon-only {
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.action-btn.icon-only:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.action-btn.accept {
  background: rgba(52, 211, 153, 0.2);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.action-btn.accept:hover {
  background: rgba(52, 211, 153, 0.3);
}

.action-btn.decline {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.action-btn.decline:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* Search Input */
.search-wrapper {
  margin-bottom: 20px;
}

.search-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(5, 5, 15, 0.8);
  color: white;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.search-input:focus {
  border-color: #ff6b9d;
  box-shadow: 0 0 0 2px rgba(255, 107, 157, 0.2);
}

.search-hint {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 10px;
  text-align: center;
}

/* Search Results */
.search-results {
  margin-top: 16px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 10px;
}

/* Game Invites Section */
.invites-section {
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.1), rgba(164, 69, 178, 0.1));
  border: 1px solid rgba(255, 107, 157, 0.2);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.invites-section h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: 1px;
  color: #ff6b9d;
  margin: 0 0 12px 0;
}

.invite-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  margin-bottom: 8px;
}

.invite-item:last-child {
  margin-bottom: 0;
}

.invite-info {
  flex: 1;
}

.invite-from {
  font-weight: 600;
  font-size: 0.9rem;
  color: white;
}

.invite-game {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: rgba(255, 255, 255, 0.4);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Friend Options Menu */
.friend-options {
  position: relative;
}

.friend-options-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 140px;
  background: rgba(20, 20, 30, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 6px;
  z-index: 10;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: all 0.15s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.friend-options-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.friend-options-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.15s ease;
}

.friend-options-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.friend-options-item.danger {
  color: #f87171;
}

.friend-options-item.danger:hover {
  background: rgba(248, 113, 113, 0.15);
}

/* Loading State */
.loading-friends {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 0;
}

.loading-friends .skeleton {
  height: 64px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

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

/* Responsive */
@media (max-width: 700px) {
  .social-sidebar {
    width: 100%;
    max-width: 100%;
  }

  .social-header {
    padding: 14px 16px;
    padding-top: max(14px, env(safe-area-inset-top));
  }

  .social-profile-card {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .social-tabs {
    padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right));
  }

  .social-panel {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  .friends-btn {
    width: 36px;
    height: 36px;
  }

  .friends-btn svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 375px) {
  .social-tab {
    font-size: 0.7rem;
    padding: 8px 4px;
  }

  .friend-item {
    padding: 8px;
    gap: 8px;
  }

  .friend-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .friend-avatar .status-dot {
    width: 8px;
    height: 8px;
  }

  .friend-name {
    font-size: 0.8rem;
  }

  .friend-status {
    font-size: 0.65rem;
  }

  .action-btn {
    padding: 5px 10px;
    font-size: 0.7rem;
  }

  .action-btn.icon-only {
    width: 26px;
    height: 26px;
  }

  .social-profile-handle {
    font-size: 0.75rem;
    padding: 6px 8px;
  }
}
