@import url("https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;700&display=swap");

* {
  box-sizing: border-box;
}

body {
  font-family: "Noto Sans", sans-serif;
  color: white;
  background: #050505;
  margin: 0;
  padding: 32px;
  min-height: 100vh;
}

.title-search {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.repositories {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.sorters {
  gap: 20px;
  display: flex;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  font-weight: bold;
  font-size: 1rem;
  padding: 14px 20px;
  border-radius: 999px;
  backdrop-filter: blur(10px);
  cursor: pointer;
  min-width: 180px;
  justify-content: space-between;
  display: flex;
  align-items: center;
}

.dropdown-btn:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.18);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 100%;
  background: rgba(20, 20, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(18px);
  display: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  position: absolute;
}

.dropdown.open .dropdown-menu {
  display: block;
}

.dropdown-item {
  padding: 14px 18px;
  cursor: pointer;
  transition: 0.15s;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.search-container {
  display: flex;
  align-items: center;
  width: 320px;

  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  padding: 6px 8px;
  transition: 0.2s ease;
}

.search-container:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.18);
}

.search-container input {
  flex: 1;
  border: none;
  outline: none;

  background: transparent;
  color: white;
  font-size: 14px;

  padding: 8px 10px;
}

.search-container input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.search-btn {
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: white;

  width: 36px;
  height: 36px;

  border-radius: 50%;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: 0.2s ease;
}

.search-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}


.group-title {
  margin-top: 48px;
  margin-bottom: 18px;

  text-align: left;
}

.repo-grid {
  display: grid;

  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));

  gap: 20px;
  padding: 5px;
}

.repo-card {
  background: linear-gradient(145deg,
      rgba(255, 255, 255, 0.06),
      rgba(255, 255, 255, 0.03));

  border: 1px solid rgba(255, 255, 255, 0.08);

  border-radius: 16px;

  padding: 20px;

  text-decoration: none;
  color: white;

  transition: 0.2s ease;

  display: flex;
  flex-direction: column;

  min-height: 180px;
}

.repo-card:hover {
  transform: translateY(-4px);

  border-color: rgba(255, 255, 255, 0.2);

  background: rgba(255, 255, 255, 0.08);
}

.repo-card h3 {
  margin: 0 0 12px;
}

.repo-description {
  color: rgba(255, 255, 255, 0.75);

  flex: 1;

  line-height: 1.5;
}

.repo-meta {
  display: flex;
  justify-content: space-between;

  margin-top: 18px;

  font-size: 14px;

  color: rgba(255, 255, 255, 0.8);
}

.repo-updated {
  margin-top: 12px;

  font-size: 12px;

  color: rgba(255, 255, 255, 0.5);
}


.repo-card-wrapper {
  position: relative;
  display: contents;
}

.repo-card-wrapper[data-has-preview="true"] .repo-card {
  cursor: pointer;
}

.repo-preview {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  max-width: 49vw;
  min-width: 280px;
  height: auto;
  max-height: 70vh;
  z-index: 1000;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.95);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  visibility: hidden;
}


.repo-preview.visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.repo-preview video {
  width: 100%;
  height: 100%;
  max-height: 70vh;
  object-fit: cover;
  display: block;
}

.preview-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  text-align: center;
}

.preview-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ff6b6b;
  font-size: 14px;
  text-align: center;
}

.preview-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1001;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: 0.2s ease;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.repo-preview.visible .preview-close {
  opacity: 1;
}

.preview-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.user-card {
  max-width: 80%;
  margin: 0 auto 30px auto;

  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 30px;

  padding: 40px;

  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;

  backdrop-filter: blur(10px);
}

.user-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  margin-bottom: 16px;
}

.user-info {
  text-align: left;
}

.username {
  opacity: 0.6;
  margin-top: -6px;
}

.bio {
  margin-top: 10px;
  opacity: 0.8;
}

.user-stats {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;

  font-size: 14px;
  text-align: left;
}

.user-stats div {
  display: flex;
  justify-content: flex-start;
  gap: 6px;
}

.user-stats strong {
  font-size: 16px;
}

.user-meta {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;

  font-size: 13px;
  opacity: 0.85;

  text-align: left;
}

.user-meta a {
  color: var(--link-color);
  text-decoration: none;
}

.user-meta a:hover {
  text-decoration: underline;
}

.readme-card {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;

  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.03);

  overflow: auto;
}

.readme-card h1,
.readme-card h2,
.readme-card h3 {
  margin-top: 20px;
  margin-bottom: 10px;
  color: white;
}

.readme-card pre {
  background: rgba(0, 0, 0, 0.4);
  padding: 12px;
  border-radius: 10px;
  overflow-x: auto;
}

.readme-card code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
}

.readme-card blockquote {
  border-left: 3px solid var(--link-color);
  padding-left: 12px;
  opacity: 0.8;
}

.readme-card a,
.inner-user-stats a {
  color: var(--link-color);
  text-decoration: none;
}

