/* ============================================================
   HOW YOU FEEL?  –  Stiliai
   Estetika: tamsi, intymi, kaip naktinis dienoraštis
   Šriftai: Playfair Display + DM Sans
============================================================ */

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

/* ---- Kintamieji ---- */
:root {
  --bg:          #0d0d0f;
  --bg2:         #131317;
  --bg3:         #1a1a21;
  --border:      rgba(255,255,255,0.07);
  --text:        #e8e6e3;
  --muted:       #6b6877;
  --accent:      #c17fff;
  --accent2:     #ff8fab;
  --gold:        #f5c842;
  --success:     #52d98c;
  --danger:      #ff5f6d;

  --mood1: #e05252;
  --mood2: #e0914a;
  --mood3: #b8b8b8;
  --mood4: #6dbeab;
  --mood5: #52d98c;

  --radius:  14px;
  --radius-sm: 8px;
  --shadow:  0 8px 32px rgba(0,0,0,.55);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Fono tekstūra */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%,  rgba(193,127,255,.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(255,143,171,.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }

/* ============================================================
   NAVIGACIJA
============================================================ */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,13,15,.88);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
}
.nav-inner {
  max-width: 980px; margin: 0 auto;
  display: flex; align-items: center;
  height: 60px; gap: 1rem;
}
.logo {
  font-family: var(--font-display);
  font-size: 1.25rem; font-style: italic;
  color: var(--text);
  text-decoration: none; flex: 1;
}
.logo span { color: var(--accent); }
.nav-btn {
  background: var(--accent);
  color: #0d0d0f;
  border: none; cursor: pointer;
  padding: .45rem 1.1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .85rem; font-weight: 500;
  transition: opacity .2s, transform .15s;
}
.nav-btn:hover { opacity: .85; transform: translateY(-1px); }

/* ============================================================
   HERO
============================================================ */
.hero {
  text-align: center;
  padding: 5rem 1.5rem 3.5rem;
  position: relative; z-index: 1;
}
.hero-eyebrow {
  font-size: .75rem; letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted); margin-bottom: 1.2rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.1; font-weight: 700;
  margin-bottom: 1.2rem;
}
.hero h1 em { color: var(--accent); font-style: italic; }
.hero p {
  max-width: 480px; margin: 0 auto 2rem;
  color: var(--muted); font-size: .95rem;
  font-weight: 300;
}
.hero-cta {
  display: inline-flex; gap: .75rem; flex-wrap: wrap; justify-content: center;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #0d0d0f; border: none; cursor: pointer;
  padding: .7rem 1.8rem; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: .9rem; font-weight: 500;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 18px rgba(193,127,255,.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(193,127,255,.5);
}
.btn-ghost {
  background: transparent;
  color: var(--text); border: 1px solid var(--border);
  cursor: pointer; padding: .7rem 1.6rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: .9rem;
  transition: border-color .2s, color .2s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Nuotaikų statistika hero ---- */
.mood-bar {
  display: flex; justify-content: center; gap: .5rem;
  margin-top: 3rem; flex-wrap: wrap;
}
.mood-pill {
  display: flex; align-items: center; gap: .4rem;
  padding: .35rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg2);
  font-size: .8rem; cursor: pointer;
  transition: all .2s;
  color: var(--muted);
}
.mood-pill:hover, .mood-pill.active {
  border-color: var(--accent); color: var(--text);
  background: rgba(193,127,255,.08);
}
.mood-pill.active { color: var(--accent); }

/* ============================================================
   SRITIS
============================================================ */
.main { max-width: 980px; margin: 0 auto; padding: 0 1.5rem 5rem; position: relative; z-index: 1; }

/* ============================================================
   FILTRAI
============================================================ */
.filters {
  display: flex; align-items: center; gap: .5rem;
  margin-bottom: 2rem; flex-wrap: wrap;
}
.filters-label { color: var(--muted); font-size: .8rem; margin-right: .25rem; }
.filter-chip {
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--muted); cursor: pointer;
  padding: .3rem .85rem; border-radius: 999px;
  font-size: .8rem; transition: all .2s;
}
.filter-chip:hover { border-color: var(--accent); color: var(--text); }
.filter-chip.active {
  background: rgba(193,127,255,.12);
  border-color: var(--accent); color: var(--accent);
}

