/* Hide sidebar and expand main column when Maps tab is active */
body.maps-tab-active .results-sidebar {
  display: none !important;
}

body.maps-tab-active .results-layout {
  grid-template-columns: 1fr !important;
  display: block !important;
}

body.maps-tab-active .results-main {
  width: 100% !important;
  max-width: 100% !important;
}

/* Map container */
#maps-plugin-container {
  width: 100%;
  margin-bottom: 1.5rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-light);
}

#maps-plugin-map {
  width: 100%;
  height: 420px;
}

/* Leaflet popup theming */
#maps-plugin-map .leaflet-popup-content-wrapper {
  background: var(--bg-light);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: none;
  border-radius: 6px;
}

#maps-plugin-map .leaflet-popup-content a {
  color: var(--text-link);
}

#maps-plugin-map .leaflet-popup-tip {
  background: var(--bg-light);
}

#maps-plugin-map .leaflet-control-attribution {
  background: var(--bg-light);
  color: var(--text-secondary);
  font-size: 0.7rem;
}

#maps-plugin-map .leaflet-control-attribution a {
  color: var(--text-link);
}

.maps-no-results {
  padding: 1.5rem;
  color: var(--text-secondary);
  text-align: center;
}

@media (max-width: 600px) {
  #maps-plugin-map {
    height: 260px !important;
  }
}

.ac-item--history {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
}

.ac-item--history .ac-item-icon--clock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

.ac-item--history .ac-item-icon--clock svg {
  width: 20px;
  height: 20px;
}

.ac-item--history .ac-item-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ac-item--history .ac-item-delete {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: 50%;
  opacity: 0.8;
}

.ac-item--history .ac-item-delete:hover {
  opacity: 1;
  background: var(--bg-hover);
  color: var(--danger);
}

.ac-item--history .ac-item-delete svg {
  width: 18px;
  height: 18px;
}

.search-history-result .result-favicon--clock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  color: var(--text-cite);
}

.search-history-result .result-favicon--clock svg {
  width: 22px;
  height: 22px;
}

.search-history-result .history-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-left: auto;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: 50%;
  text-decoration: none;
}

.search-history-result .history-delete-btn:hover {
  color: var(--danger);
  background: var(--bg-hover);
}

.search-history-result .history-delete-btn svg {
  width: 18px;
  height: 18px;
}


/* ── Reddit Slot Panel ─────────────────────────────────────── */

.rslot-panel {
  padding: 4px 0 12px;
  margin-bottom: 4px;
  max-width: 680px;
}

.rslot-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.rslot-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.rslot-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-primary);
}

/* Post card */
.rslot-post {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px 16px;
  text-decoration: none;
  margin-bottom: 12px;
  transition: border-color 0.15s, background 0.15s;
}

.rslot-post:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
}

.rslot-post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.rslot-post-sub {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.rslot-post-stats {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.rslot-post-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.45;
}

/* Comments label */
.rslot-comments-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* Comments grid — scrollable on mobile */
.rslot-comments-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 600px) {
  .rslot-comments-row {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 8px;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .rslot-comments-row::-webkit-scrollbar {
    display: none;
  }
  .rslot-comment {
    flex: 0 0 85%;
    scroll-snap-align: start;
    min-width: 0;
  }
}

.rslot-comment {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 13px 15px;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.rslot-comment:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
}

.rslot-comment--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: default;
}

.rslot-comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.rslot-comment-author {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}

.rslot-comment-score {
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 3px;
}

.rslot-comment-body {
  font-size: 14px;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 480px) {
  .rslot-comments-row { grid-template-columns: 1fr; }
}

/* ── Weather Command ─────────────────────────────────────── */
.wxs-wrap {
  --wxs-sun: #f59e0b;
  max-width: 680px;
  margin-bottom: 12px;
  font-family: var(--font-sans, sans-serif);
}

.wxs-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 14px;
}

