/* === Shared Components === */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  border-radius: var(--btn-radius);
  font-size: 15px;
  font-weight: 500;
  transition: background-color var(--transition-hover),
              opacity var(--transition-hover);
  user-select: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-outline {
  border: 1px solid var(--border);
  color: var(--text-primary);
}

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

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: var(--accent-subtle);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* Cards */
.card {
  background: var(--bg-secondary);
  border-radius: var(--card-radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 150ms ease, box-shadow 150ms ease;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-body {
  padding: var(--space-md);
}

/* Page header */
.page-header {
  margin-bottom: var(--space-lg);
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Modal / Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.modal {
  background: var(--bg-elevated);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  overflow-y: auto;
  padding: var(--space-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--accent-subtle);
}

/* Bottom Sheet (mobile) */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 199;
  background: var(--overlay);
  animation: fadeIn 200ms ease;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--bg-elevated);
  border-radius: 16px 16px 0 0;
  box-shadow: var(--shadow-lg);
  padding: var(--space-lg);
  padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom, 0px));
  max-height: 70vh;
  overflow-y: auto;
}

.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 0 auto var(--space-md);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--space-md);
}

.empty-state-text {
  font-size: 15px;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-subtle);
  color: var(--accent);
}

/* Divider */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-md) 0;
}

/* About */
.about-page {
  overflow-y: auto;
}

.about-hero {
  max-width: 760px;
}

.about-site-icon {
  width: 72px;
  height: 72px;
  display: block;
  margin-bottom: var(--space-md);
  border-radius: 18px;
}

.about-kicker {
  display: inline-block;
  margin-bottom: var(--space-xs);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.about-hero p,
.about-section p,
.about-list {
  color: var(--text-secondary);
  line-height: 1.75;
}

.about-version-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin: var(--space-sm) 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.about-site-version {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 800;
  line-height: 1;
}

.about-content {
  display: grid;
  gap: var(--space-lg);
  max-width: 860px;
}

.about-section {
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--border);
}

.about-section h2 {
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
}

.about-section h3 {
  margin-bottom: 6px;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
}

.about-ai-note {
  border-top: 0;
  padding-top: 0;
}

.about-grid {
  display: grid;
  gap: var(--space-md);
}

.about-grid article {
  padding: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  background: var(--bg-secondary);
}

.about-github-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin: 2px 0 var(--space-md);
  padding: 10px 18px;
  border-radius: var(--btn-radius);
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background-color var(--transition-hover),
              box-shadow var(--transition-hover),
              transform 120ms ease;
}

.about-github-button:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.about-github-button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent);
  outline-offset: 2px;
}

.about-list {
  margin: 0;
  padding-left: 1.2em;
}

.about-section code {
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.95em;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Responsive */
@media (min-width: 640px) {
  .page-title {
    font-size: 26px;
  }
}