/* ============================================================
   KORTELĖS
============================================================ */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  cursor: pointer;
  transition: transform .22s, border-color .22s, box-shadow .22s;
  position: relative; overflow: hidden;
  animation: fadeUp .4s ease both;
}
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--mood-color, var(--accent));
  opacity: .7;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,.13);
  box-shadow: var(--shadow);
}

.card-mood {
  display: flex; align-items: center; gap: .4rem;
  font-size: .78rem; color: var(--muted);
  margin-bottom: .85rem;
}
.card-mood-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--mood-color, var(--accent)); flex-shrink: 0;
}
.card-mood-label { color: var(--mood-color, var(--accent)); font-weight: 500; }

.card-title {
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 700;
  line-height: 1.35; margin-bottom: .65rem;
  color: var(--text);
}
.card-excerpt {
  font-size: .84rem; color: var(--muted);
  line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}
.card-footer {
  display: flex; justify-content: space-between;
  align-items: center; margin-top: 1.1rem;
  font-size: .75rem; color: var(--muted);
}

/* ============================================================
   MODAL – skaitymas
============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem; opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 660px; width: 100%;
  max-height: 88vh; overflow-y: auto;
  padding: 2.4rem 2.6rem;
  position: relative;
  transform: scale(.96) translateY(12px);
  transition: transform .28s;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-close {
  position: absolute; top: 1.1rem; right: 1.2rem;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--muted); cursor: pointer;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 1rem; display: flex; align-items: center; justify-content: center;
  transition: color .2s, border-color .2s;
}
.modal-close:hover { color: var(--text); border-color: var(--accent); }

.modal-mood {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .3rem .9rem; border-radius: 999px;
  font-size: .8rem; font-weight: 500;
  border: 1px solid var(--mood-color, var(--accent));
  color: var(--mood-color, var(--accent));
  background: rgba(255,255,255,.03);
  margin-bottom: 1.2rem;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1.7rem; font-weight: 700;
  line-height: 1.25; margin-bottom: 1.2rem;
}
.modal-body {
  font-size: .95rem; color: rgba(232,230,227,.8);
  line-height: 1.85; white-space: pre-wrap;
}
.modal-meta {
  margin-top: 2rem; padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: .78rem; color: var(--muted);
  display: flex; justify-content: space-between;
}

/* ============================================================
   MODAL – rašymas
============================================================ */
.write-modal .modal {
  max-width: 620px;
}
.write-modal .modal-title {
  font-size: 1.35rem; margin-bottom: 1.5rem;
}

.form-group { margin-bottom: 1.2rem; }
.form-label {
  display: block; font-size: .8rem;
  color: var(--muted); margin-bottom: .45rem;
  font-weight: 500; letter-spacing: .04em;
  text-transform: uppercase;
}
.form-input, .form-textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: .9rem;
  padding: .7rem .95rem;
  transition: border-color .2s;
  outline: none;
  resize: vertical;
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(193,127,255,.12);
}
.form-textarea { min-height: 160px; line-height: 1.7; }

/* Nuotaikų pasirinkimas */
.mood-selector {
  display: flex; gap: .5rem; flex-wrap: wrap;
}
.mood-opt {
  flex: 1; min-width: 56px;
  background: var(--bg3);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .6rem .4rem;
  text-align: center; cursor: pointer;
  transition: all .2s;
}
.mood-opt:hover { border-color: var(--muted); }
.mood-opt.selected {
  border-color: var(--mood-color);
  background: rgba(255,255,255,.04);
  box-shadow: 0 0 0 3px rgba(255,255,255,.04);
}
.mood-opt .emoji  { font-size: 1.4rem; display: block; margin-bottom: .2rem; }
.mood-opt .mlabel { font-size: .65rem; color: var(--muted); }
.mood-opt.selected .mlabel { color: var(--mood-color); }

