/* art2pc — styles */

:root {
  --pico-primary:        #6366f1;
  --pico-primary-hover:  #4f46e5;
  --radius:              0.75rem;
  --card-padding:        1.5rem;
}

/* ── Utilities ─────────────────────────────────────────────────── */

.w-full { width: 100%; }
.muted  { color: var(--pico-muted-color); }

/* ── Splash ─────────────────────────────────────────────────────── */

#splash {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.splash-container {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  max-width: 60rem;
}

@media (min-width: 992px) {
  .splash-container {
    flex-direction: row;
    align-items: center;
  }
}

.splash-hero {
  flex: 1;
  display: flex;
  justify-content: center;
}

.splash-card {
  width: 100%;
  max-width: 22rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.splash-logo {
  width: 5rem;
  height: 5rem;
  border-radius: 1.25rem;
  background: white;
  border: 2px solid var(--pico-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.splash-logo img {
  width: 80%;
  height: 80%;
}

.splash-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
}

.invite-note {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--pico-muted-color);
  line-height: 1.5;
}

.splash-info {
  flex: 1.2;
}

.info-grid {
  display: grid;
  gap: 2rem;
}

.info-grid h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--pico-primary);
}

.info-grid p {
  font-size: 0.9rem;
  color: var(--pico-muted-color);
  line-height: 1.6;
}

.auth-options {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

/* Custom Google Sign-In button */
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: 4px;
  padding: 0 12px;
  height: 40px;
  font-family: 'Google Sans', Roboto, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  margin: 0;
  transition: background 0.2s, box-shadow 0.2s;
}

.google-btn:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

@media (prefers-color-scheme: dark) {
  .google-btn {
    background: #2d2d2d;
    color: #e8eaed;
    border-color: #5f6368;
  }
  .google-btn:hover {
    background: #3c3c3c;
    box-shadow: 0 1px 3px rgba(0,0,0,.4);
  }
}

.auth-divider {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 0.75rem;
  color: var(--pico-muted-color);
  font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--pico-muted-border-color);
}

#apikey-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#apikey-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#apikey-form input {
  margin: 0;
}

#apikey-form button {
  margin: 0;
}

.splash-footer {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--pico-muted-color);
}

.splash-footer a {
  color: var(--pico-muted-color);
}

/* ── App header ─────────────────────────────────────────────────── */

.app-header {
  border-bottom: 1px solid var(--pico-muted-border-color);
  padding: 0.75rem 0;
  margin-bottom: 2rem;
}

.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-logo {
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--pico-primary);
}

.app-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#user-badge {
  font-size: 0.8rem;
  color: var(--pico-muted-color);
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 2rem;
  padding: 0.2rem 0.7rem;
}

.sign-out-btn {
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  margin: 0;
}

/* ── App top row (convert + feed left, quota widget right) ──────── */

.app-top-row {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 0;
}

.app-top-main {
  flex: 1;
  min-width: 0;
}

.quota-widget {
  flex-shrink: 0;
  width: 13rem;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-card-border-color, var(--pico-muted-border-color));
  border-radius: var(--pico-border-radius);
  padding: 1rem;
  margin-top: 0;
}

.quota-rows {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quota-row-label {
  font-size: 0.75rem;
  color: var(--pico-muted-color);
  margin-bottom: 0.2rem;
}

.quota-bar-track {
  height: 4px;
  background: var(--pico-muted-border-color);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.2rem;
}

.quota-bar-fill {
  height: 100%;
  background: var(--pico-primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.quota-bar-fill.quota-warn {
  background: var(--pico-del-color, #c0392b);
}

.quota-bar-value {
  font-size: 0.7rem;
  color: var(--pico-muted-color);
}

@media (max-width: 640px) {
  .app-top-row {
    flex-direction: column;
  }
  .quota-widget {
    width: 100%;
  }
}

/* ── Submit section ─────────────────────────────────────────────── */

.submit-section {
  margin-bottom: 2.5rem;
}

.submit-row {
  max-width: 36rem;
}

.submit-section fieldset {
  margin: 0;
}

/* ── Section headings ───────────────────────────────────────────── */

.section-heading {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pico-muted-color);
  margin-bottom: 1rem;
}

/* ── Queue ──────────────────────────────────────────────────────── */

#queue-section {
  margin-bottom: 2rem;
}

#queue {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.queue-card {
  margin: 0;
  padding: var(--card-padding);
}

.queue-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0;
  margin-bottom: 0.25rem;
  background: none;
  border: none;
}

