/* ========================================
   GitPulse — Export Styles
   Modal & shareable card layout
   ======================================== */

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,10,15,0.8);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
  animation: modalFadeIn 0.3s ease;
}

.modal-overlay[hidden] {
  display: none;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalScaleIn 0.3s ease;
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  justify-content: center;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
}

/* ========================================
   Export Card (1200x630 ratio)
   ======================================== */
.export-card {
  width: 600px;
  height: 315px;
  background: linear-gradient(135deg, #0a0a0f 0%, #12121a 50%, #16161f 100%);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  font-family: var(--font-body);
  color: var(--text-primary);
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

/* Accent glow */
.export-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
  pointer-events: none;
}

/* Top section */
.export-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.export-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

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

.export-username {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.export-bio {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.export-score-badge {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  text-align: center;
  flex-shrink: 0;
}

.export-score-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.export-score-label {
  font-size: 0.5625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.125rem;
}

/* Stats row */
.export-stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.export-stat {
  text-align: center;
}

.export-stat-value {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.export-stat-label {
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Language bars */
.export-langs {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

.export-lang-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.export-lang-name {
  font-size: 0.625rem;
  color: var(--text-secondary);
  width: 70px;
  text-align: right;
  font-family: var(--font-mono);
}

.export-lang-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(30,41,59,0.5);
  border-radius: 3px;
  overflow: hidden;
}

.export-lang-bar-fill {
  height: 100%;
  border-radius: 3px;
}

.export-lang-pct {
  font-size: 0.5625rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  width: 32px;
}

/* Compact heatmap */
.export-heatmap {
  display: flex;
  gap: 1px;
  margin-bottom: 1rem;
  flex: 1;
  align-items: flex-end;
}

.export-heatmap-week {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.export-heatmap-cell {
  width: 5px;
  height: 5px;
  border-radius: 1px;
}

/* Watermark */
.export-watermark {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.export-watermark-left {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.625rem;
  color: var(--text-muted);
}

.export-watermark-left svg {
  width: 14px;
  height: 10px;
  color: var(--primary);
}

.export-watermark-right {
  font-size: 0.5625rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Responsive Modal */
@media (max-width: 768px) {
  .modal-overlay {
    padding: 1rem;
  }

  .modal {
    max-height: 85vh;
  }

  .export-card {
    width: 100%;
    height: auto;
    aspect-ratio: 1200 / 630;
    padding: 1.25rem;
  }

  .export-username {
    font-size: 1rem;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions .btn {
    width: 100%;
    justify-content: center;
  }
}
