/* signale/style.css */

/* ---- Toolbar ---- */
.sig-toolbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.sig-search-wrap {
  position: relative;
}
.sig-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
#searchInput {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.8rem;
  font-family: 'Barlow', sans-serif;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
#searchInput:focus { border-color: var(--blue); }
#searchInput::placeholder { color: var(--text-muted); }

.filter-buttons {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover { border-color: var(--blue); color: var(--blue); }
.filter-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ---- Theme icon btn in header ---- */
.theme-btn-icon {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 1rem;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}
.theme-btn-icon:hover { border-color: var(--amber); color: var(--amber); }

/* ---- Main signal grid ---- */
.sig-main {
  flex: 1;
  padding: 1.5rem 1.8rem 2rem;
}
.signal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.no-results {
  grid-column: 1/-1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
  font-size: 1.1rem;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
}

/* ---- Signal Card ---- */
.signal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  position: relative;
  outline: none;
  box-shadow: var(--shadow);
}
.signal-card:hover { transform: translateY(-2px); border-color: var(--blue); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }
.signal-card:focus-visible { outline: 2px solid var(--blue); }

.favorite-star {
  position: absolute;
  top: 0.7rem; right: 0.8rem;
  font-size: 1.3rem;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 5;
  transition: transform 0.15s;
  color: gold;
  line-height: 1;
}
.favorite-star:hover { transform: scale(1.2); }
.favorite-star.inactive { opacity: 0.3; color: var(--text-muted); }

.signal-symbol {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--blue);
  padding-right: 2rem;
  margin-bottom: 0.25rem;
}

/* Expandable details */
.details-container {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s ease-out;
}
.signal-card.expanded .details-container {
  max-height: 900px;
  transition: max-height 0.45s ease-in;
}

.signal-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.6rem 0 0.3rem;
}
.signal-category {
  font-size: 0.72rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--surface2);
  color: var(--blue);
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  border: 1px solid var(--border);
}
.signal-meaning {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--amber);
  border-left: 3px solid var(--amber);
  padding-left: 0.75rem;
  margin: 0.4rem 0;
}
.signal-description {
  font-size: 0.88rem;
  color: var(--text-muted);
  background: var(--surface2);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

/* Images */
.image-day-container, .image-night-container {
  margin-bottom: 0.75rem;
}
.image-row { display: flex; flex-direction: column; gap: 4px; }
.image-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.signal-image-day, .signal-image-night {
  width: 100%;
  height: 130px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.image-fallback {
  display: none;
  width: 100%;
  height: 80px;
  background: var(--surface2);
  border-radius: 8px;
  border: 1px dashed var(--border);
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-direction: column;
  gap: 4px;
}
.image-fallback::before { content: "🖼"; font-size: 1.4rem; opacity: 0.5; }

/* Scroll to top */
#scrollToTop {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  transition: opacity 0.2s, transform 0.2s;
  z-index: 50;
}
#scrollToTop:hover { opacity: 0.85; transform: scale(1.05); }

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.overlay.active { display: flex; }
.overlay-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.overlay-box h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 1.2rem;
}
.overlay-box p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.75rem; }
.overlay-box input, .overlay-box textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-size: 0.95rem;
}
.overlay-box textarea { min-height: 100px; resize: vertical; }
.overlay-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 0.5rem; }
.btn-primary {
  padding: 0.55rem 1.4rem;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.85; }
.btn-secondary {
  padding: 0.55rem 1.2rem;
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'Barlow', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.15s;
}
.btn-secondary:hover { color: var(--text); }
#feedbackStatus, #adminStatus { margin-top: 0.75rem; font-size: 0.85rem; color: var(--amber); text-align: center; }

/* Footer feedback btn */
.footer-feedback-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: color 0.15s, border-color 0.15s;
}
.footer-feedback-btn:hover { color: var(--amber); border-color: var(--amber); }

@media print {
  .site-header, .page-nav, .sig-toolbar, #scrollToTop, .site-footer { display: none !important; }
  .signal-card .details-container { max-height: none !important; overflow: visible !important; }
  .signal-card { break-inside: avoid; }
}
@media (max-width: 600px) {
  .sig-main { padding: 1rem; }
  .sig-toolbar { padding: 0.75rem 1rem; }
  .signal-grid { grid-template-columns: 1fr; }
}