.queue-card .job-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  font-size: 0.85rem;
  color: var(--pico-muted-color);
}

.queue-card .job-state {
  font-size: 0.75rem;
  color: var(--pico-muted-color);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.queue-card .job-state::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--pico-primary);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ── Feed ───────────────────────────────────────────────────────── */

#feed-section {
  margin-bottom: 2.5rem;
}

.feed-url-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  max-width: 36rem;
}

.feed-rss-icon {
  flex-shrink: 0;
  color: var(--pico-primary);
  display: flex;
  align-items: center;
}

.feed-url-container input {
  margin: 0;
  font-family: monospace;
  font-size: 0.8rem;
  background: var(--pico-card-background-color);
  min-width: 0;
}

.feed-copy-btn {
  flex-shrink: 0;
  width: auto !important;
  margin: 0;
  padding: 0.4rem 0.6rem;
  display: flex;
  align-items: center;
}

/* ── Library ────────────────────────────────────────────────────── */

#library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 34rem), 1fr));
  gap: 1rem;
}

.article-card {
  margin: 0;
  padding: var(--card-padding);
}

.article-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0;
  margin-bottom: 0.5rem;
  background: none;
  border: none;
}

.article-card .article-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.35;
}

.article-card .article-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;
}

.article-card .article-date {
  font-size: 0.75rem;
  color: var(--pico-muted-color);
  white-space: nowrap;
}

.listened-badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pico-primary);
  opacity: 0.7;
  white-space: nowrap;
}

.article-card.listened {
  opacity: 0.65;
}

.article-card .article-source {
  font-size: 0.78rem;
  color: var(--pico-muted-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 0.75rem;
  display: block;
}

.article-card .article-source a {
  color: inherit;
  text-decoration: none;
}

.article-card .article-source a:hover {
  text-decoration: underline;
}

.article-card .article-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
}

.rate-limit-banner {
  margin-top: 0.75rem;
  padding: 0.6rem 0.9rem;
  border-left: 3px solid var(--pico-del-color, #c0392b);
  background: color-mix(in srgb, var(--pico-del-color, #c0392b) 8%, transparent);
  border-radius: var(--pico-border-radius);
  font-size: 0.9rem;
  color: var(--pico-color);
}

.feedback-btns {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.feedback-btn {
  background: none;
  border: none;
  padding: 0.1rem 0.3rem;
  margin: 0;
  cursor: pointer;
  opacity: 0.35;
  color: var(--pico-muted-color);
  transition: opacity 0.15s, transform 0.1s, color 0.15s;
  width: auto;
  line-height: 1;
  display: flex;
  align-items: center;
}

.feedback-btn:hover {
  opacity: 0.7;
  background: none;
  border: none;
  color: var(--pico-color);
  transform: scale(1.15);
}

.feedback-btn.feedback-active {
  opacity: 1;
  color: var(--pico-color);
  transform: scale(1.1);
}

.delete-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--pico-muted-color);
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  width: auto;
}

.delete-btn:hover {
  color: var(--pico-del-color);
  background: none;
  border: none;
}

.article-card audio {
  width: 100%;
  height: 2.25rem;
}

.expiry-warning { color: var(--pico-del-color, #c0392b); display: block; margin-top: 0.25rem; }
.expiry-date { display: block; margin-top: 0.25rem; }
