/*
================================================================================
SILVERPAUL FORUM - SIDEBAR MODULE
================================================================================

This module contains all sidebar and modal styling including:
- Sidebar layout and container positioning
- User info sections, avatars, and premium user indicators
- Recent articles, comments, and active users lists
- Site statistics with SVG charts and metrics
- Modern card layouts with hover effects
- Modal overlays for logout confirmation
- Mobile responsive sidebar adaptations

Dependencies:
- CSS Custom Properties from variables.css (must be loaded first)
- Uses extensive color palette: --sidebar-border, --sidebar-card-bg, --avatar-border
- Premium styling: --premium-gold, --premium-orange, --premium-shadow
- UI colors: --bg-light, --bg-lighter, --text-grey, --border-light
- Modal colors: --modal-overlay, --modal-shadow, --cancel-hover, --primary-red

Last Updated: July 24, 2025
================================================================================
*/

/* ==========================================================================
   SIDEBAR COMPONENTS
   ========================================================================== */

aside{
  /* Modern grid layout - width and positioning handled by .app-layout grid */
  /* Let CSS Grid handle layout - removed display: flex that was interfering */
}

.user_info{
  padding: var(--space-5);
  border-bottom: var(--space-0-5) solid var(--sidebar-border);
}

.user_info p{
  padding: var(--space-0);
  margin-bottom: var(--space-2-5);
  color: var(--primary-blue);
  font-weight: bold;
}

.recent_articles {
  list-style-type: circle;
  padding-left: var(--space-3-5); /* 14px - closest to original 15px */
}

.recent_comments {
  list-style-type: circle;
  padding-left: var(--space-3-5); /* 14px - closest to original 15px */
}

.active_users {
  display: flex;
  gap: var(--space-5);
}

.active_users ul{
  list-style-type: none;
}

a.blue_link{
  text-decoration: none;
  color: var(--primary-blue);
  font-weight: normal;
}

a.blue_link:hover {
  color: var(--primary-red);
}

a.red_link{
  text-decoration: none;
  color: var(--primary-red);
  font-weight: normal;
}

a.red_link:hover {
  text-decoration: underline;
  color: var(--primary-blue);
}

a.username {
  text-decoration: none;
  color: var(--primary-red);
  font-weight: normal;
}

a.username:hover {
  text-decoration: underline;
  color: var(--primary-blue);
}

.user_info span{
  color: var(--primary-red);
  font-weight: normal;
}

.btn_link{
  display: inline-block;
  padding: var(--space-1-5); /* 6px - closest to original 5px */
}

.trending{
  padding: var(--space-5);
  border-bottom: var(--space-0-5) solid var(--sidebar-border);
}

.comments{
  padding: var(--space-5);
  border-bottom: var(--space-0-5) solid var(--sidebar-border);
}

.active{
  padding: var(--space-5);
  border-bottom: var(--space-0-5) solid var(--sidebar-border);
}

/* Removed orphaned .stats selector - no HTML usage found */

/* BEM-based heading styles - replacing global h3 selector */

/* Sidebar section headings */
.sidebar__heading {
  font-family: var(--font-family-primary);
  font-size: var(--text-lg);
  font-weight: bold;
  color: var(--primary-blue);
  margin-bottom: var(--space-1-25);
  text-align: center;
  border-bottom: var(--space-0-5) solid var(--border-light);
  padding-bottom: var(--space-2);
}

/* Modal heading styles moved to modals.css for proper separation of concerns */

/* Page content headings */
.page__heading {
  font-family: var(--font-family-primary);
  font-size: var(--text-xl);
  font-weight: bold;
  color: var(--primary-blue);
}

/* ==========================================================================
   MODERN SIDEBAR STYLES
   ========================================================================== */

