/* Custom styles for the site */

/* ===== Status Badges ===== */
.status-stable,
.status-active,
.status-experimental {
  display: inline-block;
  padding: 0.2em 0.6em;
  font-size: 0.75em;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-stable {
  background-color: var(--color-success, #10b981);
  color: white;
}

.status-active {
  background-color: var(--color-primary, #3498db);
  color: white;
}

.status-experimental {
  background-color: var(--color-accent, #f59e0b);
  color: var(--color-slate-dark, #1e293b);
}

/* ===== Tool Listing Grid Images ===== */
.quarto-listing-default .listing-image {
  object-fit: contain;
  background-color: #f8fafc;
  padding: 1rem;
  border-radius: 0.5rem 0.5rem 0 0;
  height: 100%;
  width: 100%;
}

.quarto-listing-default .card {
  border-top: 3px solid var(--color-primary);
}

/* Tools grid logo sizing */
#listing-tools-listing .card-img-top {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 0.5rem 0;
}

#listing-tools-listing .card-img-top img {
  max-height: 80px;
  width: auto;
  height: auto !important;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* ===== Color Palette Variables ===== */
:root {
  --color-primary: #3498db;
  --color-primary-dark: #2980b9;
  --color-slate-dark: #1e293b;
  --color-slate: #2c3e50;
  --color-slate-light: #475569;
  --color-gray: #64748b;
  --color-accent: #f59e0b;
  --color-accent-dark: #d97706;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
}

/* ===== Navbar Styling ===== */
.navbar {
  background: linear-gradient(135deg, var(--color-slate-dark) 0%, var(--color-slate) 100%) !important;
  border-bottom: 3px solid var(--color-accent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff !important;
}

.navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.85) !important;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  transition: color 0.2s ease, background-color 0.2s ease;
  border-radius: 4px;
  margin: 0 2px;
}

.navbar-nav .nav-link:hover {
  color: #fff !important;
  background-color: rgba(255, 255, 255, 0.1);
}

.navbar-nav .nav-link.active {
  color: #fff !important;
  background-color: var(--color-slate-light);
}

/* Dropdown menu styling */
.navbar .dropdown-menu {
  background-color: var(--color-slate);
  border: 1px solid var(--color-slate-light);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.navbar .dropdown-item {
  color: rgba(255, 255, 255, 0.85);
  padding: 0.6rem 1.2rem;
}

.navbar .dropdown-item:hover {
  background-color: var(--color-slate-light);
  color: #fff;
}

.navbar .dropdown-divider {
  border-color: rgba(255, 255, 255, 0.1);
}

/* Search button styling */
.navbar .aa-DetachedSearchButton {
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.navbar .aa-DetachedSearchButton:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* Hero banner on home page */
.hero-banner {
  background: linear-gradient(135deg, var(--color-slate-dark) 0%, var(--color-slate) 100%);
  color: white;
  padding: 4rem 2rem;
  margin-bottom: 2rem;
  border-radius: 0.5rem;
  text-align: center;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  border-left: 4px solid var(--color-accent);
}

.hero-banner h1 {
  color: white;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero-banner p {
  font-size: 1.2rem;
  opacity: 0.9;
  margin-bottom: 2rem;
}

.hero-banner .btn {
  margin: 0.25rem;
}

/* Card styling */
.card {
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  border-top: 3px solid var(--color-primary);
}

.card:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
  padding: 0.75rem 1rem;
  font-weight: 600;
}

.card-body {
  padding: 1rem;
}

/* Button styles */
.btn-primary {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

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

.btn-outline-primary {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

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

/* Code block improvements */
pre {
  border-radius: 0.375rem;
}

/* Workshop/Tutorial callouts */
.callout-tip {
  border-left-color: var(--color-success);
}

.callout-note {
  border-left-color: var(--color-primary);
}

.callout-warning {
  border-left-color: var(--color-warning);
}

.callout-important {
  border-left-color: var(--color-error);
}

/* Table styling */
table {
  width: 100%;
}

/* GIF/Video containers */
video, img[src$=".gif"] {
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin: 1rem 0;
}

/* Dark mode adjustments */
.quarto-dark .card {
  border-color: #444;
  background-color: #2d2d2d;
}

.quarto-dark .card-header {
  background-color: #363636;
  border-color: #444;
}

.quarto-dark .hero-banner {
  background: linear-gradient(135deg, #0f172a 0%, var(--color-slate-dark) 100%);
}

/* ===== UX/UI Improvements ===== */

/* Broken image fallback styling */
img {
  max-width: 100%;
  height: auto;
}

img[alt]::after {
  content: attr(alt);
  display: block;
  background: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 0.5rem;
  padding: 2rem;
  text-align: center;
  color: #6c757d;
  font-style: italic;
}

/* Image placeholder for missing images */
.quarto-figure img:not([src]),
.quarto-figure img[src=""] {
  background: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 0.5rem;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .hero-banner {
    padding: 2rem 1rem;
  }

  .hero-banner h1 {
    font-size: 1.75rem;
  }

  .hero-banner .btn {
    display: block;
    width: 100%;
    margin: 0.5rem 0;
  }

  /* Ensure sidebar doesn't overlap content on mobile */
  .sidebar {
    position: relative !important;
    width: 100% !important;
  }
}

/* Hero button improvements - better contrast */
.hero-banner .btn-primary {
  background-color: var(--color-accent);
  color: var(--color-slate-dark);
  border-color: var(--color-accent);
  font-weight: 600;
}

.hero-banner .btn-primary:hover {
  background-color: var(--color-accent-dark);
  color: #fff;
  border-color: var(--color-accent-dark);
}

.hero-banner .btn-outline-primary {
  color: #fff;
  border-color: #fff;
  border-width: 2px;
}

.hero-banner .btn-outline-primary:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Improved card hover effect */
.card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.12);
}

/* Enhanced callout warning styling */
.callout-warning {
  background: rgba(243, 156, 18, 0.08);
}

/* Accessibility - visible focus states */
a:focus,
button:focus,
.btn:focus {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

/* Skip to content link for screen readers */
.visually-hidden-focusable:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Minimum touch target size for mobile */
.btn {
  min-height: 44px;
  min-width: 44px;
}

/* Dark mode - broken image styling */
.quarto-dark img[alt]::after {
  background: #2d2d2d;
  border-color: #444;
  color: #aaa;
}

/* Smooth scrolling for anchor links */
html {
  scroll-behavior: smooth;
}

/* ===== Tool Page Hero Section ===== */

/* Hide Quarto's auto-rendered description on tool pages (we use custom hero) */
.quarto-title-block .description {
  display: none;
}

.tool-hero {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  align-items: center;
}

.tool-hero .tool-logo img {
  width: 120px;
  height: auto;
}

.tool-hero .lead {
  font-size: 1.15rem;
  color: var(--color-gray);
  line-height: 1.6;
  margin: 0;
}

/* Mobile: stack vertically */
@media (max-width: 576px) {
  .tool-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}
