/* ==========================================================================
   DevPilot-AI - Modern GitHub Analyzer Stylesheet
   ========================================================================== */

/* Main Analyzer Container & Grid Protections */
.analyzer-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  box-sizing: border-box;
  min-width: 0;
}

/* Ensure all grid and flex items inside analyzer respect column boundaries */
.analyzer-container *,
.analyzer-state * {
  min-width: 0;
  box-sizing: border-box;
}

/* State Containers */
.analyzer-state {
  display: none;
  width: 100%;
  min-width: 0;
}

.analyzer-state.active {
  display: block;
}

/* Skeleton Loading Shimmer */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

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

/* Developer Score Circular Ring */
.score-circle-container {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0.5rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.score-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.score-circle-bg {
  fill: none;
  stroke: #f1f5f9;
  stroke-width: 11;
}

.score-circle-progress {
  fill: none;
  stroke: url(#scoreGradient);
  stroke-width: 11;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.score-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.score-number {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
  letter-spacing: -0.03em;
}

.score-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.25rem;
}

/* Sub-Score Bars & 8-Category Score Breakdown */
.sub-score-bar-bg {
  height: 5px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.sub-score-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.score-cat-item {
  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;
  transition: background-color 0.15s ease;
  cursor: pointer;
}

.score-cat-item:hover {
  background-color: #f8fafc;
}

.score-cat-why {
  display: none;
  margin-top: 0.35rem;
  padding: 0.4rem 0.6rem;
  background: #f8fafc;
  border-left: 3px solid #6366f1;
  border-radius: 0.375rem;
  font-size: 11px;
  color: #475569;
  line-height: 1.4;
  animation: fadeIn 0.2s ease-in-out;
}

.score-cat-item.expanded .score-cat-why {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tier Badges */
.tier-beginner {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.tier-developing {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.tier-good {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.tier-strong {
  background-color: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

.tier-excellent {
  background-color: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #e9d5ff;
}

/* Language Color Dots & Progress Bars */
.lang-progress-container {
  height: 8px;
  display: flex;
  border-radius: 999px;
  overflow: hidden;
  background: #f1f5f9;
  width: 100%;
}

.lang-progress-segment {
  height: 100%;
  transition: width 0.8s ease;
}

.repo-lang-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* Predefined Language Colors */
.lang-JavaScript { background-color: #f7df1e; }
.lang-TypeScript { background-color: #3178c6; }
.lang-Python { background-color: #3572A5; }
.lang-Java { background-color: #b07219; }
.lang-C { background-color: #555555; }
.lang-Cpp { background-color: #f34b7d; }
.lang-Csharp { background-color: #178600; }
.lang-Go { background-color: #00ADD8; }
.lang-Rust { background-color: #dea584; }
.lang-Ruby { background-color: #701516; }
.lang-PHP { background-color: #4F5D95; }
.lang-Swift { background-color: #F05138; }
.lang-Kotlin { background-color: #A97BFF; }
.lang-HTML { background-color: #e34c26; }
.lang-CSS { background-color: #563d7c; }
.lang-Vue { background-color: #41b883; }
.lang-Shell { background-color: #89e051; }
.lang-Default { background-color: #64748b; }

/* Timeline Container */
.timeline-container {
  position: relative;
  padding-left: 2rem;
  width: 100%;
}

.timeline-container::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: var(--color-outline-variant);
}

.timeline-item {
  position: relative;
  margin-bottom: 1rem;
}

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

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Event Badges */
.event-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.event-push { background: #e0e7ff; color: #4338ca; }
.event-pr { background: #ecfdf5; color: #047857; }
.event-issue { background: #fef3c7; color: #b45309; }
.event-star { background: #fef9c3; color: #a16207; }
.event-fork { background: #f3e8ff; color: #7e22ce; }
.event-create { background: #e0f2fe; color: #0369a1; }
.event-default { background: #f1f5f9; color: #475569; }

/* Repository Cards */
.repo-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  min-height: 160px;
  background: var(--color-surface);
  border: 1px solid var(--color-outline-variant);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all var(--transition-normal);
  overflow: hidden;
}

.repo-card:hover {
  transform: translateY(-2px);
  border-color: rgba(79, 70, 229, 0.35);
  box-shadow: var(--shadow-hover);
}

/* Priority Badges for Suggestions */
.priority-high {
  background: #fee2e2;
  color: #dc2626;
}

.priority-medium {
  background: #fef3c7;
  color: #d97706;
}

.priority-low {
  background: #e0e7ff;
  color: #4338ca;
}

/* Highlighted Top Repository Card */
.top-repo-card {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.03) 0%, rgba(99, 102, 241, 0.01) 100%);
  border: 1.5px solid rgba(79, 70, 229, 0.25);
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.05);
  border-radius: var(--radius-lg);
}

/* Quick User Chip Buttons & Bar */
.sample-profiles-bar {
  padding-top: 0.5rem !important;
  padding-bottom: 0.75rem !important;
}

.sample-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 1px solid var(--color-outline-variant);
  color: var(--color-on-surface-variant);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.sample-user-chip:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

/* Text Wrapping & Overflow Defenses */
.break-words-anywhere {
  overflow-wrap: anywhere;
  word-break: break-word;
}
