/* GoRSS - Hacker News / Lobste.rs inspired minimal design */

:root {
  --bg: #f5f5f5;
  --bg-alt: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666666;
  --link: #1a1a1a;
  --link-hover: #4a6fa5;
  --accent: #4a6fa5;
  --border: #ddd;
  --unread-bg: #f0f4f8;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
}

/* Header */
.header {
  background: var(--accent);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.header-logo {
  font-weight: bold;
  font-size: 16px;
  color: #fff;
}

.header-logo:hover {
  color: #fff;
}

.header-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.header-nav a {
  color: #fff;
  padding: 4px 8px;
}

.header-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
}

.header-nav a.active {
  font-weight: bold;
}

.nav-count {
  font-size: 12px;
  opacity: 0.8;
}

.header-right {
  margin-left: auto;
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Search box */
.search-box {
  position: relative;
  margin-bottom: 16px;
}

.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  z-index: 100;
  max-height: 200px;
  overflow-y: auto;
}

.suggestion-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
}

.suggestion-item:hover,
.suggestion-item.selected {
  background: var(--unread-bg);
}

/* Container */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
}

/* Articles list */
.articles {
  background: var(--bg-alt);
  border: 1px solid var(--border);
}

.article {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.article:last-child {
  border-bottom: none;
}

.article.unread {
  background: var(--unread-bg);
}

.article-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 20px;
}

.article-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px;
  opacity: 0.4;
  color: var(--text);
}

.article-btn:hover {
  opacity: 1;
}

.article-btn.active {
  opacity: 1;
  color: var(--accent);
}

.article-content {
  flex: 1;
  min-width: 0;
}

.article-title {
  font-size: 14px;
  word-break: break-word;
}

.article-title a {
  color: var(--text);
}

.article-title a:visited {
  color: var(--text-muted);
}

.article-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.article-meta a {
  color: var(--text-muted);
}

.article-meta a:hover {
  color: var(--link-hover);
}

.article-domain {
  color: var(--text-muted);
}

.sep {
  margin: 0 4px;
}

/* Feed list */
.feeds-list {
  background: var(--bg-alt);
  border: 1px solid var(--border);
}

.feed-item {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.feed-item:last-child {
  border-bottom: none;
}

.feed-info {
  flex: 1;
  min-width: 0;
}

.feed-title {
  font-weight: 500;
}

.feed-url {
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-all;
}

.feed-stats {
  font-size: 12px;
  color: var(--text-muted);
}

.feed-details-toggle {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

.feed-details-toggle:hover {
  text-decoration: underline;
}

.feed-details {
  margin-top: 8px;
  padding: 8px;
  background: var(--bg);
  border-radius: 4px;
  font-size: 12px;
  font-family: monospace;
}

.feed-details div {
  margin-bottom: 4px;
}

.feed-details div:last-child {
  margin-bottom: 0;
}

.feed-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 8px;
  font-weight: normal;
}

.feed-disabled {
  background: #666;
  color: #fff;
}

.feed-error {
  background: #c00;
  color: #fff;
}

.feed-actions {
  display: flex;
  gap: 8px;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

.btn:hover {
  opacity: 0.9;
  color: #fff;
}

.btn-small {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-danger {
  background: #c00;
}

.btn-secondary {
  background: var(--text-muted);
}

/* Login page */
.login-container {
  max-width: 360px;
  margin: 80px auto;
  padding: 24px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
}

.login-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 24px;
  text-align: center;
}

.error-message {
  background: #fdd;
  color: #c00;
  padding: 10px;
  margin-bottom: 16px;
  border-radius: 4px;
  font-size: 13px;
}

/* Add feed form */
.add-feed-form {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.add-feed-form .form-input {
  flex: 1;
  min-width: 200px;
}

/* Search form */
.search-form {
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
}

.search-form .form-input {
  flex: 1;
}

/* Filters */
.filters {
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  background: var(--bg-alt);
}

.mark-all-read {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 6px 0;
}

.mark-all-read:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Pagination / Load more */
.load-more {
  padding: 16px;
  text-align: center;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-top: none;
}

.load-more-inner {
  padding: 12px;
  text-align: center;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.load-more-btn {
  color: var(--accent);
  cursor: pointer;
  background: none;
  border: none;
  font-size: 14px;
}

.load-more-btn:hover {
  text-decoration: underline;
}

/* Empty state */
.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
}

/* Page title */
.page-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 16px;
}

/* Mobile menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
}

/* Responsive */
@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .header {
    padding: 10px 12px;
  }

  .header-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    background: var(--accent);
    margin-top: 8px;
  }

  .header-nav.open {
    display: flex;
  }

  .header-nav a {
    padding: 12px 8px;
    border-top: 1px solid rgba(0,0,0,0.1);
  }

  .menu-toggle {
    display: block;
  }

  .container {
    padding: 12px;
  }

  .article {
    padding: 12px;
  }

  .article-title {
    font-size: 15px;
  }

  .article-meta {
    font-size: 13px;
  }

  .add-feed-form {
    flex-direction: column;
  }

  .add-feed-form .form-input {
    width: 100%;
  }

  .search-form {
    flex-direction: column;
  }

  .feed-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .feed-actions {
    margin-top: 8px;
  }
}

/* Loading indicator */
.htmx-request .htmx-indicator {
  display: inline-block;
}

.htmx-indicator {
  display: none;
  color: var(--text-muted);
  font-size: 13px;
  margin-left: 8px;
}

/* Alpine.js cloak */
[x-cloak] {
  display: none !important;
}

/* Disabled button state */
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Inline error for forms */
.add-feed-form .error-message {
  width: 100%;
  margin-top: 8px;
}

/* Smooth transitions */
.article {
  transition: background-color 0.2s ease, opacity 0.15s ease;
}
