/* ==========================================================================
   External Stylesheet (style.css)
   GitHub User Card & Stats Web App
   Beginner-friendly, clean GitHub Light Theme
   ========================================================================== */

/* Basic Reset & Font */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: #f6f8fa;
  color: #24292f;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Navigation Bar */
header {
  background-color: #ffffff;
  border-bottom: 1px solid #d0d7de;
  padding: 0.85rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.nav-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: #24292f;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-icon img {
  width: 24px;
  height: 24px;
  display: block;
  border-radius: 4px;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.25rem;
}

nav a {
  text-decoration: none;
  color: #57609a;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

nav a:hover,
nav a.active {
  color: #0969da;
  background-color: #f3f4f6;
}

/* Main Content Container */
main {
  max-width: 800px;
  width: 90%;
  margin: 2rem auto;
  flex: 1;
}

/* Card Container */
.card {
  background-color: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 1.75rem;
  margin-bottom: 1.75rem;
  box-shadow: 0 1px 3px rgba(31, 35, 40, 0.06);
}

.card h1, .card h2 {
  color: #1f2328;
  margin-bottom: 0.75rem;
}

.subtitle {
  color: #656d76;
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

/* Search Form */
.search-form {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.search-input {
  flex: 1;
  padding: 0.65rem 0.9rem;
  font-size: 1rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  outline: none;
  background-color: #ffffff;
}

.search-input:focus {
  border-color: #0969da;
  box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.2);
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid rgba(27, 31, 36, 0.15);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.btn-primary {
  background-color: #1f883d;
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #1a7f37;
}

.btn-secondary {
  background-color: #f6f8fa;
  color: #24292f;
  border: 1px solid #d0d7de;
}

.btn-secondary:hover {
  background-color: #eaeef2;
}

.quick-links {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: #656d76;
}

.quick-links a {
  color: #0969da;
  text-decoration: none;
  margin-right: 0.5rem;
}

.quick-links a:hover {
  text-decoration: underline;
}

/* Status / Alert Messages */
.status-msg {
  padding: 0.85rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.25rem;
  display: none;
  font-size: 0.95rem;
}

.status-loading {
  background-color: #ddf4ff;
  border: 1px solid #54aeff;
  color: #0969da;
  display: block;
}

.status-error {
  background-color: #ffebe9;
  border: 1px solid #ff8182;
  color: #cf222e;
  display: block;
}

/* User Profile Badge */
.profile-card {
  display: none;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.profile-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 2px solid #d0d7de;
  object-fit: cover;
}

.profile-names h2 {
  font-size: 1.4rem;
  margin-bottom: 0.2rem;
}

.profile-username {
  color: #656d76;
  font-size: 0.95rem;
}

.profile-bio {
  color: #24292f;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

/* Stats Counter Row */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  background-color: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 0.85rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

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

.stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #0969da;
}

.stat-label {
  font-size: 0.8rem;
  color: #656d76;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Profile Details (Location, Company, etc.) */
.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
  color: #656d76;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eaeef2;
}

/* Recent Repositories Section */
.repos-section {
  margin-top: 1.25rem;
}

.repos-section h3 {
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
  color: #24292f;
}

.repo-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.repo-card {
  padding: 0.75rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background-color: #ffffff;
}

.repo-title {
  font-weight: 600;
  color: #0969da;
  text-decoration: none;
  font-size: 0.95rem;
}

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

.repo-desc {
  font-size: 0.85rem;
  color: #656d76;
  margin: 0.3rem 0;
}

.repo-meta {
  font-size: 0.75rem;
  color: #656d76;
  display: flex;
  gap: 1rem;
}

/* Profile Actions (Buttons & JSON Toggle) */
.profile-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

/* Raw JSON Viewer */
.json-viewer {
  display: none;
  margin-top: 1.25rem;
  background-color: #24292f;
  color: #e6edf3;
  padding: 1rem;
  border-radius: 6px;
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
  font-size: 0.85rem;
  overflow-x: auto;
  max-height: 350px;
}

/* Code block on docs page */
code, pre {
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

pre {
  background-color: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 0.9rem;
  overflow-x: auto;
  font-size: 0.85rem;
  margin: 0.75rem 0;
}

.endpoint-badge {
  display: inline-block;
  background-color: #0969da;
  color: #ffffff;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.85rem;
  margin-right: 0.5rem;
}

/* Footer */
footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
  color: #656d76;
  border-top: 1px solid #d0d7de;
  background-color: #ffffff;
  margin-top: auto;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .search-form {
    flex-direction: column;
  }
  .profile-header {
    flex-direction: column;
    text-align: center;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .profile-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
}

