* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0d1117;
  --card: rgba(255, 255, 255, 0.08);
  --text: #ffffff;
  --secondary: #c9d1d9;
  --accent: #58a6ff;
  --border: rgba(255,255,255,0.15);
  --shadow: 0 8px 30px rgba(0,0,0,0.25);
}

body.light {
  --bg: #f5f7fa;
  --card: rgba(255,255,255,0.7);
  --text: #111827;
  --secondary: #4b5563;
  --accent: #2563eb;
  --border: rgba(0,0,0,0.08);
}

body {
  font-family: "Poppins", sans-serif;
  min-height: 100vh;
  background: linear-gradient(
    135deg,
    #0d1117,
    #161b22,
    #21262d
  );
  color: var(--text);
  transition: 0.4s;
}

body.light {
  background: linear-gradient(
    135deg,
    #f8fafc,
    #eef2ff,
    #dbeafe
  );
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
  padding: 30px 0;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
}

.theme-btn {
  border: none;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  background: var(--card);
  color: var(--text);
  backdrop-filter: blur(12px);
  font-size: 1rem;
  transition: 0.3s;
}

.theme-btn:hover {
  transform: translateY(-3px);
}

.search-box {
  display: flex;
  gap: 12px;
  margin-bottom: 25px;
}

.search-box input {
  flex: 1;
  padding: 15px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  outline: none;
  backdrop-filter: blur(10px);
}

.search-box button {
  padding: 15px 22px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: 0.3s;
}

.search-box button:hover {
  transform: translateY(-2px);
}

.history-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 25px;
}

.history-btn {
  padding: 8px 14px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  background: var(--card);
  color: var(--text);
}

.loader {
  text-align: center;
  margin: 30px 0;
}

.hidden {
  display: none;
}

.spinner {
  width: 60px;
  height: 60px;
  margin: auto;
  border: 5px solid rgba(255,255,255,0.15);
  border-top: 5px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loader p {
  margin-top: 10px;
}

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

.error {
  padding: 15px;
  border-radius: 12px;
  background: #dc2626;
  color: white;
  margin-bottom: 20px;
}

.profile-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 25px;
  padding: 25px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 25px;
  animation: fadeIn 0.5s ease;
}

.profile-avatar img {
  width: 100%;
  border-radius: 50%;
}

.profile-info h2 {
  margin-bottom: 10px;
}

.profile-info p {
  color: var(--secondary);
  margin-bottom: 10px;
}

.profile-link {
  display: inline-block;
  margin-top: 10px;
  text-decoration: none;
  color: white;
  background: var(--accent);
  padding: 10px 15px;
  border-radius: 10px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 15px;
  margin-top: 20px;
}

.stat {
  background: rgba(255,255,255,0.06);
  border-radius: 15px;
  padding: 15px;
  text-align: center;
}

.stat h3 {
  font-size: 1.2rem;
}

.stat p {
  margin-top: 5px;
  color: var(--secondary);
}

#repoContainer {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(280px,1fr));
  gap: 20px;
}

.repo-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  backdrop-filter: blur(12px);
  transition: 0.3s;
}

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

.repo-card h3 {
  margin-bottom: 10px;
}

.repo-card p {
  color: var(--secondary);
  margin-bottom: 10px;
}

.repo-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 0.9rem;
}

.repo-card a {
  text-decoration: none;
  color: var(--accent);
}

.copy-btn {
  margin-top: 15px;
  padding: 10px 15px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: #22c55e;
  color: white;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .profile-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .profile-avatar {
    max-width: 220px;
    margin: auto;
  }

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

@media (max-width: 600px) {
  .search-box {
    flex-direction: column;
  }

  .search-box button {
    width: 100%;
  }

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

  header h1 {
    font-size: 1.5rem;
  }
}