/*
 * BlogDB - Modern Card-based UI
 */

:root {
  --primary: #0891b2;
  --primary-dark: #0e7490;
  --secondary: #64748b;
  --success: #10b981;
  --error: #ef4444;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* Navbar */
.navbar {
  background: var(--card-bg);
  box-shadow: var(--shadow);
  padding: 1rem 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.nav-brand:hover {
  color: var(--primary-dark);
}

.nav-links .nav-search-mobile {
  display: none;
}

.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 10;
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger--open .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger--open .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger--open .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Visually Hidden (accessibility) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Navbar Search */
.nav-search {
  display: flex;
  align-items: center;
}

.nav-search-input {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  width: 160px;
  transition: width 0.2s, border-color 0.2s;
  background: var(--card-bg);
  color: var(--text);
}

.nav-search-input:focus {
  outline: none;
  border-color: var(--primary);
  width: 220px;
}

/* Search page */
.search-page-form {
  margin-bottom: 2rem;
}

.search-input-group {
  display: flex;
  gap: 0.5rem;
  max-width: 600px;
}

.search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: var(--card-bg);
  color: var(--text);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
}

.search-submit {
  white-space: nowrap;
}

.search-section {
  margin-bottom: 2.5rem;
}

.search-section h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.nav-link {
  color: var(--text);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
}

.nav-link:hover {
  background: var(--bg);
  color: var(--primary);
}

.nav-link.active {
  background: var(--bg);
  color: var(--primary);
}

/* Buttons */
.btn-primary {
  background: var(--primary);
  color: white !important;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover {
  background: var(--primary-dark) !important;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--secondary);
  color: white;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #475569;
}

/* Main content */
main {
  flex: 1;
  padding: 2rem 0;
  margin-top: 1.5rem;
}

/* Alerts */
.alert {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Page headers */
.page-header {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.breadcrumb {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Blog grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Blog card */
.blog-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.blog-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.blog-card-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
  font-weight: 700;
}

.blog-card-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.blog-card-title a {
  color: var(--text);
  text-decoration: none;
}

.blog-card-title a:hover {
  color: var(--primary);
}

.blog-card-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex: 1;
  margin-bottom: 1rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.blog-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Horizontal blog card (home page) */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.blog-card-horizontal {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.blog-card-horizontal:hover {
  box-shadow: var(--shadow-lg);
}

.blog-card-screenshot {
  flex-shrink: 0;
  width: 400px;
  background: var(--bg);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.blog-card-screenshot img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.blog-card-screenshot .blog-card-placeholder {
  width: 100%;
  height: 250px;
}

.blog-card-body {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

.blog-card-body:has(.article-follow) {
  padding-right: 6.5rem;
}

.blog-card-body .blog-card-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.blog-card-body .blog-card-title a {
  color: var(--primary);
  text-decoration: none;
}

.blog-card-body .blog-card-title a:hover {
  text-decoration: underline;
}

.blog-card-body .blog-card-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1rem;
}

.blog-card-entries {
  list-style: none;
  padding: 0;
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.blog-card-entry {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.blog-card-entry:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.blog-card-entry .entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.blog-card-entry .entry-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.blog-card-entry .entry-link:hover {
  color: var(--primary);
}

.blog-card-entry .entry-date {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.blog-card-entry .entry-summary {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0.25rem 0 0 0;
  line-height: 1.4;
}

@media (max-width: 900px) {
  .blog-card-horizontal {
    flex-direction: column;
  }

  .blog-card-screenshot {
    width: 100%;
    max-height: 300px;
  }

  .blog-card-screenshot img {
    max-height: 300px;
  }
}

/* Blog show page */
.blog-show {
  display: block;
  max-width: 900px;
  margin: 2rem auto;
}

.blog-main {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.blog-screenshot {
  width: 100%;
  height: auto;
  display: block;
}

.blog-screenshot-placeholder {
  width: 100%;
  height: 300px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 4rem;
  font-weight: 700;
}

.blog-info {
  padding: 2rem;
  position: relative;
}

.blog-show-follow {
  position: absolute;
  top: 2rem;
  right: 2rem;
  margin: 0;
}

.blog-info h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.blog-info .blog-url {
  color: var(--primary);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 1rem;
}

.blog-info .blog-url:hover {
  text-decoration: underline;
}

.blog-info .blog-description {
  color: var(--text-muted);
  line-height: 1.7;
}

/* Blog entries in main content */
.blog-entries-main {
  margin-top: 2rem;
  padding: 2rem;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.blog-entries-main h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}


.entry-list {
  list-style: none;
}

.entry-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

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

.entry-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.entry-title a {
  color: var(--text);
  text-decoration: none;
}

.entry-title a:hover {
  color: var(--primary);
}

.entry-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.entry-summary {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Form styles */
.form-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  max-width: 600px;
  margin: 2rem auto;
}

.form-card h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.form-card .form-subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

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

.form-group input[type="text"],
.form-group input[type="url"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.form-group .hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.form-actions button {
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

/* Error messages */
.error-messages {
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 1rem 1.5rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.error-messages ul {
  margin: 0;
  padding-left: 1.25rem;
}

.error-messages li {
  color: #991b1b;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.empty-state h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Footer */
.footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 3rem;
  text-align: center;
  color: var(--text-muted);
}

.footer-links {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.footer-links a {
  color: var(--primary);
  text-decoration: none;
}

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

/* Tabs Navigation */
.tabs-container {
  width: 100%;
}

.tabs-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.tab-button {
  background: none;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}

.tab-button:hover {
  color: var(--primary);
}

.tab-button.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-panel {
  animation: fadeIn 0.2s ease-in-out;
}

.tab-panel.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Recent Articles Section */
.recent-articles {
  margin-bottom: 3rem;
}

.articles-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.article-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  transition: box-shadow 0.2s;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.article-item:hover {
  box-shadow: var(--shadow-lg);
}

.article-thumbnail {
  flex-shrink: 0;
  width: 120px;
}

.article-thumbnail img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  display: block;
}

.article-thumbnail-placeholder {
  width: 100%;
  height: 80px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
}

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

.article-content:has(.article-follow) {
  padding-right: 6.5rem;
}

.article-follow {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  margin: 0;
}

.article-meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

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

.article-source a {
  color: var(--primary);
  text-decoration: none;
}

.article-source a:hover {
  text-decoration: underline;
}

.article-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

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

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

.article-summary {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

.article-summary-link {
  color: inherit;
  text-decoration: none;
  display: block;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1rem 0;
}

.pagination-link {
  background: var(--primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s;
}

.pagination-link:hover {
  background: var(--primary-dark);
}

.pagination-info {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 640px) {
  .hamburger {
    display: flex;
  }

  .nav-container {
    flex-wrap: wrap;
  }

  .nav-search-desktop {
    display: none;
  }

  .nav-search-mobile {
    display: flex;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1rem;
  }

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

  .nav-links .nav-search {
    width: 100%;
  }

  .nav-links .nav-search-input {
    width: 100%;
  }

  .nav-links .nav-search-input:focus {
    width: 100%;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }

  .article-item {
    flex-direction: column;
    gap: 1rem;
  }

  .article-thumbnail {
    width: 100%;
  }

  .article-thumbnail img {
    max-height: 150px;
    object-fit: cover;
  }

  .article-thumbnail-placeholder {
    height: 100px;
  }

}

/* Admin Styles */
.admin-navbar {
  background: #1e293b;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-navbar .nav-brand {
  color: white;
}

.admin-navbar .nav-brand:hover {
  color: var(--primary);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-badge {
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.admin-navbar .nav-link {
  color: #94a3b8;
}

.admin-navbar .nav-link:hover,
.admin-navbar .nav-link.active {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.nav-divider {
  color: #475569;
  margin: 0 0.5rem;
}

.btn-logout {
  background: transparent;
  border: 1px solid #475569;
  color: #94a3b8;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: #64748b;
}

.admin-main {
  padding: 2rem 0;
}

/* Admin Sidebar Layout */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 57px);
}

.admin-sidebar {
  background: #1e293b;
  border-right: 1px solid #334155;
  position: sticky;
  top: 57px;
  height: calc(100vh - 57px);
  overflow-y: auto;
}

.admin-sidebar-toggle {
  display: none;
}

.admin-sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
  height: 100%;
}

.admin-sidebar-section {
  padding: 0.5rem 0;
}

.admin-sidebar-section--bottom {
  margin-top: auto;
  border-top: 1px solid #334155;
  padding-top: 0.75rem;
}

.admin-sidebar-heading {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 0.5rem 1.25rem 0.375rem;
  margin: 0;
}

.admin-sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.25rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.875rem;
  transition: background 0.15s, color 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.admin-sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.admin-sidebar-link.active {
  background: rgba(8, 145, 178, 0.15);
  color: #22d3ee;
  border-right: 2px solid #22d3ee;
}

.admin-sidebar-badge {
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  min-width: 1.25rem;
  text-align: center;
}

.admin-sidebar-logout {
  color: #94a3b8;
}

.admin-sidebar-logout:hover {
  color: #f87171;
}

.admin-content {
  padding: 2rem 2.5rem;
  min-width: 0;
  max-width: 1200px;
}

@media (max-width: 768px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #334155;
  }

  .admin-sidebar-toggle {
    display: block;
    width: 100%;
    padding: 0.75rem 1.25rem;
    background: #1e293b;
    border: none;
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
  }

  .admin-sidebar-toggle:hover {
    color: #e2e8f0;
  }

  .admin-sidebar-nav {
    display: none;
    height: auto;
  }

  .admin-sidebar--open .admin-sidebar-nav {
    display: flex;
  }

  .admin-sidebar-link.active {
    border-right: none;
  }

  .admin-content {
    padding: 1.5rem 1rem;
  }
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Admin Section */
.admin-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.admin-section h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text);
}

/* Admin Table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-table td {
  color: var(--text);
}

.admin-table tbody tr:hover {
  background: var(--bg);
}

.admin-table td.actions {
  white-space: nowrap;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

/* Admin Buttons */
.btn-sm {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 4px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  background: var(--secondary);
  color: white;
  transition: background 0.2s;
}

.btn-sm:hover {
  background: #475569;
}

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

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

.btn-warning {
  background: #f59e0b;
}

.btn-warning:hover {
  background: #d97706;
}

.btn-danger {
  background: var(--error);
  color: white !important;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: background 0.2s, transform 0.1s;
  border: none;
  cursor: pointer;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success);
}

.btn-success:hover {
  background: #059669;
}

/* Admin Thumbnails */
.admin-thumbnail {
  width: 80px;
  min-width: 80px;
}

.admin-thumbnail img {
  width: 72px;
  height: 45px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.admin-thumbnail-missing {
  display: inline-block;
  width: 72px;
  height: 45px;
  line-height: 45px;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 4px;
}

/* Pending Approval Cards */
.pending-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pending-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  background: var(--card-bg);
}

.pending-card-top {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.pending-card-screenshot img {
  width: 120px;
  height: 75px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}

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

.pending-card-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.pending-card-url {
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

.pending-card-url a {
  color: var(--primary);
  word-break: break-all;
}

.pending-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

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

.pending-card-tags .badge {
  background: #f1f5f9;
  color: #475569;
}

.pending-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex-shrink: 0;
}

.pending-card-description {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.pending-card-entries {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

.pending-card-description + .pending-card-entries {
  border-top: none;
  padding-top: 0;
}

.pending-card-entries-label {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.pending-card-entries ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.pending-card-entries li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.pending-card-entries li a {
  color: var(--text);
}

.pending-card-entry-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Follow/Unfollow buttons */
.btn-follow, .btn-unfollow, .btn-dismiss, .btn-bookmark, .btn-bookmarked {
  display: inline-block;
  padding: 0.4rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  min-width: 5.5rem;
  text-align: center;
  cursor: pointer;
  font-weight: 500;
}

.btn-follow {
  background: var(--primary);
  color: white;
}

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

.btn-unfollow {
  background: var(--secondary);
  color: white;
}

.btn-unfollow:hover {
  background: #475569;
}

.btn-dismiss {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
}

.btn-dismiss:hover {
  background: var(--bg);
  color: var(--text);
}

.btn-bookmark {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
}

.btn-bookmark:hover {
  background: var(--bg);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-bookmarked {
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
}

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

.blog-actions {
  margin: 0.5rem 0;
}

.article-actions {
  margin-top: 0.5rem;
}

/* Notes */
.note-wrapper {
  margin-top: 0.5rem;
}

.note-display {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
}

.note-content {
  font-size: 0.85rem;
  color: var(--text);
  margin: 0 0 0.25rem 0;
  white-space: pre-wrap;
}

.note-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.note-input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 0.25rem;
}

.note-toggle {
  display: inline;
}

.note-toggle summary {
  cursor: pointer;
  list-style: none;
}

.note-toggle summary::-webkit-details-marker {
  display: none;
}

.note-toggle .note-form {
  margin-top: 0.5rem;
}

.btn-note-add, .btn-note-edit, .btn-note-cancel, .btn-note-delete {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.note-actions-spacer {
  flex: 1;
}

.btn-note-edit:hover, .btn-note-add:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.btn-note-delete:hover {
  color: var(--danger, #dc2626);
  border-color: var(--danger, #dc2626);
}

.btn-note-cancel:hover {
  color: var(--text);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
  margin-left: 0.5rem;
}

.badge-admin {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-user {
  background: #f1f5f9;
  color: #64748b;
}

.badge-info {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

/* View All Link */
.view-all {
  margin-top: 1rem;
  text-align: right;
}

.view-all a {
  color: var(--primary);
  text-decoration: none;
}

.view-all a:hover {
  text-decoration: underline;
}

.empty-message {
  color: var(--text-muted);
  font-style: italic;
}

/* Form styles for text areas */
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.form-group input[type="email"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input[type="email"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.form-group input[type="password"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.form-footer {
  margin-top: 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

.form-footer a {
  color: var(--primary);
  text-decoration: none;
}

.form-footer a:hover {
  text-decoration: underline;
}

/* Header with actions */
.header-with-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.header-actions {
  flex-shrink: 0;
}

.header-actions .btn-primary {
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}

/* Tag Badges */
.tag-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin: 0.5rem 0;
}

.tag-badge {
  display: inline-block;
  background: #dbeafe;
  color: #1d4ed8;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
}

.tag-badge:hover {
  background: #bfdbfe;
}

/* Tag Suggestion Form */
.suggest-tag-form {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.suggest-tag-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.suggest-tag-select {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text);
  font-size: 0.85rem;
}

.suggest-tag-success {
  font-size: 0.85rem;
  color: var(--primary);
  margin-top: 0.75rem;
}

/* Checkbox Group */
.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.375rem 0;
}

/* Home Sidebar Layout */
.home-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 2rem;
  align-items: start;
}

.home-main {
  min-width: 0;
}

.home-sidebar {
  position: sticky;
  top: 5rem;
}

.sidebar-box {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.sidebar-box + .sidebar-box {
  margin-top: 1rem;
}

.sidebar-box-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sidebar-tags.tag-cloud {
  align-items: center;
}

.sidebar-tag {
  display: inline-block;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.sidebar-tag:hover {
  background: #e0f2fe;
}

/* Sidebar toggle (mobile only) */
.sidebar-toggle {
  display: none;
}

@media (max-width: 640px) {
  .home-layout {
    grid-template-columns: 1fr;
  }

  .home-sidebar {
    position: static;
  }

  .sidebar-toggle {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s, color 0.2s;
  }

  .sidebar-toggle:hover {
    background: var(--bg);
    color: var(--text);
  }

  .sidebar-content {
    display: none;
    margin-top: 1rem;
  }

  .home-sidebar--open .sidebar-content {
    display: block;
  }
}

/* About Page */
.about-content {
  max-width: 800px;
  margin: 0 auto;
}

.about-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.about-section h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

.about-section p {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.about-section p:last-child {
  margin-bottom: 0;
}

.about-features {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1rem;
}

.about-feature {
  padding: 1.25rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}

.about-feature h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.about-feature p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.about-cta {
  text-align: center;
}

.about-cta a {
  color: var(--primary);
  text-decoration: none;
}

.about-cta a:hover {
  text-decoration: underline;
}

/* Theme toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text);
  transition: background 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
  background: var(--bg);
  border-color: var(--primary);
}

/* Dark mode */
:root[data-theme="dark"] {
  --primary: #22d3ee;
  --primary-dark: #06b6d4;
  --btn-primary-bg: #0891b2;
  --btn-primary-hover: #0e7490;
  --secondary: #94a3b8;
  --success: #34d399;
  --error: #f87171;
  --bg: #0f172a;
  --card-bg: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

:root[data-theme="dark"] .alert-success {
  background: #064e3b;
  color: #6ee7b7;
  border-color: #065f46;
}

:root[data-theme="dark"] .alert-error {
  background: #7f1d1d;
  color: #fca5a5;
  border-color: #991b1b;
}

:root[data-theme="dark"] .error-messages {
  background: #7f1d1d;
  color: #fca5a5;
  border-color: #991b1b;
}

:root[data-theme="dark"] .error-messages li,
:root[data-theme="dark"] .error-messages p {
  color: #fca5a5;
}

:root[data-theme="dark"] .form-group input,
:root[data-theme="dark"] .form-group textarea,
:root[data-theme="dark"] .form-group select {
  background: #0f172a;
  color: #f1f5f9;
  border-color: #334155;
}

:root[data-theme="dark"] .blog-card-placeholder,
:root[data-theme="dark"] .article-thumbnail-placeholder {
  background: #334155;
  color: #94a3b8;
}

:root[data-theme="dark"] .pagination-info {
  color: #94a3b8;
}

:root[data-theme="dark"] .tag-badge {
  background: #164e63;
  color: #22d3ee;
}

:root[data-theme="dark"] .tag-badge:hover {
  background: #155e75;
}

:root[data-theme="dark"] .blog-card-horizontal:hover,
:root[data-theme="dark"] .article-item:hover {
  border-color: #475569;
}

:root[data-theme="dark"] .empty-state {
  color: #94a3b8;
}

:root[data-theme="dark"] .footer {
  background: #1e293b;
  border-top-color: #334155;
}

:root[data-theme="dark"] .admin-tag {
  color: #e2e8f0;
}

:root[data-theme="dark"] .admin-tag-tech { background: #1e3a5f; }
:root[data-theme="dark"] .admin-tag-personal { background: #1e293b; }
:root[data-theme="dark"] .admin-tag-science { background: #164e63; }
:root[data-theme="dark"] .admin-tag-green { background: #064e3b; }
:root[data-theme="dark"] .admin-tag-warm { background: #78350f; }

:root[data-theme="dark"] .sidebar-tag:hover {
  background: #1e3a5f;
}

:root[data-theme="dark"] .breadcrumb a {
  color: #94a3b8;
}

:root[data-theme="dark"] .blog-sidebar {
  background: #1e293b;
}

:root[data-theme="dark"] .btn-primary,
:root[data-theme="dark"] .btn-follow,
:root[data-theme="dark"] .btn-bookmarked,
:root[data-theme="dark"] .pagination-link {
  background: var(--btn-primary-bg);
}

:root[data-theme="dark"] .btn-primary:hover,
:root[data-theme="dark"] .btn-follow:hover,
:root[data-theme="dark"] .btn-bookmarked:hover,
:root[data-theme="dark"] .pagination-link:hover {
  background: var(--btn-primary-hover);
}
