/* Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
  color: #1a1a1a;
  background: #fafafa;
}

/* Nav */
nav {
  background: #1a1a1a;
  color: #fff;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
}

nav a {
  color: #fff;
  text-decoration: none;
}

nav a:hover {
  text-decoration: underline;
}

nav .nav-brand {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

nav .nav-logout {
  margin-left: auto;
  font-size: 0.9rem;
  opacity: 0.8;
}

nav .nav-logout:hover {
  opacity: 1;
}

main {
  padding: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.55rem 1.25rem;
  background: #333;
  color: #fff;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: 6px;
  transition: background 0.15s;
}

.btn:hover {
  background: #555;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Login page */
body.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #fafafa;
}

body.login-page .login-icon {
  color: #0066cc;
  margin-bottom: 1rem;
}

body.login-page h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
}

body.login-page .login-tagline {
  margin: 0.25rem 0 1.5rem;
  font-size: 0.95rem;
  color: #666;
}

body.login-page form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 280px;
}

body.login-page input[type="password"] {
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  transition: border-color 0.15s;
}

body.login-page input:focus {
  outline: none;
  border-color: #0066cc;
}

body.login-page .error {
  color: #c00;
  margin: 0;
  font-size: 0.9rem;
}

/* Search page */
.search-container {
  padding-top: 2rem;
}

.search-header {
  text-align: center;
  margin-bottom: 2rem;
}

.search-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.search-hint {
  color: #888;
  font-size: 0.9rem;
  margin: 0;
}

.search-bar {
  display: flex;
  gap: 0.5rem;
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

.search-bar input {
  flex: 1;
  padding: 0.65rem 1rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  transition: border-color 0.15s;
}

.search-bar input:focus {
  outline: none;
  border-color: #0066cc;
}

.btn-search {
  background: #0066cc;
  padding: 0.65rem 1.5rem;
  font-size: 1rem;
  white-space: nowrap;
}

.btn-search:hover {
  background: #0052a3;
}

/* Status / loading */
.search-status {
  text-align: center;
  padding: 1rem;
  color: #666;
  font-size: 0.95rem;
}

.search-status.error {
  color: #c00;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #ccc;
  border-top-color: #0066cc;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 0.5rem;
}

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

/* Results grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.results-count {
  grid-column: 1 / -1;
  font-size: 0.9rem;
  color: #666;
  padding-bottom: 0.25rem;
}

.person-card {
  background: #fff;
  border: 2px solid #e8e8e8;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  transition: box-shadow 0.15s, border-color 0.15s;
  cursor: pointer;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  position: relative;
}

.person-card:hover {
  border-color: #ccc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.person-card.selected {
  border-color: #0066cc;
  background: #f0f7ff;
}

.card-check {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2px solid #ccc;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: background 0.15s, border-color 0.15s;
}

.card-check .check-icon {
  width: 14px;
  height: 14px;
  opacity: 0;
  transition: opacity 0.1s;
  color: #fff;
}

.person-card.selected .card-check {
  background: #0066cc;
  border-color: #0066cc;
}

.person-card.selected .card-check .check-icon {
  opacity: 1;
}

.card-body {
  flex: 1;
  min-width: 0;
}

.person-card .card-name {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.streak-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: #0066cc;
  text-decoration: none;
  white-space: nowrap;
}

.streak-link:hover {
  text-decoration: underline;
}

.streak-link svg {
  width: 14px;
  height: 14px;
}

.linkedin-link {
  display: inline-flex;
  align-items: center;
  color: #0a66c2;
  transition: opacity 0.15s;
}

.linkedin-link:hover {
  opacity: 0.75;
}

.linkedin-link svg {
  width: 18px;
  height: 18px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 999px;
  background: #e8f4ff;
  color: #0052a3;
  white-space: nowrap;
}

.tag-pill.matched {
  background: #0066cc;
  color: #fff;
}

/* Action bar (sticky bottom) */
.action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1a1a1a;
  color: #fff;
  padding: 0.75rem 1.5rem;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.2s ease-out;
}

.action-bar[hidden] {
  display: none;
}

.action-bar:not([hidden]) {
  display: flex;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.action-bar span {
  font-size: 0.9rem;
  opacity: 0.8;
}

.btn-generate {
  background: #0066cc;
  font-size: 0.9rem;
  padding: 0.5rem 1.25rem;
}

.btn-generate:hover {
  background: #0052a3;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%) translateY(1rem);
  background: #333;
  color: #fff;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Cap / truncation note */
.results-cap-note {
  grid-column: 1 / -1;
  text-align: center;
  padding: 1rem;
  font-size: 0.85rem;
  color: #888;
  border-top: 1px solid #e8e8e8;
  margin-top: 0.5rem;
}

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: #888;
}

.empty-state p {
  margin: 0;
  font-size: 1rem;
}
