@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&family=Playfair+Display:ital,wght@0,700;1,400&display=swap');

:root {
  --bg:            #fdebeb;
  --bg2:           #fff5f5;
  --text:          #020000;
  --text-muted:    #7a4a52;
  --accent:        #ec9da0;
  --accent-strong: #C72C48;
  --accent-dark:   #4c0a16;
  --shadow:        rgba(76,10,22,0.15);

  --radius:        12px;
  --radius-sm:     7px;

  --transition:    0.2s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Outfit", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
}

/* ── HEADER ─────────────────────────────────────────────────────────────── */

.header {
  background: var(--accent-strong);

  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 10px 24px;

  position: sticky;
  top: 0;
  z-index: 100;

  box-shadow: 0 2px 16px var(--shadow);
}

.main_info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 100px;
  height: auto;
  display: flex;
  align-items: center;
  filter: brightness(0) invert(1);
}

.title h1 {
  font-family: "Playfair Display", serif;
  color: #fff;
  font-size: 1.6rem;
  letter-spacing: -0.5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── SEARCH ─────────────────────────────────────────────────────────────── */

.search-shell {
  display: flex;
  align-items: center;
}

.searchbox {
  background: rgba(255,255,255,0.15);

  border: 1.5px solid rgba(255,255,255,0.35);
  border-radius: 7px;

  padding: 8px 18px;

  color: #fff;

  font-size: 0.9rem;

  width: 220px;

  outline: none;

  transition: var(--transition);
}

.searchbox::placeholder {
  color: rgba(255,255,255,0.65);
}

.searchbox:focus {
  background: rgba(255,255,255,0.25);

  border-color: rgba(255,255,255,0.6);

  width: 280px;
}

/* ── ICON BUTTONS ───────────────────────────────────────────────────────── */

.icon-button {
  background: rgba(255,255,255,0.15);

  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: 50%;

  width: 38px;
  height: 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: var(--transition);

  color: #fff;
}

.icon-button:hover {
  background: rgba(255,255,255,0.3);
}

.icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* ── USER CHIP ──────────────────────────────────────────────────────────── */

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;

  background: rgba(255,255,255,0.15);

  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: 7px;

  padding: 5px 14px 5px 8px;

  color: #fff;

  font-size: 0.85rem;

  transition: var(--transition);

  cursor: pointer;

  position: relative;
}

.user-chip:hover {
  background: rgba(255,255,255,0.25);
}

.user-chip .avatar {
  width: 26px;
  height: 26px;

  border-radius: 50%;

  background: var(--accent);

  display: flex;
  align-items: center;
  justify-content: center;

  font-weight: 700;
  font-size: 0.8rem;
}

.user-dropdown {
  position: absolute;

  top: calc(100% + 8px);
  right: 0;

  background: #fff;

  border-radius: var(--radius);

  box-shadow: 0 8px 32px var(--shadow);

  min-width: 160px;

  overflow: hidden;

  display: none;

  z-index: 200;
}

.user-chip:hover .user-dropdown,
.user-chip.open .user-dropdown {
  display: block;
}

.user-dropdown a,
.user-dropdown button {
  display: block;
  width: 100%;

  padding: 11px 18px;

  text-align: left;

  font-size: 0.88rem;

  color: var(--text);

  background: none;
  border: none;

  transition: var(--transition);
}

.user-dropdown a:hover,
.user-dropdown button:hover {
  background: var(--bg);
  color: var(--accent-strong);
}

.user-dropdown .danger {
  color: #e53e3e;
}

.user-dropdown .danger:hover {
  background: #fff5f5;
  color: #c53030;
}

/* ── BADGES ─────────────────────────────────────────────────────────────── */

.badge {
  display: inline-block;

  padding: 2px 10px;

  border-radius: 20px;

  font-size: 0.74rem;
  font-weight: 600;

  letter-spacing: 0.3px;
}

.badge-open {
  background: #c6f6d5;
  color: #22543d;
}

.badge-closed {
  background: #fed7d7;
  color: #742a2a;
}

.badge-archived {
  background: #e2e8f0;
  color: #4a5568;
}

.badge-admin {
  background: var(--accent-strong);
  color: #fff;
}

/* ── TAGS ───────────────────────────────────────────────────────────────── */

.tag {
  display: inline-flex;
  align-items: center;

  padding: 3px 10px;

  border-radius: 7px;

  font-size: 0.75rem;
  font-weight: 600;

  background: var(--accent);

  color: var(--accent-dark);

  cursor: pointer;

  transition: var(--transition);
}

.tag:hover {
  background: var(--accent-strong);
  color: #fff;
}

.tag.active {
  background: var(--accent-strong);
  color: #fff;
}

/* ── BUTTONS ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 9px 20px;

  border-radius: var(--radius-sm);

  font-size: 0.88rem;
  font-weight: 600;

  border: none;

  transition: var(--transition);
}

.btn-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.btn-primary {
  background: var(--accent-strong);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-outline {
  background: transparent;

  border: 1.5px solid var(--accent-strong);

  color: var(--accent-strong);
}

.btn-outline:hover {
  background: var(--accent-strong);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--accent);
  color: var(--accent-dark);
}

.btn-danger {
  background: #e53e3e;
  color: #fff;
}

.btn-danger:hover {
  background: #c53030;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.8rem;
}

/* ── VOTES ──────────────────────────────────────────────────────────────── */