.modern-card {
  background: var(--sidebar-card-bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 var(--space-0-5) var(--space-2) var(--sidebar-card-shadow);
  margin-bottom: var(--space-5);
  padding: var(--space-3-5); 
  transition: box-shadow 0.3s ease;
}

/* User info section specific styling */
.user_info.modern-card {
  background: var(--silver);
}

.modern-card:hover {
  box-shadow: 0 var(--space-1) var(--space-3) var(--sidebar-card-shadow-hover);
}

/* User Avatar Section */
.user-avatar-section {
  display: flex;
  margin-bottom: var(--space-3-75);
  gap: var(--space-3-5); /* 14px - closest to original 15px */
  padding: var(--space-3-5); /* 14px - closest to original 15px */
  justify-content: center;
  align-items: center;
}

.avatar-container {
  position: relative;
  width: var(--space-15);
  height: var(--space-15);
}

.user-avatar {
  width: var(--space-15);
  height: var(--space-15);
  border-radius: 50%;
  object-fit: cover;
  border: var(--space-0-75) solid var(--avatar-border);
  transition: border-color 0.3s ease;
}

/* Premium Starburst Effect */
.premium-avatar::before {
  content: '';
  position: absolute;
  top: calc(-1 * var(--space-2));
  left: calc(-1 * var(--space-2));
  right: calc(-1 * var(--space-2));
  bottom: calc(-1 * var(--space-2));
  background: conic-gradient(from 0deg, var(--premium-gold), var(--premium-orange), var(--premium-gold), var(--premium-orange), var(--premium-gold), var(--premium-orange), var(--premium-gold), var(--premium-orange));
  border-radius: 50%;
  z-index: -1;
  animation: rotate 3s linear infinite;
}

.premium-avatar::after {
  content: '';
  position: absolute;
  top: calc(-1 * var(--space-3));
  left: calc(-1 * var(--space-3));
  right: calc(-1 * var(--space-3));
  bottom: calc(-1 * var(--space-3));
  background: radial-gradient(circle, transparent 40%, var(--premium-gold) 41%, transparent 42%);
  border-radius: 50%;
  z-index: -2;
  opacity: 0.6;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.premium-avatar .user-avatar {
  border-color: var(--premium-gold);
  box-shadow: 0 0 var(--space-5) var(--premium-shadow);
}

.user-details {
  flex: 1;
  margin-left: var(--space-2);
}

.sidebar-username {
  font-weight: bold !important; 
  font-size: var(--text-2xl);
  display: block;
  margin: var(--space-4-5) 0 var(--space-2-5) 0;
}

.username-link {
  text-decoration: none;
  color: var(--primary-red);
  font-weight: bold;
  font-size: var(--text-lg);
  display: block;
  margin-bottom: var(--space-1-25);
}

.username-link:hover {
  color: var(--primary-red);
  text-decoration: underline;
}

.member-since {
  margin: 0;
  font-size: var(--text-base);
  color: var(--text-grey);
}

.date_joined {
  color: var(--primary-blue);
  font-weight: var(--font-weight-medium);
}

.user-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3-75);
  align-items: center; 
  justify-content: center;
}

/* User Action Buttons - Pill Style */
.user-action-btn {
  background: var(--primary-blue);
  border: var(--space-0-5) solid var(--primary-blue);
  color: var(--silver-300);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--space-6-25);
  font-family: var(--font-family-primary);
  font-size: var(--text-sm);
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  min-width: var(--space-20);
  box-sizing: border-box;
  vertical-align: baseline;
  white-space: nowrap;
}

.user-action-btn:not(.logout):hover {
  transform: translateY(calc(-1 * var(--space-0-5)));
  box-shadow: var(--shadow-md);
  background: var(--primary-green);
  border-color: var(--primary-green);
}

button.user-action-btn.logout:hover {
  background: var(--primary-red);
  border-color: var(--primary-red);
  color: white;
  transform: translateY(calc(-1 * var(--space-0-5)));
  box-shadow: 0 var(--space-1) var(--space-2) rgba(231, 76, 60, 0.3);
}

/* Welcome Section for Non-Authenticated Users */
.welcome-container {
  background: var(--silver);
  color: var(--primary-blue);
  box-shadow: 0 var(--space-1) var(--space-4) var(--shadow-silver);
  text-align: center;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-5);
  padding: var(--space-5);
  transition: box-shadow 0.3s ease;
}

.welcome-container .welcome-title {
  color: var(--primary-blue);
  text-shadow: 0 var(--space-0-5) var(--space-1) var(--text-shadow);
}

.welcome-title {
  font-family: var(--font-family-primary);
  font-size: var(--text-2xl);
  color: white;
  margin-bottom: var(--space-5);
  text-shadow: 0 var(--space-0-5) var(--space-1) var(--shadow-text-dark);
}

.welcome-actions {
  display: flex;
  gap: var(--space-2-5);
  justify-content: center;
  padding-top: var(--space-5);
}

.welcome-btn {
  border: 2px solid var(--primary-blue) !important;
  color: var(--primary-blue) !important;
  background: transparent !important;
  padding: var(--space-2-5) var(--space-4);
  border-radius: var(--radius-md);
  font-family: var(--font-family-primary);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all 0.3s ease;
}

.welcome-btn:hover {
  background: var(--primary-blue) !important;
  color: white !important;
  border-color: var(--primary-blue) !important;
  transform: translateY(calc(-1 * var(--space-0-5)));
  box-shadow: 0 var(--space-1) var(--space-2) var(--primary-blue);
}

