body { font-family: Arial; background:#f5f5f5; margin:30px; }
.result { background:white; padding:15px; border-radius:8px; margin-bottom:15px; display:flex; }
.subjects-cloud {
  margin-top: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.result img { width:90px; margin-right:20px; border-radius:6px; }
.source { font-size:12px; color:#666; }
.desc { margin-top:8px; font-size:14px; color:#444; }
.subject {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
}
.subject-line {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed #ddd;
}

.subject-title {
  color: #333;
  text-decoration: none;
}

.subject-title:hover {
  text-decoration: underline;
}

.subject-count {
  background: #eef3ff;
  color: #1a4cff;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.85rem;
  text-decoration: none;
}

.subject-count:hover {
  background: #dce6ff;
}

.layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.sidebar {
  width: 299px;
  flex-shrink: 0;
}

.results {
  flex: 1;
}

/* =========================================
   Global top progress bar (used by app.js)
========================================= */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(
    90deg,
    #2563eb,
    #22c55e
  );
  z-index: 99999;
  display: none;
  transition: width 0.35s ease;
}


@keyframes loadingMove {
    0%   { width: 0%; }
    20%  { width: 30%; }
    40%  { width: 55%; }
    60%  { width: 70%; }
    80%  { width: 90%; }
    100% { width: 100%; }
}

/* ---------------------------------------------------
   Skeleton loaders
------------------------------------------------------*/
.skeleton {
    display: flex;
    gap: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 15px;
    animation: pulse 1.4s ease-in-out infinite;
}

.skel-cover {
    width: 90px;
    height: 120px;
    background: #e5e7eb;
    border-radius: 6px;
    flex-shrink: 0;
}

.skel-lines {
    flex: 1;
}

.skel-line {
    height: 14px;
    background: #e5e7eb;
    border-radius: 4px;
    margin-bottom: 10px;
}

.skel-line.short { width: 40%; }
.skel-line.medium { width: 70%; }
.skel-line.long { width: 90%; }

@keyframes pulse {
    0%   { opacity: 1; }
    50%  { opacity: .45; }
    100% { opacity: 1; }
}

/* Result fade-in */
.result {
    opacity: 0;
    transform: translateY(8px);
    animation: fadeInUp .35s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.source-link {
    font-size: 12px;
    color: #1a73e8;
    text-decoration: none;
    margin-left: 4px;
}

.source-link:hover {
    text-decoration: underline;
}

/* ---------------------------------------------------
   Source badges
------------------------------------------------------*/
.badges {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.badge {
    font-size: 11px;
    padding: 3px 7px;
    border-radius: 6px;
    font-weight: 600;
    line-height: 1;
    cursor: default;
    user-select: none;
}

/* Source colors */
.source-googlebooks {
    background: #e8f0fe;
    color: #1a73e8;
}

.source-openlibrary {
    background: #fef3c7;
    color: #92400e;
}

.source-gutenberg {
    background: #ecfeff;
    color: #0369a1;
}

/* Public domain */
.badge-pd {
    background: #dcfce7;
    color: #166534;
}

/* External link */
.badge-link {
    background: #f3f4f6;
    color: #374151;
    text-decoration: none;
}

.badge-link:hover {
    background: #e5e7eb;
}

.subjects {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.subject {
    font-size: 12px;
    padding: 3px 8px;
    background: #f3f4f6;
    border-radius: 999px;
    color: #374151;
}

.badge-lang {
    background: #eef2ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
}

.meta {
  margin-top: 4px;
  font-size: 12px;
  color: #555;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.subject-pill {
  background: #f3f4f6;
  color: #374151;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: default;
}

.subject-pill small {
  font-size: 11px;
  color: #6b7280;
}
.badge-download {
    background: #dcfce7;
    color: #15803d;
    text-decoration: none;
}

.badge-download:hover {
    background: #bbf7d0;
    text-decoration: underline;
}