.vote-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 4px 12px;

  border-radius: 20px;

  border: 1.5px solid var(--accent);

  background: transparent;

  color: var(--text-muted);

  font-size: 0.82rem;
  font-weight: 600;

  transition: var(--transition);
}

.vote-btn img {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

.vote-btn:hover {
  background: var(--accent);
  color: var(--accent-dark);
}

.vote-btn.liked {
  background: #c6f6d5;
  border-color: #48bb78;
  color: #22543d;
}

.vote-btn.disliked {
  background: #fed7d7;
  border-color: #fc8181;
  color: #742a2a;
}

/* ── FORMS ──────────────────────────────────────────────────────────────── */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;

  color: var(--text-muted);
}

.form-input,
.form-textarea,
.form-select {
  border: 1.5px solid var(--accent);

  border-radius: var(--radius-sm);

  padding: 10px 14px;

  font-size: 0.92rem;

  background: #fff;

  color: var(--text);

  outline: none;

  transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent-strong);

  box-shadow: 0 0 0 3px rgba(199,44,72,0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-error {
  color: #e53e3e;
  font-size: 0.82rem;
  margin-top: 4px;
}

/* ── MODAL ──────────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;

  background: rgba(76,10,22,0.45);

  backdrop-filter: blur(4px);

  z-index: 500;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 16px;

  opacity: 0;
  pointer-events: none;

  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: #fff;

  border-radius: var(--radius);

  box-shadow: 0 24px 60px var(--shadow);

  width: 100%;
  max-width: 560px;

  max-height: 90vh;

  overflow-y: auto;

  transform: translateY(24px);

  transition: transform 0.25s cubic-bezier(.4,0,.2,1);
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-header {
  padding: 20px 24px 14px;

  border-bottom: 1px solid var(--bg);

  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-family: "Playfair Display", serif;
  font-size: 1.3rem;
}

.modal-close {
  background: none;
  border: none;

  font-size: 1.4rem;

  cursor: pointer;

  color: var(--text-muted);

  line-height: 1;
}

.modal-body {
  padding: 20px 24px;

  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 14px 24px;

  border-top: 1px solid var(--bg);

  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── TAG INPUT ──────────────────────────────────────────────────────────── */

.tags-input-area {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;

  min-height: 46px;

  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);

  padding: 8px 10px;

  background: #fff;

  cursor: text;
}

.tags-input-area input {
  border: none;
  outline: none;

  flex: 1;
  min-width: 120px;

  background: transparent;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  background: var(--accent);

  color: var(--accent-dark);

  border-radius: 999px;

  padding: 5px 10px;

  font-size: 0.78rem;
  font-weight: 600;
}

.tag-pill-remove {
  width: 14px;
  height: 14px;

  border: none;

  background: transparent;

  background-image: url("../img/close.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;

  cursor: pointer;
}

/* ── PAGINATION ─────────────────────────────────────────────────────────── */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 16px 0;
}

.page-btn {
  min-width: 36px;
  height: 36px;

  border-radius: var(--radius-sm);

  border: 1.5px solid var(--accent);

  background: transparent;

  color: var(--accent-strong);

  font-weight: 600;
  font-size: 0.88rem;

  transition: var(--transition);

  display: flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover,
.page-btn.active {
  background: var(--accent-strong);

  color: #fff;

  border-color: var(--accent-strong);
}

.page-btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ── TOAST ──────────────────────────────────────────────────────────────── */

#toast-container {
  position: fixed;

  bottom: 24px;
  right: 24px;

  z-index: 9999;

  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--accent-dark);

  color: #fff;

  padding: 12px 20px;

  border-radius: var(--radius-sm);

  font-size: 0.88rem;

  box-shadow: 0 4px 20px var(--shadow);

  animation: toastIn 0.3s ease;
}

.toast.success {
  background: #276749;
}

.toast.error {
  background: #9b2c2c;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(40px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ── EMPTY STATE ────────────────────────────────────────────────────────── */

.empty-state {
  text-align: center;

  padding: 60px 20px;

  color: var(--text-muted);
}

.empty-state-icon {
  width: 60px;
  height: 60px;

  margin: 0 auto 14px;

  opacity: 0.7;
}

.empty-state p {
  font-size: 1rem;
}

/* ── RESPONSIVE ─────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .header {
    padding: 12px 16px;

    flex-wrap: wrap;
    gap: 12px;
  }

  .header-actions {
    width: 100%;
  }

  .search-shell {
    flex: 1;
  }

  .searchbox {
    width: 100%;
  }

  .searchbox:focus {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .title h1 {
    font-size: 1.2rem;
  }

  .logo {
    width: 52px;
  }

  .modal-body,
  .modal-header,
  .modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
}