/* Recent Articles */
.recent-articles-list {
  margin-bottom: var(--space-3-75);
}

.recent-article-item {
  margin-bottom: var(--space-2);
  padding: var(--space-2);
  border-left: var(--space-0-75) solid var(--primary-blue);
  background: var(--bg-light);
  border-radius: 0 var(--space-1-25) var(--space-1-25) 0;
  transition: background-color 0.3s ease;
}

.recent-article-item:hover {
  background: var(--bg-lighter);
}

.article-link {
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.article-title {
  color: var(--primary-blue);
  font-weight: var(--font-weight-medium);
  flex: 1;
}

.article-date {
  color: var(--text-grey);
  font-size: var(--text-sm);
  margin-left: var(--space-2-5);
}

.article-link:hover .article-title {
  color: var(--primary-red);
}

/* Recent Comments */
.recent-comments-list {
  margin-bottom: var(--space-3-75);
}

.recent-comment-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: var(--space-2-5);
  padding: var(--space-2-5);
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  border-left: var(--space-0-75) solid var(--primary-red);
  transition: background-color 0.3s ease;
}

.recent-comment-item:hover {
  background: var(--bg-lighter);
}

.comment-avatar-small {
  width: var(--space-7-5);
  height: var(--space-7-5);
  margin-right: var(--space-2-5);
  flex-shrink: 0;
}

.comment-author-avatar {
  width: var(--space-7-5);
  height: var(--space-7-5);
  border-radius: 50%;
  object-fit: cover;
  border: var(--space-0-5) solid var(--avatar-border);
}

.comment-content {
  flex: 1;
  min-width: var(--space-0);
}

.comment-author-link {
  color: var(--primary-red);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  font-size: var(--text-base);
  display: block;
  margin-bottom: var(--space-0-75);
}

.comment-author-link:hover {
  text-decoration: underline;
}

.comment-text-link {
  color: var(--primary-blue);
  text-decoration: none;
  font-size: var(--text-sm);
  line-height: 1.4;
  margin-bottom: var(--space-0-75);
}

.comment-text-link:hover {
  color: var(--primary-red);
  text-decoration: underline;
}

.comment-date {
  color: var(--text-grey);
  font-size: var(--text-xs);
}

/* Active Users */
.active_users {
  margin-bottom: var(--space-3-75);
}

.active-user-item {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-2);
  padding: var(--space-2);
  background: var(--bg-light);
  border-radius: var(--space-5);
  transition: all 0.3s ease;
}

.active-user-item:hover {
  background: var(--bg-lighter);
  transform: translateX(var(--space-1-25));
}

.active-avatar-container {
  position: relative;
  width: var(--space-7);
  height: var(--space-7);
  margin-right: var(--space-2-5);
}

.active-user-avatar {
  width: var(--space-7);
  height: var(--space-7);
  border-radius: 50%;
  object-fit: cover;
  border: var(--space-0-5) solid var(--avatar-border);
}

.premium-avatar-small::before {
  content: '';
  position: absolute;
  top: calc(-1 * var(--space-0-75));
  left: calc(-1 * var(--space-0-75));
  right: calc(-1 * var(--space-0-75));
  bottom: calc(-1 * var(--space-0-75));
  background: conic-gradient(from 0deg, var(--premium-gold), var(--premium-orange), var(--premium-gold), var(--premium-orange));
  border-radius: 50%;
  z-index: -1;
  animation: rotate 3s linear infinite;
}

.premium-avatar-small .active-user-avatar {
  border-color: var(--premium-gold);
}

.active-user-link {
  text-decoration: none;
  color: var(--primary-red);
  font-weight: var(--font-weight-medium);
  font-size: var(--text-base);
}

.active-user-link:hover {
  color: var(--primary-red);
  text-decoration: underline;
}

.no-users {
  color: var(--text-grey);
  font-style: italic;
  text-align: center;
  margin: var(--space-3-75) var(--space-0);
}

/* Modern Pagination */
.sidebar-pagination {
  margin-top: var(--space-3-75);
  border-top: var(--space-px) solid var(--border-light);
  padding-top: var(--space-3-5); /* 14px - closest to original 15px */
}

/* ==========================================================================
   ENHANCED PAGINATION SYSTEM (WITH FIRST/LAST NAVIGATION)
   ========================================================================== */

.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: var(--space-2) 0;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1) var(--space-2-5);
  text-decoration: none;
  color: var(--primary-blue);
  background: var(--silver);
  border-radius: var(--space-1-25);
  font-size: var(--text-base);
  font-weight: bold;
  transition: all 0.3s ease;
  border: none;
  min-width: var(--space-7);
  min-height: var(--space-7);
  box-sizing: border-box;
}

