/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Extracted from layout */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, sans-serif; background: #f8f9fa; color: #212529; }
.navbar { background: #1a1a2e; color: white; padding: 0.75rem 1.5rem; display: flex; align-items: center; gap: 1rem; }
.navbar a { color: #e0e0e0; text-decoration: none; padding: 0.4rem 0.75rem; border-radius: 4px; }
.navbar a:hover { background: rgba(255,255,255,0.1); color: white; }
.navbar .brand { font-weight: 700; font-size: 1.25rem; color: white; }
.navbar .spacer { flex: 1; }
.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }
.flash { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.flash.notice { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.flash.alert  { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.btn { display: inline-block; padding: 0.45rem 1rem; border-radius: 5px; border: none; cursor: pointer; font-size: 0.9rem; text-decoration: none; }
.btn-primary { background: #4361ee; color: white; }
.btn-primary:hover { background: #3451d1; }
.btn-secondary { background: #6c757d; color: white; }
.btn-secondary:hover { background: #5a6268; }
.btn-danger { background: #dc3545; color: white; }
.btn-danger:hover { background: #c82333; }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; }
.card { background: white; border-radius: 8px; padding: 1.25rem; margin-bottom: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.badge { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }
.badge-draft     { background: #ffc107; color: #000; }
.badge-published { background: #28a745; color: #fff; }
.badge-archived  { background: #6c757d; color: #fff; }
.badge-pending    { background: #ffc107; color: #000; }
.badge-generating { background: #17a2b8; color: #fff; }
.badge-complete   { background: #28a745; color: #fff; }
.badge-failed     { background: #dc3545; color: #fff; }
.tag { display: inline-block; background: #e9ecef; color: #495057; padding: 0.15rem 0.5rem; border-radius: 12px; font-size: 0.75rem; margin: 0.1rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.3rem; }
.form-control { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #ced4da; border-radius: 5px; font-size: 0.95rem; }
.form-control:focus { outline: none; border-color: #4361ee; box-shadow: 0 0 0 3px rgba(67,97,238,0.15); }
textarea.form-control { resize: vertical; min-height: 200px; font-family: monospace; }
.search-box { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.search-box input { flex: 1; }
.tabs { display: flex; gap: 0; border-bottom: 2px solid #dee2e6; margin-bottom: 1.5rem; }
.tab { padding: 0.6rem 1.25rem; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; color: #6c757d; text-decoration: none; }
.tab.active, .tab:hover { color: #4361ee; border-bottom-color: #4361ee; }
.coverage-content { line-height: 1.7; }
.coverage-content h1,.coverage-content h2,.coverage-content h3 { margin: 1rem 0 0.5rem; }
.coverage-content p { margin-bottom: 0.75rem; }
.coverage-content ul,.coverage-content ol { margin: 0.5rem 0 0.75rem 1.5rem; }
.coverage-content code { background: #f4f4f4; padding: 0.15rem 0.35rem; border-radius: 3px; font-size: 0.9em; }
.coverage-content pre { background: #1e1e1e; color: #d4d4d4; padding: 1rem; border-radius: 6px; overflow-x: auto; margin-bottom: 0.75rem; }
.coverage-content pre code { background: none; padding: 0; }
mark { background: #fff3cd; padding: 0.1rem 0.2rem; border-radius: 2px; }
.doc-meta { color: #6c757d; font-size: 0.85rem; margin-bottom: 0.5rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.empty-state { text-align: center; padding: 3rem; color: #6c757d; }
.spinner { display: inline-block; width: 1rem; height: 1rem; border: 2px solid #dee2e6; border-top-color: #4361ee; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pagy nav { display: flex; justify-content: center; gap: 0.25rem; margin-top: 1.5rem; }
.pagy nav a, .pagy nav span { padding: 0.35rem 0.65rem; border: 1px solid #dee2e6; border-radius: 4px; color: #4361ee; text-decoration: none; font-size: 0.9rem; }
.pagy nav span.current { background: #4361ee; color: white; border-color: #4361ee; }
.pagy nav span.disabled { color: #adb5bd; }

/* Document detail layout — main + sidebar */
.doc-detail-layout { display: grid; grid-template-columns: 1fr 280px; gap: 1.5rem; align-items: start; }
.doc-detail-main { min-width: 0; }
.doc-detail-sidebar { position: sticky; top: 1rem; }

/* Metadata definition list */
.meta-list { font-size: 0.85rem; }
.meta-list dt { color: #6c757d; font-weight: 500; margin-top: 0.5rem; }
.meta-list dd { margin: 0.15rem 0 0 0; color: #212529; }

/* Tag active state for filters */
.tag-active { background: #4361ee; color: #fff; }

/* Filter bar — search-box used for filter form too */
.search-box { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; align-items: flex-end; }
.search-box .form-control { width: auto; min-width: 120px; flex: 0 1 auto; }
.search-box input.form-control { flex: 1 1 200px; }

/* Approval badge extras */
.badge-approved { background: #17a2b8; color: #fff; }
.badge-rejected { background: #dc3545; color: #fff; }
.badge-review   { background: #fd7e14; color: #fff; }

/* Responsive */
@media (max-width: 900px) {
  .doc-detail-layout { grid-template-columns: 1fr; }
  .doc-detail-sidebar { position: static; }
}
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .navbar { flex-wrap: wrap; padding: 0.5rem 1rem; }
  .navbar a { padding: 0.3rem 0.5rem; font-size: 0.85rem; }
  .container { padding: 1rem; }
  .search-box { flex-direction: column; }
  .search-box .form-control { width: 100%; }
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab { white-space: nowrap; font-size: 0.85rem; padding: 0.5rem 0.75rem; }
}

