/*
 * Stylesheet for the ResRef Journal Finder plugin.  The design is
 * inspired by the citation widget styles and uses a simple colour
 * palette for clarity.  All classes are scoped within .resref-jf to
 * avoid collisions with other themes or plugins.  Adjust spacing
 * values and typography as needed to fit your site's aesthetic.
 */

/* Colour palette derived from ResRef branding */
:root {
  --resref-primary: #062B80;
  --resref-secondary: #126AC6;
  --resref-accent: #4FB9FC;
  --resref-bg: #F9FAFB;
  --resref-border: #E1E4E8;
  --resref-text: #1F2937;
  --resref-muted: #6B7280;
}

/* Container */
.resref-jf {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
  background: var(--resref-bg);
  border: 1px solid var(--resref-border);
  border-radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  color: var(--resref-text);
}

/* Headings */
.resref-jf .jf-heading {
  margin-top: 0;
  font-size: 1.5rem;
  color: var(--resref-primary);
}

.resref-jf .jf-subheading {
  margin-bottom: 1rem;
  color: var(--resref-muted);
}

/* Form */
.resref-jf .jf-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Tabbed navigation */
.resref-jf .jf-tabs {
  display: flex;
  border-bottom: 1px solid var(--resref-border);
  margin-bottom: 1rem;
}

.resref-jf .jf-tab {
  flex: 1;
  padding: 0.5rem 0.75rem;
  background-color: #fff;
  border: 1px solid var(--resref-border);
  border-bottom: none;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  color: var(--resref-primary);
  transition: background-color 0.15s ease-in-out;
  user-select: none;
}

/* Remove double borders between adjacent tabs */
.resref-jf .jf-tab + .jf-tab {
  border-left: none;
}

/* Active tab styling */
.resref-jf .jf-tab.active {
  background-color: var(--resref-bg);
  border-bottom: 2px solid var(--resref-primary);
}

/* Tab panels */
.resref-jf .jf-panel {
  padding: 0.5rem 0;
}

.resref-jf .jf-note {
  font-size: 0.8rem;
  color: var(--resref-muted);
  margin-top: 0.25rem;
}

/* Options row: open access filter and search button */
.resref-jf .jf-options {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 1rem;
  gap: 0.75rem;
}

.resref-jf .jf-checkbox.open-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--resref-text);
}

/* Subscription filter inherits from base checkbox */
.resref-jf .jf-checkbox.subscription-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--resref-text);
}

/* Filter group */
.resref-jf .jf-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

/* Sort wrapper */
.resref-jf .jf-sort-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.resref-jf .jf-sort-label {
  font-size: 0.9rem;
  color: var(--resref-text);
  font-weight: 600;
}

.resref-jf .jf-sort {
  padding: 0.4rem;
  border: 1px solid var(--resref-border);
  border-radius: 4px;
  background-color: #fff;
  color: var(--resref-text);
  font-size: 0.9rem;
}

/* Summary text above results */
.resref-jf .jf-summary {
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--resref-primary);
}

.resref-jf .jf-label {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.resref-jf .jf-input,
.resref-jf .jf-textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--resref-border);
  border-radius: 4px;
  font-size: 1rem;
  background: #fff;
  color: var(--resref-text);
}

.resref-jf .jf-textarea {
  min-height: 100px;
  resize: vertical;
}

.resref-jf .jf-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--resref-text);
}

/* Buttons */
.resref-jf .btn-primary {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: var(--resref-primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  text-align: center;
  transition: background-color 0.15s ease-in-out;
}

.resref-jf .btn-primary:hover {
  background-color: var(--resref-secondary);
}

/* Results */
.resref-jf .jf-results {
  margin-top: 1.5rem;
}

.resref-jf .jf-loading,
.resref-jf .jf-empty,
.resref-jf .jf-error {
  padding: 0.75rem;
  background-color: #FFF;
  border: 1px solid var(--resref-border);
  border-radius: 4px;
  color: var(--resref-muted);
}

.resref-jf .jf-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.resref-jf .jf-item {
  padding: 0.75rem;
  border: 1px solid var(--resref-border);
  border-left: 4px solid var(--resref-primary);
  border-radius: 4px;
  margin-bottom: 0.75rem;
  background-color: #FFF;
}

.resref-jf .jf-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--resref-primary);
}

.resref-jf .jf-meta {
  font-size: 0.9rem;
  color: var(--resref-muted);
  margin-bottom: 0.25rem;
}

.resref-jf .jf-meta strong {
  color: var(--resref-primary);
}

.resref-jf a {
  color: var(--resref-secondary);
  text-decoration: none;
}

.resref-jf a:hover {
  text-decoration: underline;
}