/* ============================================================
   viloa web — deep-glass (self-contained)
   ------------------------------------------------------------
   The deep-glass theme rendered as plain CSS so the SSR skeleton
   looks right with no build step. The canonical token source is
   ../../themes/deep-glass.css (Tailwind v4); see assets/tailwind.css.
   When the Tailwind CLI / dx pipeline is wired, this file is
   replaced by the compiled Tailwind output.
   ============================================================ */
:root {
  --canvas:        oklch(0.17 0.025 264);
  --surface:       oklch(0.23 0.030 264 / 0.55);
  --elevated:      oklch(0.28 0.032 264 / 0.65);
  --border:        oklch(0.85 0.020 264 / 0.12);
  --ink:           oklch(0.96 0.010 250);
  --muted:         oklch(0.74 0.020 255);
  --primary:       oklch(0.78 0.125 215);
  --primary-hover: oklch(0.84 0.135 215);
  --on-primary:    oklch(0.16 0.030 250);
  --accent:        oklch(0.70 0.150 295);
  --radius-md: 0.875rem;
  --radius-lg: 1.25rem;
  --blur-glass: 18px;
  --shadow-glass: 0 8px 32px oklch(0.10 0.040 264 / 0.55);
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
}

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

body {
  min-height: 100vh;
  background:
    radial-gradient(80rem 80rem at 15% -10%, oklch(0.32 0.10 260 / 0.35), transparent 60%),
    radial-gradient(60rem 60rem at 100% 0%, oklch(0.30 0.12 300 / 0.30), transparent 55%),
    var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* Frosted panel — the signature surface. */
.glass {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
  -webkit-backdrop-filter: blur(var(--blur-glass)) saturate(140%);
  backdrop-filter: blur(var(--blur-glass)) saturate(140%);
}

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 0.3rem; }
.muted { color: var(--muted); }
.link { color: var(--primary); font-weight: 600; text-decoration: underline; }
.link:hover { color: var(--primary-hover); }
.link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---- Nav ---- */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 20px; margin: 12px;
  border-radius: var(--radius-md);
}
.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 1.4rem; font-weight: 800; letter-spacing: 0.04em; }
.brand-engine { font-size: 0.72rem; color: var(--muted); }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-link { padding: 8px 12px; border-radius: 0.6rem; color: var(--muted); font-weight: 600; }
.nav-link:hover { color: var(--ink); }
.nav-cta { color: var(--on-primary); background: var(--primary); }
.nav-cta:hover { background: var(--primary-hover); color: var(--on-primary); }

/* ---- Page layout ---- */
.page { max-width: 720px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.page-narrow { max-width: 420px; }
.page-title { font-size: 1.1rem; font-weight: 700; }

/* ---- Hero ---- */
.hero { padding: 40px 28px; display: flex; flex-direction: column; gap: 12px; text-align: center; align-items: center; }
.hero-title { font-size: 3rem; font-weight: 800; letter-spacing: 0.02em; }
.hero-tagline { font-size: 1.1rem; }
.hero-actions { display: flex; gap: 12px; margin-top: 10px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 18px; border-radius: 0.7rem; border: 1px solid var(--border);
  background: var(--elevated); color: var(--ink); font-weight: 600; cursor: pointer;
  min-height: 44px; min-width: 44px; font-size: 1rem;
  transition: all 0.2s ease;
}
.btn:hover { border-color: var(--primary); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-primary { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.btn-primary:hover { background: var(--primary-hover); }

/* ---- Feed ---- */
.feed-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.feed { display: flex; flex-direction: column; gap: 16px; }
.post { overflow: hidden; }
.post-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; }
.post-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--elevated); flex-shrink: 0; }
.post-meta { display: flex; flex-direction: column; }
.post-author { font-weight: 600; font-size: 0.92rem; }
.post-time { font-size: 0.74rem; color: var(--muted); }
.post-image { display: block; width: 100%; aspect-ratio: 1/1; object-fit: cover; background: var(--elevated); }
.post-caption { padding: 12px 16px 16px; line-height: 1.5; }
.post-actions { display: flex; gap: 8px; padding: 0 16px 16px; align-items: center; }
.inline { display: inline; }
.btn-sm {
  padding: 7px 12px; border-radius: 0.6rem; border: 1px solid var(--border);
  background: var(--elevated); color: var(--ink); font-weight: 600; cursor: pointer; font-size: 0.85rem;
}
.btn-sm:hover { border-color: var(--primary); }
.btn-sm.ghost { background: transparent; color: var(--muted); }

/* ---- Forms ---- */
.form-card { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 0.8rem; color: var(--muted); }
.input { padding: 12px 14px; border-radius: 0.7rem; border: 1px solid var(--border); background: var(--elevated); color: var(--ink); font-size: 1rem; }
.input:focus { outline: none; border-color: var(--primary); }
.form-foot { text-align: center; font-size: 0.85rem; }

