/* Component-specific styles */

/* Branding and logo */
.branding-logo {
  max-width: 200px;
  height: auto;
  margin: 0 auto;
  display: block;
}

/* Home page buttons */
.home-btn {
  display: inline-block;
  padding: 12px 24px;
  margin: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  text-decoration: none;
  border-radius: 25px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.home-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
  color: white;
  text-decoration: none;
}

/* Leaderboard styles */
.leaderboard-section {
  margin-top: 3rem;
  padding: 2rem 0;
}

.leaderboard-card {
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  overflow: visible !important;
}

.leaderboard-header {
  background: white;
  color: var(--accent-dark);
  padding: 1.5rem;
  text-align: center;
}

.leaderboard-entry {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #eee;
  transition: background-color 0.3s ease;
}

.leaderboard-entry:hover {
  background-color: #f8f9fa;
}

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

.leaderboard-rank {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent);
  min-width: 40px;
  text-align: center;
}

.leaderboard-user {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 1rem;
}

.leaderboard-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 1.2rem;
}

.leaderboard-info h5 {
  margin: 0;
  color: #333;
  font-weight: 600;
}

.leaderboard-info p {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

.leaderboard-stats {
  text-align: right;
}

.leaderboard-uploads {
  font-size: 1.2rem;
  font-weight: bold;
  color: #28a745;
}

.leaderboard-uploads span {
  font-size: 0.9rem;
  color: #666;
  font-weight: normal;
}

/* Document cards */
.document-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 1.5rem;
}

.document-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.document-header {
  padding: 1.5rem;
  border-bottom: 1px solid #eee;
}

.document-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
}

.document-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: #666;
  font-size: 0.9rem;
}

.document-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.document-body {
  padding: 1.5rem;
}

.document-description {
  color: #666;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.document-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.document-tag {
  background: #e9ecef;
  color: #495057;
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
}

.document-footer {
  padding: 1rem 1.5rem;
  background: #f8f9fa;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.document-actions {
  display: flex;
  gap: 1rem;
}

