/* widgets.css
── Rich Widgets ───────────────────────────── */
.rich-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rich-widget:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-lg);
}

.widget-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

/* 🚀 Spaceflight Intelligence Widget */
.rich-widget.space-widget {
  background: linear-gradient(165deg, var(--surface) 0%, var(--surface2) 100%);
  border: 1px solid var(--space-cyan-glow);
  box-shadow: 0 8px 30px rgba(6, 182, 212, 0.1);
}

.space-widget-title {
  color: var(--space-cyan);
  border-bottom-color: var(--space-cyan-glow);
}

.space-title-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.space-icon {
  font-size: 0.9rem;
  color: var(--space-cyan);
}

.space-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--space-cyan);
  box-shadow: 0 0 10px var(--space-cyan);
  animation: livePulse 2s infinite;
}

.space-topic-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.space-filter-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}

.space-filter-bar::-webkit-scrollbar {
  display: none;
}

.space-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.space-chip:hover {
  background: var(--surface);
  color: var(--text);
}

.space-chip.active {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--space-cyan);
  color: var(--space-cyan);
}

.space-news-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.space-news-item {
  display: flex;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.space-news-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.space-thumb {
  width: 76px;
  height: 76px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.space-content {
  flex: 1;
  min-width: 0;
}

.space-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.space-site-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(99, 130, 255, 0.15);
  color: var(--primary);
}

.space-time-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.space-content h4 {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
}

.space-content h4 a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

.space-content h4 a:hover {
  color: var(--space-cyan);
}

.space-snippet {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 4px;
}

.space-widget-footer {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.space-widget-footer .widget-refresh-btn.secondary-btn {
  background: rgba(0, 242, 254, 0.08);
  border-color: var(--space-cyan-glow);
  color: var(--space-cyan);
}

.space-widget-footer .widget-refresh-btn.secondary-btn:hover {
  background: rgba(0, 242, 254, 0.2);
}

/* Weather */
.weather-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.weather-temp {
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.weather-icon {
  font-size: 3rem;
  color: var(--accent);
}

.weather-desc {
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: capitalize;
  margin-bottom: 14px;
}

.weather-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.weather-grid div {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Reddit & News Widget Styles */
.reddit-list {
  margin-top: 10px;
  padding: 0;
  list-style: none;
}

.reddit-post {
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.reddit-post:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.reddit-meta {
  font-size: 0.75rem;
  opacity: 0.65;
  margin-top: 5px;
}

.reddit-meta i {
  font-size: 0.7rem;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.news-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.news-thumb.fallback {
  background: rgba(128,128,128,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.news-item-content {
  flex: 1;
  min-width: 0;
}

.news-item-content h4 {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0;
  margin-top: 0;
  color: var(--text);
}

.news-item-content a {
  color: inherit;
  text-decoration: none;
}

.news-item-content a:hover {
  text-decoration: underline;
}

.reddit-flair {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 69, 0, 0.12);
  color: #FF4500;
  display: inline-block;
  margin-bottom: 4px;
}

/* Math */
.math-expr {
  font-family: 'DM Mono', monospace;
  background: var(--surface2);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.math-result {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--success);
  margin-top: 8px;
}

/* Quote */
.quote-text {
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.6;
}

.rich-widget.quote-widget {
  border-left: 4px solid var(--warn);
}

/* Dictionary */
.dict-word {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.dict-phonetic {
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.dict-pos {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.dict-defs {
  padding-left: 16px;
  line-height: 1.6;
  font-size: 0.88rem;
}

/* Joke */
.joke-body {
  padding: 8px 0;
}

.joke-single, 
.joke-setup {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
}

.joke-delivery {
  font-size: 1rem;
  line-height: 1.65;
  font-weight: 600;
  color: var(--primary);
  margin-top: 6px;
}

.widget-refresh-btn {
  width: 100%;
  padding: 10px;
  margin-top: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.widget-refresh-btn:hover {
  background: var(--border);
}

/* Bible */
.bible-ref {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.bible-text {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 0.95rem;
  line-height: 1.65;
  font-style: italic;
}

.bible-translation {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
}

@media (max-width: 480px) {
  .weather-temp {
    font-size: 2.2rem;
  }
  .space-thumb {
    width: 64px;
    height: 64px;
  }
}