/* Demo-specific styles. Pico ve UnoCSS'in üstüne ince ayarlar. */

[x-cloak] { display: none !important; }

/* ─── Hero ────────────────────────────────────────────────────── */
.hero {
  padding: 2rem 0 1rem;
  text-align: center;
}
.hero h1 {
  margin-bottom: 0.25rem;
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ─── Sync status bar ─────────────────────────────────────────── */
.sync-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 1rem;
  margin-top: 1.5rem;
  font-size: 0.875rem;
}
.sync-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sync-status .dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
}
.sync-status .dot.online { background: var(--pico-ins-color); }
.sync-status .dot.offline { background: var(--pico-del-color); }
.sync-status .dot.connecting { background: var(--pico-color); animation: pulse 1.5s infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.sync-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sync-actions button {
  margin: 0;
  padding: 0.25rem 0.5rem;
  font-size: 1rem;
}
.room-label {
  font-size: 0.75rem;
  color: var(--pico-muted-color);
}
.room-label code {
  background: var(--pico-code-background-color);
  padding: 0.1rem 0.4rem;
  border-radius: 0.2rem;
}

/* ─── Awareness avatars ──────────────────────────────────────── */
.presence-list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.presence-list .avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: 0 0 0 2px var(--pico-background-color);
  margin-left: -0.4rem;
  cursor: help;
}
.presence-list .avatar:first-child { margin-left: 0; }
.presence-list .empty {
  font-size: 0.875rem;
  color: var(--pico-muted-color);
  font-style: italic;
}

/* ─── Offline banner ─────────────────────────────────────────── */
.offline-banner {
  background: var(--pico-del-color);
  color: var(--pico-del-inverse);
  padding: 0.75rem 1rem;
  text-align: center;
  border-radius: 0.5rem;
  margin-top: 1rem;
}

/* ─── Section başlıkları ─────────────────────────────────────── */
section {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--pico-muted-border-color);
}
section h2 {
  margin-bottom: 0.5rem;
}

/* ─── Grids (içeride 2-3 kolon) ──────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

/* ─── Todo list ──────────────────────────────────────────────── */
.todo-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.todo-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--pico-card-sectionning-background-color);
  border-radius: 0.5rem;
}
.todo-list li .todo-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.todo-list li .todo-item input[type=checkbox] { margin: 0; }
.todo-list li .done {
  text-decoration: line-through;
  color: var(--pico-muted-color);
}
.todo-list li button {
  margin: 0;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}
.empty-state {
  color: var(--pico-muted-color);
  font-style: italic;
  text-align: center;
  padding: 1.5rem;
}

/* ─── Form validation ────────────────────────────────────────── */
input.invalid {
  border-color: var(--pico-del-color) !important;
}
small.error {
  color: var(--pico-del-color);
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
}
p.success {
  color: var(--pico-ins-color);
  font-weight: 600;
}

/* ─── Modal ──────────────────────────────────────────────────── */
dialog.pico-modal {
  width: min(540px, 90vw);
  padding: 0;
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
dialog.pico-modal::backdrop {
  background: rgba(0,0,0,0.5);
}

/* ─── Autocomplete ──────────────────────────────────────────── */
.autocomplete-results {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 0.25rem;
  max-height: 200px;
  overflow-y: auto;
  background: var(--pico-background-color);
  position: relative;
  z-index: 10;
}
.autocomplete-results li {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}
.autocomplete-results li.selected,
.autocomplete-results li:hover {
  background: var(--pico-primary-background);
  color: var(--pico-primary-inverse);
}

/* ─── Tabs ───────────────────────────────────────────────────── */
[role="tablist"] {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
[role="tablist"] button {
  margin: 0;
  border-radius: 0.25rem 0.25rem 0 0;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* ─── Datagrid ───────────────────────────────────────────────── */
.grid-pagination {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
}
.grid-pagination button { margin: 0; padding: 0.25rem 0.5rem; }
th[aria-sort] { cursor: pointer; user-select: none; }
th[aria-sort="ascending"]::after { content: ' ↑'; }
th[aria-sort="descending"]::after { content: ' ↓'; }

/* ─── Wizard ─────────────────────────────────────────────────── */
progress {
  width: 100%;
  margin: 0.5rem 0;
}
.wizard-nav {
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  margin-top: 1rem;
}
.wizard-nav button { margin: 0; }

/* ─── Upload ─────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--pico-muted-border-color);
  border-radius: 0.5rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.upload-zone:hover {
  border-color: var(--pico-primary);
  background: rgba(0,0,0,0.02);
}

/* ─── Search ─────────────────────────────────────────────────── */
.search-results {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 0.25rem;
  max-height: 240px;
  overflow-y: auto;
}
.search-results li {
  padding: 0.5rem 0.75rem;
}
mark {
  background: yellow;
  color: black;
  padding: 0 0.1em;
}

/* ─── Activity list ─────────────────────────────────────────── */
.activity-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  max-height: 200px;
  overflow-y: auto;
}
.activity-list li {
  padding: 0.4rem 0;
  border-bottom: 1px dashed var(--pico-muted-border-color);
  font-size: 0.875rem;
}
.activity-list li small {
  display: block;
  color: var(--pico-muted-color);
  font-size: 0.75rem;
}

/* ─── Sync dl ────────────────────────────────────────────────── */
.sync-dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 0.75rem;
  margin: 0;
}
.sync-dl dt {
  color: var(--pico-muted-color);
}
.sync-dl dd {
  margin: 0;
  font-weight: 600;
}

/* ─── Dark mode tweaks ───────────────────────────────────────── */
[data-theme="dark"] .todo-list li {
  background: #1f2937;
}
[data-theme="dark"] mark {
  background: #fbbf24;
  color: #1f2937;
}
[data-theme="dark"] .autocomplete-results li.selected,
[data-theme="dark"] .autocomplete-results li:hover {
  background: #06b6d4;
}

/* ─── Code block (how-it-works) ──────────────────────────────── */
pre code {
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ─── Footer ─────────────────────────────────────────────────── */
footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--pico-muted-border-color);
  text-align: center;
  opacity: 0.7;
}
footer code {
  font-size: 0.8rem;
  background: var(--pico-code-background-color);
  padding: 0.1rem 0.3rem;
  border-radius: 0.2rem;
}