.user-stats a {
  color: white;
  text-decoration: none;
}

.readme-card a:hover,
.inner-user-stats a:hover,
.user-stats a:hover {
  text-decoration: underline;
}

.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  min-height: 200px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #e1e4e8;
  border-top: 4px solid #58a6ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.loading-text {
  margin-left: 1rem;
  color: #57606a;
  font-size: 0.9rem;
}

.loading-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.repo-skeleton {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: pulse 1.5s ease-in-out infinite;
}

.lang-selector-wrapper {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.lang-selector-dropdown {
  position: relative;
  display: inline-block;
}

.lang-selector-dropdown .dropdown-btn {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  min-width: 100px;
}

.lang-selector-dropdown .dropdown-menu {
  position: absolute;
  top: 120%;
  right: 0;
  min-width: 100px;
  z-index: 20;
  display: none;
  max-height: 300px;
  overflow-y: auto;
}

.lang-selector-dropdown.open .dropdown-menu {
  display: block;
}

.lang-selector-dropdown .dropdown-item {
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  transition: 0.1s;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.skeleton-title {
  height: 24px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  margin-bottom: 0.5rem;
  width: 70%;
}

.skeleton-description {
  height: 60px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.skeleton-meta {
  height: 20px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  width: 60%;
}

.charts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.chart-section {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  padding: 1.5rem;
  margin: 1rem;
  width: 400px;
  flex-shrink: 0;
  backdrop-filter: blur(10px);
  height: auto;
}

.chart-section h2 {
  text-align: center;
  margin-bottom: 1rem;
}

.chart-container {
  position: relative;

  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.collapsible-section {
  margin-bottom: 24px;

}

.section-toggle {

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;

  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);

  color: white;
  padding: 18px 22px;
  border-radius: 16px;

  cursor: pointer;
  font-size: 1.1rem;
  font-weight: bold;

  backdrop-filter: blur(10px);

  transition: 0.2s ease;
}

.section-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.section-toggle i {
  transition: transform 0.25s ease;
}


.section-content {
  overflow: hidden;
  opacity: 1;

  transition:
    max-height 0.35s ease,
    opacity 0.25s ease,
    margin-top 0.25s ease;

  margin-top: 16px;
}

.collapsible-section:not(.open) .section-content {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

.collapsible-section:not(.open) .language-chart-section,
.collapsible-section:not(.open) #repos,
.collapsible-section:not(.open) .repositories {
  pointer-events: none;
}

.contribution-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}

.contribution-stats {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

.contribution-stats strong {
  color: white;
  font-size: 1.1rem;
}

.contribution-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
}

.legend-colors {
  display: flex;
  gap: 3px;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.legend-color.level-0 {
  background-color: var(--detail-color-0);
  border: 1px solid var(--accent-color-0);
}

.legend-color.level-1 {
  background-color: var(--detail-color-1);
  border: 1px solid var(--accent-color-1);
}

.legend-color.level-2 {
  background-color: var(--detail-color-2);
  border: 1px solid var(--accent-color-2);
}

.legend-color.level-3 {
  background-color: var(--detail-color-3);
  border: 1px solid var(--accent-color-3);
}

.legend-color.level-4 {
  background-color: var(--detail-color-4);
  border: 1px solid var(--accent-color-4);
}

.contribution-grid {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 1.5rem;
  overflow-x: auto;
  display: inline-flex;
  justify-content: center;
  flex-direction: column;
}

.contribution-grid-wrapper {
  display: flex;
  justify-content: center;
}

.contribution-wrapper {
  min-width: 100%;
  overflow-x: auto;
}

.contribution-calendar {
  display: flex;
  flex-direction: row;
  gap: 3px;
  min-width: max-content;
}

.contribution-week {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.contribution-months {
  display: flex;
  flex-direction: row;
  gap: 3px;
  margin-bottom: 8px;
  margin-left: 28px;
}

.contribution-month {
  width: 12px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  white-space: nowrap;
}

.contribution-days {
  display: flex;
  flex-direction: row;
  gap: 3px;
  margin-bottom: 4px;
}

.contribution-day-label {
  width: 12px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
}

.contribution-day-label:first-child {
  width: 28px;
  text-align: right;
  margin-right: 0;
}

.contribution-grid-row {
  display: flex;
  flex-direction: row;
  gap: 3px;
}

.contribution-day {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  transition: transform 0.1s ease, filter 0.1s ease;
}

.contribution-day:hover {
  filter: brightness(1.5);
}

.contribution-day.level-0 {
  background-color: var(--detail-color-0, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--accent-color-0, rgba(255, 255, 255, 0.08));
}

.contribution-day.level-1 {
  background-color: var(--detail-color-1, rgba(14, 68, 41, 0.55));
  border: 1px solid var(--accent-color-1, rgba(14, 120, 60, 0.7));
}

.contribution-day.level-2 {
  background-color: var(--detail-color-2, rgba(0, 109, 50, 0.65));
  border: 1px solid var(--accent-color-2, rgba(0, 160, 70, 0.8));
}

.contribution-day.level-3 {
  background-color: var(--detail-color-3, rgba(38, 166, 65, 0.72));
  border: 1px solid var(--accent-color-3, rgba(80, 220, 100, 0.85));
}

.contribution-day.level-4 {
  background-color: var(--detail-color-4, rgba(57, 211, 83, 0.80));
  border: 1px solid var(--accent-color-4, rgba(120, 255, 140, 0.9));
}

.contribution-tooltip {
  position: fixed;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.75rem;
  color: white;
  pointer-events: none;
  z-index: 1000;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  font-family: monospace;
  font-weight: 500;
}

.contribution-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  color: rgba(255, 255, 255, 0.5);
}

.empty-activity {
  text-align: center;
  padding: 3rem;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.9rem;
}

.activity-section {
  margin-top: 0;
}

.activity-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.activity-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.activity-icon {
  font-size: 1.2rem;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.activity-list::-webkit-scrollbar {
  width: 6px;
}

.activity-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.activity-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.activity-item {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  transition: 0.15s ease;
  border-left: 3px solid var(--accent-color-3);
}

.activity-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.activity-header-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.activity-event-icon {
  width: 24px;
  text-align: center;
  font-size: 0.9rem;
}

.activity-event-type {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent-color-4);
}

.activity-repo {
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
}

.activity-repo:hover {
  text-decoration: underline;
}

.activity-time {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  margin-left: auto;
}

.activity-details {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  padding-left: 1.8rem;
  margin-top: 0.25rem;
}

.activity-branch {
  background: rgba(88, 166, 255, 0.15);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.7rem;
}

.activity-commit-msg {
  font-family: monospace;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.25rem;
  padding-left: 0.5rem;
  border-left: 2px solid rgba(255, 255, 255, 0.2);
}

.activity-footer {
  text-align: center;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.activity-footer a {
  color: var(--accent-color-3);
  text-decoration: none;
  font-size: 0.85rem;
}

.activity-footer a:hover {
  text-decoration: underline;
}

.empty-activity {
  text-align: center;
  padding: 2rem;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.9rem;
}

.activity-skeleton {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 1rem;
  animation: pulse 1.5s ease-in-out infinite;
}

.activity-skeleton-line {
  height: 16px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.activity-skeleton-line.short {
  width: 60%;
}

.contribution-dashboard {
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 20px;
  background: transparent;
  border-radius: 16px;
}

.charts-row {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-top: 10px;
}

.chart-container h3 {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  margin-bottom: 12px;
  font-weight: 500;
  text-align: center;
}

#weeklyLineChart,
#monthlyLineChart,
#yearlyLineChart {
  display: block;
  width: 100% !important;
  height: auto !important;
  background: transparent;
}

.contribution-grid-wrapper {
  overflow-x: auto;
  padding: 10px 0;
}

.chart-container {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 15px;
  min-width: 0;
  transition: none;
}

@media (max-width: 900px) {
  .charts-row {
    flex-wrap: wrap;
  }

  .chart-container {
    flex: 1;
    min-width: 200px;
  }
}

@media (max-width: 768px) {
  .charts-row {
    flex-direction: column;
    gap: 15px;
  }

  .chart-container {
    padding: 12px;
    background: rgba(0, 0, 0, 0.1);
  }

  .chart-container h3 {
    font-size: 11px;
    margin-bottom: 10px;
  }

  .contribution-dashboard {
    padding: 10px;
    gap: 20px;
  }
}

@media (max-width: 480px) {
  .chart-container {
    padding: 10px;
    background: rgba(0, 0, 0, 0.08);
  }

  #weeklyLineChart,
  #monthlyLineChart,
  #yearlyLineChart {
    max-height: 160px;
  }
}

@media (max-width: 900px) {
  .sorters {
    margin-bottom: 1rem
  }

  .user-card {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .user-left {
    align-items: center;
    text-align: center;
  }

  .user-info {
    text-align: center;
  }

  .user-stats,
  .user-meta {
    align-items: center;
    text-align: center;
  }

  .user-stats div {
    justify-content: center;
  }

  .avatar {
    width: 120px;
    height: 120px;
  }

  .readme-card {
    max-height: 600px;
  }
}

@media (max-width: 600px) {
  body {
    padding: 16px;
  }

  .user-card {
    padding: 20px;
  }

  .avatar {
    width: 100px;
    height: 100px;
  }

  .user-stats {
    font-size: 13px;
  }

  .user-stats strong {
    font-size: 15px;
  }

  .readme-card {
    padding: 16px;
    font-size: 14px;
  }

  .repo-grid {
    grid-template-columns: 1fr;
  }

  .search-container {
    width: 100%;
  }

  .repositories {
    flex-direction: column;
  }
}

@media (max-width: 400px) {
  .avatar {
    width: 90px;
    height: 90px;
  }

  .user-card {
    border-radius: 12px;
  }

  .readme-card {
    font-size: 13px;
  }
}