.char-count {
  text-align: right; font-size: .75rem;
  color: var(--muted); margin-top: .3rem;
}
.char-count.warn { color: var(--danger); }

.form-submit {
  width: 100%; padding: .8rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #0d0d0f; border: none; cursor: pointer;
  border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: .95rem; font-weight: 600;
  transition: opacity .2s, transform .15s;
  margin-top: .5rem;
}
.form-submit:hover:not(:disabled) { opacity: .88; transform: translateY(-1px); }
.form-submit:disabled { opacity: .4; cursor: not-allowed; }

.form-notice {
  font-size: .75rem; color: var(--muted);
  text-align: center; margin-top: .85rem;
  line-height: 1.6;
}
.form-notice span { color: var(--success); }

/* ============================================================
   TOAST
============================================================ */
.toast {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 999;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .85rem 1.2rem;
  font-size: .85rem; box-shadow: var(--shadow);
  transform: translateY(12px); opacity: 0;
  transition: all .3s; pointer-events: none;
  max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }

/* ============================================================
   PUSLAPIAI
============================================================ */
.pagination {
  display: flex; justify-content: center;
  gap: .4rem; margin-top: 2.5rem;
}
.page-btn {
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--muted); cursor: pointer;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  font-size: .85rem; transition: all .2s;
  display: flex; align-items: center; justify-content: center;
}
.page-btn:hover  { border-color: var(--accent); color: var(--text); }
.page-btn.active { background: var(--accent); color: #0d0d0f; border-color: var(--accent); }
.page-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ============================================================
   LOADING / EMPTY
============================================================ */
.loading-wrap {
  text-align: center; padding: 5rem 1rem;
  color: var(--muted);
}
.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  animation: spin .7s linear infinite;
  margin: 0 auto 1rem;
}
.empty-state {
  text-align: center; padding: 5rem 1rem;
  color: var(--muted);
}
.empty-state .big-emoji { font-size: 3rem; margin-bottom: 1rem; }
.empty-state p { font-size: .9rem; }

/* ============================================================
   SĖKMĖ po paskelbimo
============================================================ */
.success-box {
  text-align: center;
  padding: 1.5rem; margin-top: 1.5rem;
  background: rgba(82,217,140,.07);
  border: 1px solid rgba(82,217,140,.2);
  border-radius: var(--radius-sm);
}
.success-box .s-emoji { font-size: 2rem; display: block; margin-bottom: .5rem; }
.success-box p { font-size: .85rem; color: var(--muted); margin-top: .4rem; }
.success-token {
  font-family: monospace; font-size: .7rem;
  background: var(--bg3); padding: .3rem .6rem;
  border-radius: 4px; color: var(--muted);
  word-break: break-all; margin-top: .6rem; display: block;
}

/* ============================================================
   ANIMACIJOS
============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Nuoseklus animacijos delsos */
.card:nth-child(1) { animation-delay: .05s }
.card:nth-child(2) { animation-delay: .10s }
.card:nth-child(3) { animation-delay: .15s }
.card:nth-child(4) { animation-delay: .20s }
.card:nth-child(5) { animation-delay: .25s }
.card:nth-child(6) { animation-delay: .30s }

/* ============================================================
   FOOTER
============================================================ */
.footer {
  text-align: center; padding: 2rem 1rem;
  border-top: 1px solid var(--border);
  font-size: .78rem; color: var(--muted);
}
.footer a { color: var(--muted); text-decoration: none; transition: color .2s; }
.footer a:hover { color: var(--accent); }

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 640px) {
  .modal { padding: 1.8rem 1.4rem; }
  .hero  { padding: 3.5rem 1rem 2.5rem; }
  .posts-grid { grid-template-columns: 1fr; }
}