.pagination-btn:hover {
  background: var(--primary-blue);
  color: var(--silver);
  transform: scale(1.05);
  box-shadow: 0 var(--space-1) var(--space-2) rgba(0, 0, 0, 0.2);
}

.pagination-btn:active {
  transform: scale(1.0);
}

.pagination-btn:focus {
  outline: var(--space-0-5) solid var(--primary-blue);
  outline-offset: var(--space-0-5);
}

/* Button Variants - First and Last buttons use same styling as prev/next */
.pagination-btn--first,
.pagination-btn--last {
  background: var(--silver);
  color: var(--primary-blue);
  font-size: var(--text-sm);
}

.pagination-btn--first:hover,
.pagination-btn--last:hover {
  background: var(--primary-blue);
  color: var(--silver);
}

.pagination-info {
  color: var(--primary-blue);
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-family-primary);
  padding: var(--space-1) var(--space-2-5);
  background: var(--bg-light);
  border-radius: var(--space-1-25);
  min-height: var(--space-7);
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

/* ==========================================================================
   RESPONSIVE PAGINATION
   ========================================================================== */

@media (max-width: 640px) {
  .pagination-controls {
    gap: var(--space-1-5);
  }
  
  .pagination-btn {
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-sm);
    min-width: var(--space-6);
    min-height: var(--space-6);
  }
  
  .pagination-info {
    font-size: var(--text-sm);
    padding: var(--space-1) var(--space-2);
    min-height: var(--space-6);
  }
}

@media (max-width: 480px) {
  .pagination-btn--first,
  .pagination-btn--last {
    display: none; /* Hide first/last on very small screens */
  }
}

/* ==========================================================================
   ACCESSIBILITY ENHANCEMENTS
   ========================================================================== */

.pagination-btn[aria-disabled="true"] {
  background: var(--text-grey);
  color: var(--white-bg);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.pagination-btn[aria-disabled="true"]:hover {
  background: var(--text-grey);
  transform: none;
  box-shadow: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .pagination-btn {
    border: var(--space-0-5) solid var(--black-text);
  }
  
  .pagination-info {
    /* Border removed for cleaner appearance */
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .pagination-btn {
    transition: none;
  }
  
  .pagination-btn:hover {
    transform: none;
  }
}

/* Site Statistics */
.statistics {
  margin-bottom: var(--space-5);
  text-align: center;
}

.chart-container {
  margin-bottom: var(--space-5);
}

/* Chart styling */
.chart-container {
  position: relative;
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  padding: var(--space-3-5); /* 14px - closest to original 15px */
  border: var(--space-px) solid var(--border-light);
}

.chart-svg {
  width: 100%;
  height: var(--space-35);
  display: block;
}

.chart-title-text {
  font-size: var(--text-base);
  fill: var(--primary-blue);
  font-family: var(--font-family-primary);
}

.axis-label {
  font-size: var(--text-base);
  fill: var(--text-grey);
  font-family: var(--font-family-sidebar);
}

.chart-point {
  transition: transform 0.3s ease, fill 0.3s ease;
}

.chart-point:hover {
  fill: var(--primary-red);
  transform: scale(1.5);
}

/* Daily metrics */
.daily-metrics {
  display: flex;
  flex-direction: column;
  gap: var(--space-2-5);
}

.metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-light);
  border-radius: var(--space-1-5);
  border-left: var(--space-1) solid var(--primary-blue);
}

.metric-label {
  color: var(--text-body);
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
}

.metric-value {
  color: var(--primary-blue);
  font-weight: bold;
  font-size: var(--text-lg);
}

/* Sidebar heading styles moved to .sidebar__heading BEM class above */

/* ==========================================================================
   MODAL STYLES MOVED TO MODALS.CSS FOR PROPER SEPARATION OF CONCERNS
   ========================================================================== */

/* ==========================================================================
   MOBILE RESPONSIVE SIDEBAR
   ========================================================================== */

@media (max-width: 1000px) {
  .modern-card {
    padding: var(--space-3-5); /* 14px - closest to original 15px */
    margin-bottom: var(--space-3-75);
  }
  
  .user-avatar-section {
    flex-direction: column;
    text-align: center;
    gap: var(--space-2-5);
  }
  
  .user-actions {
    justify-content: center;
  }
  
  .active-user-item {
    padding: var(--space-1-5);
    margin-bottom: var(--space-1-5);
  }
  
  /* Chart labels removed */
}

/* Mobile modal styles moved to modals.css */
