/* css/ui.css — modal, search, toast, responsive */

/* ── Search overlay ── */
.search-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.45); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center; padding-top: 100px;
}
.search-box { background: #fff; border-radius: var(--radius-lg); width: 540px; max-width: calc(100vw - 32px); box-shadow: var(--shadow-lg); overflow: hidden; }
.search-input-wrap { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border-light); }
.search-input { flex: 1; border: none; outline: none; font-size: 15px; color: var(--text); background: transparent; font-family: inherit; }
.search-item { padding: 12px 18px; cursor: pointer; transition: background .1s; border-bottom: 1px solid var(--border-light); }
.search-item:hover { background: var(--bg); }
.search-item:last-child { border-bottom: none; }
.search-item-label { font-size: 13.5px; font-weight: 600; }
.search-item-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.search-empty      { padding: 24px; text-align: center; color: var(--text-muted); font-size: 13px; }
#searchResults { max-height: 360px; overflow-y: auto; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.45); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-box { background: #fff; border-radius: var(--radius-lg); width: 560px; max-width: 100%; max-height: 88vh; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border-light); flex-shrink: 0; }
.modal-title  { font-size: 15px; font-weight: 700; }
.modal-close  { width: 30px; height: 30px; border-radius: 50%; font-size: 15px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: background .15s; }
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 22px; overflow-y: auto; }

/* ── Toast ── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 600; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--border); border-radius: 9px; padding: 12px 16px; font-size: 13.5px; box-shadow: var(--shadow-lg); min-width: 240px; max-width: 360px; animation: slideIn .25s ease; transition: opacity .35s; }
.toast.success { border-left: 3px solid var(--green); }
.toast.warning { border-left: 3px solid var(--amber); }
.toast.info    { border-left: 3px solid var(--primary); }
.toast.error   { border-left: 3px solid var(--red); }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--text-muted); }
.toast.success .toast-dot { background: var(--green); }
.toast.warning .toast-dot { background: var(--amber); }
.toast.info    .toast-dot { background: var(--primary); }
.toast.error   .toast-dot { background: var(--red); }
@keyframes slideIn {
  from { transform: translateX(30px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .gallery-layout     { grid-template-columns: 1fr; }
  .suggestions-layout { grid-template-columns: 1fr; }
  .ol-grid            { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .hero-card      { grid-template-columns: 1fr; }
  .hero-photo     { display: none; }
  .dashboard-main { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  :root { --sidebar-w: 0px; }
  .sidebar      { transform: translateX(-100%); }
  .main-content { padding: 16px; }
  .topbar       { padding: 0 14px; }
  .topbar-center { display: none; }
  .stats-grid   { grid-template-columns: 1fr 1fr; }
}
