/*
Theme Name: Journal Theme
Theme URI: https://journalratings.com
Description: A lightweight custom theme for JournalRatings.com.
Author: Assistant
Version: 1.0
Text Domain: journal-theme
*/

:root {
  --primary: #0f172a;
  --secondary: #334155;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --star: #fbbf24;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* Layout */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand span {
  color: var(--accent);
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

/* Search */
.hero {
  text-align: center;
  margin-bottom: 3rem;
  padding: 3rem 1rem;
  background: var(--primary);
  color: white;
  border-radius: 1rem;
  box-shadow: var(--shadow-lg);
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  color: #94a3b8;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.orcid-cta {
  margin: 1rem auto 2rem;
  max-width: 620px;
}

.orcid-cta-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  color: var(--text);
  text-align: center;
  box-shadow: var(--shadow);
}

.orcid-cta-card h3 {
  margin-bottom: 0.35rem;
  font-size: 1.1rem;
  color: var(--primary);
}

.orcid-cta-card p {
  margin-bottom: 0.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.search-bar {
  display: flex;
  max-width: 600px;
  margin: 0 auto;
  background: white;
  padding: 0.5rem;
  border-radius: 0.5rem;
  position: relative;
}

.search-input {
  flex: 1;
  border: none;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  outline: none;
}

.search-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.search-btn:hover {
  background: var(--accent-hover);
}

.orcid-btn {
  background: #10b981; /* Green */
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  font-size: 0.9rem;
}

.orcid-btn:hover {
  background: #059669; /* Darker Green */
}

/* Single journal CTA layout */
.journal-summary-row {
  flex-wrap: wrap;
}

.journal-cta {
  min-width: 220px;
}

/* Mobile layout fixes */
@media (max-width: 768px) {
  .navbar {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .brand {
    width: 100%;
    justify-content: center;
  }

  .nav-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .hero {
    margin-top: 4vh;
    padding: 2rem 1rem;
  }

  .search-bar {
    flex-direction: column;
    gap: 0.5rem;
  }

  .search-input,
  .search-btn {
    width: 100%;
  }

  .journal-summary-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .journal-cta {
    width: 100%;
    text-align: left;
  }

  .journal-cta .search-btn {
    width: 100%;
    display: block;
    text-align: center;
  }
}

/* Journals Grid */
.journal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.journal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.journal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.journal-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1rem;
}

.journal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
}

.journal-publisher {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.rating-badge {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: #fef9c3;
  color: #854d0e;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.rating-badge svg {
  width: 16px;
  height: 16px;
  fill: var(--star);
}

.metrics {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
}

.metric {
  display: flex;
  flex-direction: column;
}

.metric-label {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.metric-value {
  font-weight: 600;
  color: var(--secondary);
}

/* Detail Page */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 1.5rem;
  cursor: pointer;
}

.back-btn:hover {
  color: var(--accent);
}

.detail-header {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.detail-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.big-rating {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
}

.stars-row {
  display: flex;
  gap: 0.1rem;
  color: var(--star);
  margin-bottom: 0.5rem;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.review-card {
  background: white;
  padding: 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
}

.review-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.reviewer-name {
  font-weight: 600;
}

.review-date {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.review-text {
  color: var(--secondary);
}

/* Site Reviews: show author above stars */
.glsr-review-header,
.glsr-review-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.glsr-review-author,
.glsr-review-author-name {
  order: 1;
}

.glsr-review-rating,
.glsr-review-stars {
  order: 2;
}

/* Live Search Results Dropdown */
.live-search-results {
  position: absolute;
  top: 100%; /* Push it right below the search bar */
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-lg);
  margin-top: 0.5rem;
  z-index: 1000; /* Ensure it floats above everything */
  max-height: 400px;
  overflow-y: auto;
  text-align: left;
}

.live-search-item {
  display: block;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none; /* No ugly blue links */
  transition: background 0.1s;
}

.live-search-item:last-child {
  border-bottom: none;
}

.live-search-item:hover {
  background: #f8fafc;
}

.ls-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.ls-title {
  font-weight: 700;
  color: var(--primary);
  font-size: 1rem;
}

.ls-publisher {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: block;
}

.ls-rating-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ls-stars {
  display: flex;
  gap: 2px;
  font-size: 1.1rem;
  line-height: 1;
}

.star.filled {
  color: var(--star);
}

.star.empty {
  color: #cbd5e1; /* Light grey */
}

.star.half {
  background: linear-gradient(90deg, var(--star) 50%, #cbd5e1 50%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ls-meta-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.ls-meta-text.cta {
  color: var(--accent);
  font-style: italic;
}

.live-search-no-results {
    padding: 1.5rem;
    color: var(--text-muted);
    text-align: center;
    font-size: 0.9rem;
}

/* Smaller About link on homepage */
.about-brand {
  font-size: 0.85rem;
  gap: 0.35rem;
}

.about-brand svg {
  width: 16px;
  height: 16px;
}

/* Anonymous toggle near name field */
.glsr-field-post_anonymous {
  margin-top: -0.5rem;
}

.glsr-field-post_anonymous label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

