/* ==========================================================================
   Napkin - Custom styles on top of Pico CSS
   ========================================================================== */

/* -- Brand ---------------------------------------------------------------- */
.brand {
  text-decoration: none;
}

/* -- Category Badges ------------------------------------------------------ */
.badge {
  display: inline-block;
  padding: 0.15em 0.55em;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 4px;
  color: #fff;
  background: var(--pico-muted-color);
}

.badge-bookmark {
  background: #2563eb;
}

.badge-code {
  background: #16a34a;
}

.badge-note {
  background: #ca8a04;
}

/* -- Filter Tabs ---------------------------------------------------------- */
.filter-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--pico-muted-border-color);
  padding-bottom: 0;
}

.filter-tab {
  padding: 0.5rem 1rem;
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--pico-muted-color);
  transition: color 0.15s, border-color 0.15s;
}

.filter-tab:hover {
  color: var(--pico-color);
}

.filter-tab.active {
  color: var(--pico-primary);
  border-bottom-color: var(--pico-primary);
  font-weight: 600;
}

/* -- Clip Cards ----------------------------------------------------------- */
.clip-card {
  margin-bottom: 1rem;
  padding: 0;
  transition: box-shadow 0.15s, transform 0.15s;
}

.clip-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.clip-card-link {
  display: block;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: inherit;
}

.clip-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.clip-card-title {
  margin: 0 0 0.3rem;
  font-size: 1rem;
}

.clip-card-preview {
  margin: 0;
  font-size: 0.875rem;
  color: var(--pico-muted-color);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.clip-card-source {
  display: block;
  margin-top: 0.5rem;
  color: var(--pico-muted-color);
}

/* -- Time Ago ------------------------------------------------------------- */
.time-ago {
  margin-left: auto;
  color: var(--pico-muted-color);
  white-space: nowrap;
}

/* -- Star / Favorite ------------------------------------------------------ */
.star {
  color: var(--pico-muted-color);
  font-size: 1.1rem;
  line-height: 1;
}

.star.active {
  color: #eab308;
}

.favorite-btn {
  cursor: pointer;
}

.favorite-btn.active {
  color: #eab308;
}

/* -- Clip Detail ---------------------------------------------------------- */
.clip-detail-nav {
  margin-bottom: 1rem;
}

.clip-detail-header {
  margin-bottom: 1.5rem;
}

.clip-detail-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.clip-detail-title-row h2 {
  margin: 0;
}

.clip-detail-meta {
  margin-top: 0.25rem;
  color: var(--pico-muted-color);
}

.clip-detail-body {
  margin-bottom: 1.5rem;
}

.clip-detail-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Code blocks */
.clip-content-code pre {
  max-height: 500px;
  overflow: auto;
  border-radius: 6px;
}

/* Bookmark link */
.clip-content-bookmark a {
  word-break: break-all;
}

/* -- Search --------------------------------------------------------------- */
.search-container {
  margin-bottom: 1.5rem;
}

.result-count {
  font-size: 0.875rem;
  color: var(--pico-muted-color);
  margin-bottom: 1rem;
}

/* Highlight */
.highlight {
  background: #fef08a;
  color: inherit;
  padding: 0.05em 0.15em;
  border-radius: 2px;
}

/* -- Empty State ---------------------------------------------------------- */
.empty-state {
  text-align: center;
  color: var(--pico-muted-color);
  padding: 3rem 1rem;
}

/* -- Delete Button -------------------------------------------------------- */
.delete-btn {
  margin-left: auto;
}

/* -- Responsive ----------------------------------------------------------- */
@media (max-width: 576px) {
  .filter-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .clip-detail-actions {
    flex-direction: column;
  }

  .clip-detail-actions button {
    width: 100%;
  }

  .delete-btn {
    margin-left: 0;
  }
}
