/*
 * 📊 CONTRIBUTOR DASHBOARD STYLES
 * Estilos premium para el panel de contribuidores
 */

/* === 🎨 Contributor Card === */
.contributor-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.25);
  color: #fff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contributor-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(102, 126, 234, 0.35);
}

.contributor-header {
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.contributor-header h4 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* === 📊 Stats Grid === */
.contributor-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.contributor-stats .stat-item {
  text-align: center;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  transition: transform 0.2s ease, background 0.2s ease;
}

.contributor-stats .stat-item:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.15);
}

.contributor-stats .stat-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.85;
  margin-bottom: 0.25rem;
}

.contributor-stats .stat-value {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* === 📈 Impact Section === */
.contributor-impact {
  margin: 1rem 0;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.contributor-impact h5 {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0.9;
}

.impact-stats {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

.impact-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.impact-value {
  font-size: 1.5rem;
  font-weight: 700;
  display: block;
  margin-bottom: 0.25rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.impact-label {
  font-size: 0.7rem;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* === 🏆 Badges Section === */
.contributor-badges {
  margin: 1rem 0;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.contributor-badges h5 {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0.9;
}

.badges-earned {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.badge-icon {
  font-size: 2rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  cursor: pointer;
  transition: transform 0.2s ease;
}

.badge-icon:hover {
  transform: scale(1.2) rotate(5deg);
}

/* === 🎯 Actions === */
.contributor-actions {
  margin-top: 1rem;
}

.contributor-actions .btn-secondary {
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  color: #667eea;
  border: none;
  padding: 0.75rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.contributor-actions .btn-secondary:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* === 📋 Contributions Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 1rem;
}

.modal-overlay.show {
  opacity: 1;
}

.modal-overlay.closing {
  opacity: 0;
}

.contributor-modal {
  background: #fff;
  border-radius: 20px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.show .contributor-modal {
  transform: scale(1);
}

.modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
}

.modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  max-height: calc(90vh - 100px);
}

/* === 📊 Contributions Summary === */
.contributions-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.summary-stat {
  text-align: center;
  padding: 1rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  transition: transform 0.2s ease;
}

.summary-stat:hover {
  transform: translateY(-2px);
}

.summary-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 0.25rem;
}

.summary-label {
  display: block;
  font-size: 0.8rem;
  color: #6c757d;
  font-weight: 600;
}

/* === 📋 Contributions List === */
.contributions-list h4 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  color: #333;
}

.contribution-items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contribution-item {
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 12px;
  border-left: 4px solid #667eea;
  transition: all 0.2s ease;
}

.contribution-item:hover {
  background: #e9ecef;
  transform: translateX(4px);
}

.contribution-item.status-approved {
  border-left-color: #28a745;
}

.contribution-item.status-pending {
  border-left-color: #ffc107;
}

.contribution-item.status-rejected {
  border-left-color: #dc3545;
}

.contrib-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.contrib-name {
  font-weight: 600;
  color: #333;
  font-size: 1rem;
}

.contrib-date {
  font-size: 0.8rem;
  color: #6c757d;
}

.contrib-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.contrib-difficulty {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  border-radius: 6px;
  font-weight: 600;
  text-transform: uppercase;
}

.contrib-status {
  font-size: 0.75rem;
  font-weight: 600;
}

.contrib-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: #6c757d;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #dee2e6;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: #6c757d;
  font-style: italic;
}

/* === 🏆 Badges Showcase === */
.badges-showcase {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #dee2e6;
}

.badges-showcase h4 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  color: #333;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.badge-card {
  text-align: center;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 12px;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.badge-card.earned {
  background: linear-gradient(135deg, #fff5e6 0%, #ffe8cc 100%);
  border-color: #ffc107;
}

.badge-card.locked {
  opacity: 0.5;
  filter: grayscale(0.8);
}

.badge-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.badge-icon-large {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.badge-name {
  display: block;
  font-weight: 600;
  color: #333;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.badge-requirement {
  display: block;
  font-size: 0.7rem;
  color: #6c757d;
  font-style: italic;
}

/* === 🔔 Badge Notification === */
.badge-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(40, 167, 69, 0.4);
  z-index: 10001;
  transform: translateX(400px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 280px;
}

.badge-notification.show {
  transform: translateX(0);
  opacity: 1;
}

.badge-notif-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.badge-notif-icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.badge-notif-text {
  display: flex;
  flex-direction: column;
}

.badge-notif-text strong {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.badge-notif-text span {
  font-size: 0.9rem;
  opacity: 0.95;
}

/* === 📱 Responsive === */
@media (max-width: 768px) {
  .contributor-stats {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .contributions-summary {
    grid-template-columns: 1fr;
  }

  .badges-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .impact-stats {
    flex-direction: column;
    gap: 1rem;
  }

  .modal-body {
    padding: 1rem;
  }

  .badge-notification {
    right: 10px;
    top: 10px;
    min-width: calc(100vw - 20px);
  }
}

/* === 🌙 Dark Theme Support === */
[data-theme='dark'] .contributor-modal {
  background: #1e1e2a;
  color: #f5f5f5;
}

[data-theme='dark'] .modal-body {
  color: #f5f5f5;
}

[data-theme='dark'] .contributions-list h4,
[data-theme='dark'] .badges-showcase h4 {
  color: #f5f5f5;
}

[data-theme='dark'] .summary-stat {
  background: linear-gradient(135deg, #2a2a3a 0%, #1e1e2a 100%);
}

[data-theme='dark'] .summary-label {
  color: #adb5bd;
}

[data-theme='dark'] .contribution-item {
  background: #2a2a3a;
  color: #f5f5f5;
}

[data-theme='dark'] .contribution-item:hover {
  background: #343444;
}

[data-theme='dark'] .contrib-name {
  color: #f5f5f5;
}

[data-theme='dark'] .contrib-date,
[data-theme='dark'] .contrib-stats {
  color: #adb5bd;
}

[data-theme='dark'] .badge-card {
  background: #2a2a3a;
  color: #f5f5f5;
}

[data-theme='dark'] .badge-card.earned {
  background: linear-gradient(135deg, #3a3a2a 0%, #4a4a3a 100%);
}

[data-theme='dark'] .badge-name {
  color: #f5f5f5;
}

[data-theme='dark'] .badge-requirement {
  color: #adb5bd;
}

[data-theme='dark'] .empty-state {
  color: #adb5bd;
}
