/* ============================================
   GITFINDER — same design language as portfolio
   ============================================ */

:root {
  --bg: #0e0e0e;
  --bg-alt: #121212;
  --bg-surface: rgba(255, 255, 255, 0.04);
  --bg-surface-hover: rgba(255, 255, 255, 0.07);
  --bg-elevated: rgba(20, 20, 20, 0.85);

  --border: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(255, 255, 255, 0.18);

  --text: #f0eeea;
  --text-muted: #a8a49f;
  --text-subtle: #6e6a66;

  --accent: #a78bfa;
  --accent-hover: #b8a0fc;
  --accent-glow: rgba(167, 139, 250, 0.35);
  --accent-subtle: rgba(167, 139, 250, 0.12);

  --error: #ff8a8a;
  --error-subtle: rgba(255, 138, 138, 0.1);

  --font-heading: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;

  --radius: 14px;
  --radius-sm: 8px;
  --ease: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-smooth: 0.5s cubic-bezier(0.22, 1, 0.36, 1);

  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.22);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.35);
}

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

html { font-size: 17px; scroll-behavior: smooth; }

@media (max-width: 480px) { html { font-size: 16px; } }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 12% 20%, rgba(167, 139, 250, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse at 88% 75%, rgba(167, 139, 250, 0.04) 0%, transparent 55%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  background: var(--accent-subtle);
  color: var(--text);
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.18); }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--ease);
}

button { font-family: inherit; cursor: pointer; }

img { max-width: 100%; display: block; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 28px 80px;
}

/* ============================================
   HEADER BAR (back link + lang switcher)
   ============================================ */
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 36px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-subtle);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 50px;
  transition: color var(--ease), background var(--ease);
}

.back-link:hover {
  color: var(--text);
  background: var(--bg-surface);
}

.lang-toggle {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 3px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.lang-toggle button {
  background: none;
  border: none;
  color: var(--text-subtle);
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 6px 12px;
  border-radius: 50px;
  cursor: pointer;
  transition: color var(--ease), background var(--ease);
}

.lang-toggle button:hover {
  color: var(--text);
}

.lang-toggle button.active {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(167, 139, 250, 0.3);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  text-align: center;
  margin-bottom: 56px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.brand-icon {
  color: var(--accent);
  filter: drop-shadow(0 0 12px var(--accent-glow));
}

.brand h1 {
  font-family: var(--font-heading);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.brand h1 span {
  color: var(--accent);
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-hover) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 460px;
  margin: 0 auto 36px;
}

/* ============================================
   SEARCH
   ============================================ */
.search-form {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 540px;
  margin: 0 auto 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 6px 6px 6px 22px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: border-color var(--ease), box-shadow var(--ease);
}

.search-form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.search-prefix {
  color: var(--text-subtle);
  font-weight: 500;
}

.search-form input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.96rem;
  outline: none;
  padding: 12px 4px;
}

.search-form input::placeholder { color: var(--text-subtle); }

.search-form button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 11px 22px;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: background var(--ease), transform var(--ease), box-shadow var(--ease);
  box-shadow: 0 4px 16px rgba(167, 139, 250, 0.25);
}

.search-form button:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(167, 139, 250, 0.4);
}

.search-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Suggestions */
.suggestions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-subtle);
}

.chip {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 500;
  transition: border-color var(--ease), color var(--ease), background var(--ease);
}

.chip:hover {
  border-color: var(--accent-subtle);
  color: var(--accent);
  background: var(--accent-subtle);
}

/* ============================================
   STATES
   ============================================ */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-subtle);
  font-size: 0.95rem;
}

.empty-state.hidden { display: none; }

.loader {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 80px 20px;
  color: var(--text-muted);
}

.loader-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-hover);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 60px 24px;
  text-align: center;
  background: var(--error-subtle);
  border: 1px solid rgba(255, 138, 138, 0.2);
  border-radius: var(--radius);
  color: var(--error);
}

.error-state strong {
  font-family: var(--font-heading);
  font-size: 1.15rem;
}

.error-state p { color: var(--text-muted); font-size: 0.92rem; }

/* ============================================
   PROFILE CARD
   ============================================ */
.result { animation: fadeIn 0.5s var(--ease-smooth); }

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

.profile-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 36px;
  align-items: start;
  padding: 40px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 48px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--shadow-md);
}

.profile-avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 2px solid var(--accent-subtle);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 6px rgba(167, 139, 250, 0.04);
}

.profile-info h2 {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  line-height: 1.15;
}

.profile-login {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-weight: 500;
  font-size: 0.96rem;
  margin-bottom: 18px;
}

.profile-login:hover { color: var(--accent-hover); }

.profile-bio {
  color: var(--text-muted);
  margin-bottom: 22px;
  line-height: 1.7;
  font-size: 0.96rem;
}

.profile-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  font-size: 0.86rem;
  color: var(--text-subtle);
}

.profile-meta a:hover { color: var(--accent); }

.profile-meta .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.profile-meta svg { color: var(--text-subtle); flex-shrink: 0; }

.profile-stats {
  display: flex;
  gap: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat strong {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  color: var(--text);
  font-weight: 700;
  line-height: 1.1;
}

.stat span {
  font-size: 0.72rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 6px;
  font-weight: 500;
}

.profile-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 22px;
  padding: 10px 20px;
  background: transparent;
  border: 1px solid var(--border-hover);
  border-radius: 50px;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 500;
  transition: border-color var(--ease), background var(--ease), transform var(--ease);
}

.profile-cta:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
  color: var(--accent);
  transform: translateY(-1px);
}

@media (max-width: 720px) {
  .profile-card {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 32px 24px;
    gap: 24px;
  }
  .profile-avatar { margin: 0 auto; width: 130px; height: 130px; }
  .profile-stats { justify-content: center; gap: 28px; }
  .profile-meta { justify-content: center; }
  .profile-login { justify-content: center; }
}

/* ============================================
   REPOS
   ============================================ */
.repos-section { margin-top: 4px; }

.repos-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
  font-family: var(--font-heading);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 2.8px;
}

.repos-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.repos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

.repo-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.repo-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.repo-card h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}

.repo-card p {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 18px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.repo-card p.muted { color: var(--text-subtle); font-style: italic; }

.repo-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--text-subtle);
  flex-wrap: wrap;
}

.repo-footer .repo-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.repo-footer .lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  background: var(--accent-subtle);
  color: var(--accent);
  border-radius: 50px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.lang-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  margin-top: 80px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-subtle);
}

.footer a {
  color: var(--text-muted);
  font-weight: 500;
}

.footer a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