/* ---- Profile ---- */
.profile-head { display: flex; gap: 18px; padding: 24px; align-items: center; }
.profile-avatar { width: 84px; height: 84px; border-radius: 50%; background: var(--elevated); flex-shrink: 0; }
.avatar-img { object-fit: cover; }
.badge { color: var(--primary); }
.profile-meta { display: flex; flex-direction: column; gap: 4px; }
.profile-name { font-size: 1.4rem; font-weight: 700; }
.profile-bio { margin-top: 6px; }
.empty { padding: 24px 0; text-align: center; }

/* ---- Comments ---- */
.comments-section { display: flex; flex-direction: column; gap: 16px; }
.comments-section h3 { font-size: 1rem; font-weight: 700; }
.comment-form { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.textarea { padding: 12px 14px; border-radius: 0.7rem; border: 1px solid var(--border); background: var(--elevated); color: var(--ink); font-size: 1rem; font-family: var(--font-sans); resize: vertical; }
.textarea:focus { outline: none; border-color: var(--primary); }
.comments-list { display: flex; flex-direction: column; gap: 12px; }
.comment { padding: 12px 16px; }
.comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.comment-author { font-weight: 600; font-size: 0.92rem; }
.comment-time { font-size: 0.74rem; color: var(--muted); }
.comment-body { line-height: 1.5; font-size: 0.95rem; }

/* ---- a11y & focus states ---- */
input, select, textarea { min-height: 44px; font-size: 1rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}
button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-sm { min-height: 40px; }
.btn-sm:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

/* ---- Mobile responsive ---- */
@media (max-width: 640px) {
  .page { padding: 12px; gap: 12px; }
  .page-narrow { max-width: 100%; }
  .hero { padding: 24px 16px; }
  .hero-title { font-size: 2rem; }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn { width: 100%; }
  .nav { margin: 8px; gap: 8px; padding: 8px 12px; }
  .brand-name { font-size: 1.1rem; }
  .nav-links { gap: 4px; flex-wrap: wrap; }
  .nav-link { padding: 6px 10px; font-size: 0.9rem; }
  .feed-head { flex-direction: column; gap: 8px; }
  .feed-head .btn { width: 100%; }
  .post { border-radius: 0.6rem; }
  .post-head { padding: 10px 12px; gap: 8px; }
  .post-avatar { width: 36px; height: 36px; }
  .post-caption { padding: 8px 12px 12px; font-size: 0.95rem; }
  .form-card { padding: 16px; }
  .input { padding: 10px 12px; font-size: 1rem; }
  .profile-head { flex-direction: column; gap: 12px; padding: 16px; }
  .profile-avatar { width: 72px; height: 72px; }
  .profile-name { font-size: 1.2rem; }
}

@media (max-width: 480px) {
  .page { padding: 8px; gap: 8px; }
  .nav { margin: 4px; gap: 4px; padding: 4px 8px; }
  .brand-name { font-size: 1rem; }
  .brand-engine { font-size: 0.64rem; }
  .hero-title { font-size: 1.75rem; }
  .page-title { font-size: 1rem; }
  .btn { padding: 10px 14px; font-size: 0.95rem; }
  .btn-sm { padding: 6px 10px; font-size: 0.8rem; }
  .post-caption { font-size: 0.9rem; }
  .form-card { padding: 12px; }
}

/* ============================================================
   viloa web — Chat / Direct Messages Styles (Deep-Glass Alignment)
   ============================================================ */
.conversations-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.conversation-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
}

.conversation-item:hover {
  background-color: var(--elevated);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.conversation-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--elevated);
  flex-shrink: 0;
}

.conversation-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.conversation-partner {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-last-msg {
  font-size: 0.88rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.conversation-time {
  font-size: 0.74rem;
  color: var(--muted);
}

.badge-unread {
  background: var(--primary);
  color: var(--on-primary);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  min-width: 20px;
  text-align: center;
}

/* Chat container */
.chat-container-outer {
  height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.btn-back {
  padding: 8px 12px;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  background: var(--elevated);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}

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

.btn-back:hover {
  border-color: var(--primary);
  color: var(--ink);
}

.chat-partner-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--elevated);
  flex-shrink: 0;
}

.chat-partner-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-partner-name {
  font-size: 0.96rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Chat messages area */
.chat-messages-box {
  flex-grow: 1;
  padding: 20px;
  border-radius: var(--radius-lg);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.message-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: fadeInBubble 0.2s ease forwards;
}

.message-bubble.ours {
  align-self: flex-end;
  background-color: var(--primary);
  color: var(--on-primary);
  border-bottom-right-radius: 2px;
}

.message-bubble.theirs {
  align-self: flex-start;
  background-color: var(--elevated);
  color: var(--ink);
  border-bottom-left-radius: 2px;
  border: 1px solid var(--border);
}

.message-text {
  font-size: 0.95rem;
  line-height: 1.4;
  word-break: break-word;
}

.message-time {
  font-size: 0.68rem;
  align-self: flex-end;
  opacity: 0.75;
}

/* Message composer form */
.chat-compose {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.chat-input-field {
  flex-grow: 1;
}

.chat-send-btn {
  flex-shrink: 0;
  min-width: 90px;
}

@keyframes fadeInBubble {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  .chat-container-outer {
    height: calc(100vh - 100px);
  }
  .message-bubble {
    max-width: 85%;
  }
}