.wxs-city {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.wxs-temp-row {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  line-height: 1;
}

.wxs-num {
  font-size: 64px;
  font-weight: 300;
  color: var(--text-primary);
  letter-spacing: -2px;
}

.wxs-deg {
  font-size: 28px;
  font-weight: 300;
  color: var(--text-secondary);
  padding-bottom: 10px;
}

.wxs-desc {
  font-size: 14px;
  color: var(--text-primary);
  margin-top: 8px;
}

.wxs-feels {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* Animated icon */
.wxs-icon-wrap {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  position: relative;
}

.wxs-icon-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.wxs-icon-in  { opacity: 1; transform: scale(1); }
.wxs-icon-out { opacity: 0; transform: scale(0.82); }

/* Float animation */
.wxs-ani-float { animation: wxs-float 4s ease-in-out infinite; }
.wxs-ani-sun   { animation: wxs-float 4s ease-in-out infinite; }
@keyframes wxs-float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-5px)} }
@keyframes wxs-spin  { from{transform:rotate(0)} to{transform:rotate(360deg)} }
@keyframes wxs-fadein{ from{opacity:0;transform:translateY(4px)} to{opacity:1;transform:translateY(0)} }

/* Rain drops */
.wxs-drop {
  position: absolute;
  width: 2px;
  border-radius: 2px;
  background: #60a5fa;
  opacity: 0.8;
  animation: wxs-rain 1.1s linear infinite;
}
@keyframes wxs-rain {
  0%   { transform: translateY(-2px); opacity: 0; }
  50%  { opacity: 0.8; }
  100% { transform: translateY(18px); opacity: 0; }
}

/* Snow flakes */
.wxs-flake {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #bfdbfe;
  animation: wxs-snow 1.4s linear infinite;
}
@keyframes wxs-snow {
  0%   { transform: translateY(-2px); opacity: 0; }
  50%  { opacity: 1; }
  100% { transform: translateY(14px); opacity: 0; }
}

/* Lightning bolt */
.wxs-bolt { animation: wxs-flash 2s ease-in-out infinite; }
@keyframes wxs-flash { 0%,100%{opacity:.45} 50%{opacity:1} }

/* Stats */
.wxs-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--border-light);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}

.wxs-st { background: var(--bg); padding: 11px 13px; }

.wxs-st-l {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.wxs-st-v {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Sunrise/sunset */
.wxs-sun-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 13px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
}

.wxs-sun-bar {
  flex: 1;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  position: relative;
}

.wxs-sun-fill {
  height: 100%;
  background: #f59e0b;
  opacity: 0.7;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.wxs-sun-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: #f59e0b;
  border-radius: 50%;
  transition: left 0.6s ease;
}

.wxs-sun-time {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

/* Forecast label */
.wxs-fl {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.wxs-fl-hint {
  font-size: 9px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-secondary);
}

/* Day cards */
.wxs-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.wxs-day {
  background: var(--bg);
  border: 1.5px solid transparent;
  border-radius: 8px;
  padding: 9px 4px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.wxs-day-active {
  border-color: var(--primary);
  background: var(--bg-light);
}

.wxs-day-name {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.wxs-day-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 28px;
  margin-bottom: 5px;
}

.wxs-day-hi {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.wxs-day-lo {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 1px;
}

/* Hourly panel */
.wxs-hourly {
  margin-top: 8px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.3s ease;
}

.wxs-hourly-open {
  max-height: 80px;
  opacity: 1;
}

.wxs-hourly-scroll {
  display: flex;
  overflow-x: auto;
  padding: 10px 12px;
  gap: 14px;
  scrollbar-width: none;
}

.wxs-hourly-scroll::-webkit-scrollbar { display: none; }

.wxs-h { flex-shrink: 0; text-align: center; min-width: 36px; }
.wxs-h-time { font-size: 10px; color: var(--text-secondary); margin-bottom: 3px; }
.wxs-h-temp { font-size: 12px; font-weight: 500; color: var(--text-primary); }

@media (max-width: 500px) {
  .wxs-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wxs-days  { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wxs-num   { font-size: 52px; }
}

.qr-result .qr-label {
  word-break: break-all;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.qr-result .qr-image {
  display: block;
  border-radius: 8px;
}