.like-btn, .comment-btn, .share-btn, .view-btn {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 5px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.like-btn:hover, .comment-btn:hover, .share-btn:hover, .view-btn:hover {
  background: #e9ecef;
  color: var(--accent);
}

.like-btn.liked {
  color: #dc3545;
}

.like-btn.liked:hover {
  color: #c82333;
}

.share-btn:hover {
  color: #28a745;
}

/* Upload form */
.upload-form {
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  margin-bottom: 2rem;
}

.upload-area {
  border: 2px dashed var(--accent);
  border-radius: 10px;
  padding: 3rem 2rem;
  text-align: center;
  background: #f8f9ff;
  transition: all 0.3s ease;
  cursor: pointer;
}

.upload-area:hover {
  border-color: var(--accent-dark);
  background: #e6f3ff;
}

.upload-area.dragover {
  border-color: var(--accent-dark);
  background: #e6f3ff;
  transform: scale(1.02);
}

.upload-icon {
  font-size: 3rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.upload-text {
  color: #666;
  margin-bottom: 1rem;
}

.upload-button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.upload-button:hover {
  background: var(--accent-dark);
}

/* Profile styles */
.profile-header {
  background: white;
  color: var(--accent-dark);
  padding: 2rem;
  border-radius: 10px;
  margin-bottom: 2rem;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  margin: 0 auto 1rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: 10px;
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  display: block;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Admin dashboard */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-widget {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.stat-widget-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.stat-widget-number {
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent);
  display: block;
}

.stat-widget-label {
  color: #666;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Contributor styling */
.contributor-name {
  color: #B8860B !important; /* Darker golden color */
  font-weight: 700 !important;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3) !important;
}

.contributor-badge {
  color: white !important;
  font-size: 0.9rem !important;
  margin-left: 0.3rem !important;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3) !important;
}

/* Mobile-first responsive design - More compact and refined */
@media (max-width: 768px) {
  /* Reduce overall font sizes and spacing */
  body {
    font-size: 14px;
    line-height: 1.4;
  }
  
  /* Compact leaderboard entries */
  .leaderboard-entry {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
  }
  
  .leaderboard-rank {
    font-size: 1.1rem;
    min-width: 30px;
  }
  
  .leaderboard-avatar {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
  }
  
  .leaderboard-info h5 {
    font-size: 0.95rem;
    font-weight: 500;
  }
  
  .leaderboard-info p {
    font-size: 0.8rem;
  }
  
  .leaderboard-uploads {
    font-size: 1rem;
  }
  
  /* Compact document cards */
  .document-card {
    margin-bottom: 1rem;
    border-radius: 8px;
  }
  
  .document-header {
    padding: 1rem;
  }
  
  .document-title {
    font-size: 1.1rem;
    font-weight: 500;
  }
  
  .document-meta {
    font-size: 0.8rem;
    gap: 0.5rem;
  }
  
  .document-body {
    padding: 1rem;
  }
  
  .document-description {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
  }
  
  .document-tag {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
  }
  
  .document-footer {
    padding: 0.75rem 1rem;
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .document-actions {
    justify-content: center;
    gap: 0.75rem;
  }
  
  .like-btn, .comment-btn, .share-btn, .view-btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
  }
  
  /* Compact buttons */
  .btn {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
  }
  
  .btn-sm {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }
  
  /* Compact forms */
  .form-control {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
  }
  
  /* Compact upload form */
  .upload-form {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .upload-area {
    padding: 2rem 1.5rem;
  }
  
  .upload-icon {
    font-size: 2.5rem;
  }
  
  .upload-text {
    font-size: 0.9rem;
  }
  
  /* Compact profile */
  .profile-header {
    padding: 1.5rem;
  }
  
  .profile-avatar {
    width: 80px;
    height: 80px;
    font-size: 1.5rem;
  }
  
  .profile-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .stat-card {
    padding: 0.75rem;
  }
  
  .stat-number {
    font-size: 1.5rem;
  }
  
  .stat-label {
    font-size: 0.8rem;
  }
  
  /* Compact admin stats */
  .admin-stats {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .stat-widget {
    padding: 1rem;
  }
  
  .stat-widget-icon {
    font-size: 2rem;
  }
  
  .stat-widget-number {
    font-size: 1.5rem;
  }
  
  .stat-widget-label {
    font-size: 0.8rem;
  }
  
  /* Reduce card padding and margins */
  .card-body {
    padding: 1rem;
  }
  
  .card-header {
    padding: 0.75rem 1rem;
  }
  
  /* Compact alerts */
  .alert {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
  
  /* Reduce home button sizes */
  .home-btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    margin: 0.5rem;
  }
  
  /* Compact leaderboard section */
  .leaderboard-section {
    margin-top: 2rem;
    padding: 1.5rem 0;
  }
  
  .leaderboard-card {
    border-radius: 10px;
  }
  
  .leaderboard-header {
    padding: 1rem;
    font-size: 1.1rem;
  }
  
  /* Make contributor styling less bold on mobile */
  .contributor-name {
    font-weight: 600 !important;
    text-shadow: none !important;
  }
  
  .contributor-badge {
    font-size: 0.8rem !important;
    text-shadow: none !important;
  }
}

/* DARK MODE OVERRIDES - FORCE PROFILE CARD DARK */
body.dark-mode .profile-header {
  background: var(--dark-card-bg) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .profile-card {
  background: var(--dark-card-bg) !important;
  background-color: var(--dark-card-bg) !important;
  background-image: none !important;
  border: 1px solid var(--dark-border) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .leaderboard-card {
  background: var(--dark-card-bg) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .leaderboard-header {
  background: var(--dark-card-bg) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .document-card {
  background: var(--dark-card-bg) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .upload-form {
  background: var(--dark-card-bg) !important;
  color: var(--dark-text-primary) !important;
}

body.dark-mode .stat-widget {
  background: var(--dark-card-bg) !important;
  color: var(--dark-text-primary) !important;
}