/* DevAggregator - Bulma Theme */

:root {
  --primary-hue: 217;
  --bg-body: #f8f9fa;
  --bg-card: #ffffff;
  --text-main: #212529;
  --text-muted: #6c757d;
  --border-color: #e9ecef;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

[data-theme="dark"] {
  --bg-body: #0f172a;
  --bg-card: #1e293b;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
}

/* Body */
body {
  background-color: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.main-content {
  flex: 1;
}

/* Navbar - Bulma based with alignment fixes */
.navbar {
  backdrop-filter: blur(10px);
  background-color: var(--bg-card) !important;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

/* All navbar sections same height */
.navbar-brand,
.navbar-menu,
.navbar-end {
  min-height: 3.25rem !important;
}

/* Brand - remove padding, center content */
.navbar-brand .navbar-item {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Brand title - no margin, centered */
.navbar-brand .title {
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  height: 3.25rem !important;
}

/* Menu items - centered */
.navbar-end .navbar-item {
  display: flex !important;
  align-items: center !important;
}

/* Language toggle */
.navbar-end .tags {
  margin: 0 !important;
}

/* Cards */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: hsl(var(--primary-hue), 100%, 65%);
}

.card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem;
  min-height: 100%;
}

.card-content .mt-auto {
  margin-top: auto;
}

/* Ensure external button stays at bottom */
.card-content > div.mt-auto {
  margin-top: auto;
  padding-top: 0.75rem;
}

.card-title a {
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.card-title a:hover {
  color: hsl(var(--primary-hue), 100%, 50%);
}

.card-summary {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 0.5rem;
}

/* Cards */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: hsl(var(--primary-hue), 100%, 65%);
}

.card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-content .mt-auto {
  margin-top: auto;
}

.card-title a {
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.card-title a:hover {
  color: hsl(var(--primary-hue), 100%, 50%);
}

.card-summary {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 0.5rem;
}

/* Tags */
.tags .tag {
  background-color: rgba(0,0,0,0.05);
  color: var(--text-main);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

[data-theme="dark"] .tags .tag {
  background-color: rgba(255,255,255,0.15);
  color: var(--text-main);
}

[data-theme="dark"] .tag.is-light {
  background-color: rgba(255,255,255,0.15) !important;
  color: var(--text-main) !important;
}

.tags .tag:hover {
  background-color: hsl(var(--primary-hue), 100%, 50%);
  color: white;
}

/* Difficulty badges */
.difficulty-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
}

.difficulty-junior {
  background-color: #22c55e;
  color: white;
}

.difficulty-mid {
  background-color: #f59e0b;
  color: white;
}

.difficulty-senior {
  background-color: #ef4444;
  color: white;
}

/* Listing page */
.listing-header {
  margin-bottom: 2rem;
}

.listing-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

/* Search */
#search .input {
  background-color: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-main);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

#search .input:focus {
  border-color: hsl(var(--primary-hue), 100%, 50%);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

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

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

/* Item page */
.item-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.item-page .title {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  margin-left: 0;
  padding-left: 0;
}

.item-content {
  color: var(--text-muted);
  line-height: 1.8;
  font-size: 1.05rem;
}

.item-content p {
  margin-bottom: 1.25rem;
}

/* External link button */
.btn-external {
  background: linear-gradient(135deg, hsl(var(--primary-hue), 100%, 55%), hsl(var(--primary-hue), 100%, 45%));
  color: white;
  border: none;
  font-weight: 600;
  padding: 0.875rem 1.75rem;
  border-radius: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.btn-external:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
  color: white;
}

/* Dark mode toggle */
.dark-mode-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background-color: var(--bg-card);
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: var(--shadow-lg);
}

/* Footer */
.footer {
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.footer a {
  color: hsl(var(--primary-hue), 100%, 50%);
}

/* Hero section */
.hero-body {
  padding: 3rem 0;
}

.hero-title {
  font-weight: 800;
  font-size: 2.5rem;
}

/* Breadcrumbs */
.breadcrumb-item a {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
  color: hsl(var(--primary-hue), 100%, 50%);
}

/* Pagination */
.pagination-link {
  border-color: var(--border-color);
  color: var(--text-main);
  background-color: var(--bg-card);
}

.pagination-link.is-current {
  background-color: hsl(var(--primary-hue), 100%, 50%);
  border-color: hsl(var(--primary-hue), 100%, 50%);
  color: white;
}

/* Language badge */
.lang-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.15rem 0.4rem;
  background-color: rgba(0,0,0,0.05);
  border-radius: 4px;
  margin-left: 0.5rem;
}

[data-theme="dark"] .lang-badge {
  background-color: rgba(255,255,255,0.1);
}

/* External link icon */
.external-icon {
  font-size: 0.75em;
  margin-left: 0.25em;
  opacity: 0.7;
}

/* Clickable cards */
a.clickable-card {
  text-decoration: none;
  color: inherit;
  display: block;
}

a.clickable-card:hover {
  text-decoration: none;
  color: inherit;
}

a.clickable-card .card-title {
  color: var(--text-main);
}

a.clickable-card:hover .card-title {
  color: hsl(var(--primary-hue), 100%, 50%);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  animation: fadeIn 0.4s ease forwards;
}

.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.1s; }
.card:nth-child(4) { animation-delay: 0.15s; }
.card:nth-child(5) { animation-delay: 0.2s; }
.card:nth-child(6) { animation-delay: 0.25s; }
