/* Kinzzz - styles principaux */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,400;0,500;0,700;1,400;1,500&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg: #faf6ef;
  --bg-warm: #f4ede4;
  --bg-card: #ffffff;
  --ink: #2a1810;
  --ink-soft: #5a3a28;
  --ink-mute: #8a6e5a;
  --terracotta: #c44536;
  --terracotta-deep: #9d3527;
  --terracotta-soft: #e07856;
  --terracotta-tint: rgba(196, 69, 54, 0.08);
  --line: rgba(42, 24, 16, 0.15);
  --line-soft: rgba(42, 24, 16, 0.08);
  --green: #5d8a66;
  --warning: #c4914a;
  --danger: #c44536;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-feature-settings: 'ss01', 'ss02';
  font-weight: 400;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, .title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.serif, .quote {
  font-family: 'Fraunces', serif;
  font-style: italic;
}

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }

.app {
  max-width: 1400px;
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  background: var(--bg);
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 70px;
  }
}

.sidebar {
  background: var(--bg-warm);
  border-right: 1px solid var(--line-soft);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

@media (max-width: 900px) {
  .sidebar {
    grid-row: 2;
    height: auto;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid var(--line);
    padding: 8px;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 100;
    background: var(--bg-warm);
    justify-content: space-around;
    align-items: center;
  }
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 32px;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 24px;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.sidebar-logo-mark {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--terracotta), var(--terracotta-deep));
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 16px;
  font-style: normal;
  letter-spacing: -0.5px;
}

@media (max-width: 900px) { .sidebar-logo { display: none; } }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 4px;
  border-radius: 10px;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 15px;
  transition: all 0.15s ease;
  position: relative;
}

.nav-item:hover { background: rgba(42, 24, 16, 0.04); color: var(--ink); }
.nav-item.active { background: var(--bg); color: var(--terracotta-deep); font-weight: 600; }

.nav-item .icon { font-size: 20px; display: flex; align-items: center; }
.nav-item .badge {
  background: var(--terracotta);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: auto;
}

@media (max-width: 900px) {
  .nav-item {
    flex-direction: column;
    gap: 2px;
    padding: 6px 12px;
    font-size: 10px;
    border-radius: 8px;
  }
  .nav-item .label { font-size: 10px; }
  .nav-item .icon { font-size: 22px; }
  .nav-item .badge { position: absolute; top: 0; right: 4px; margin: 0; font-size: 9px; padding: 1px 5px; }
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--ink-mute);
}

@media (max-width: 900px) { .sidebar-footer { display: none; } }

.main { padding: 32px; overflow-x: hidden; }

@media (max-width: 900px) {
  .main { padding: 16px; padding-bottom: 90px; }
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.page-header .subtitle {
  color: var(--ink-mute);
  font-size: 14px;
  margin-top: 4px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 16px;
  transition: border-color 0.15s, transform 0.15s;
}

.card:hover { border-color: var(--line); }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.profile-card:hover {
  transform: translateY(-2px);
  border-color: var(--line);
  box-shadow: 0 6px 20px rgba(42, 24, 16, 0.06);
}

.profile-photo {
  width: 100%;
  aspect-ratio: 1;
  background-size: cover;
  background-position: center;
  position: relative;
}

.profile-card-info { padding: 16px; }

.profile-name-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.profile-name { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.profile-age { color: var(--ink-mute); font-size: 14px; }

.profile-pronouns-row {
  font-size: 12px;
  color: var(--ink-mute);
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
}

.profile-bio {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.match-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--bg-card);
  color: var(--terracotta-deep);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 100px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.match-badge.high { color: var(--green); }
.match-badge.medium { color: var(--terracotta-deep); }

.maybe-indicator {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--terracotta);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.profile-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-width: 500px;
  margin: 0 auto 24px;
  border-radius: 20px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.profile-detail { max-width: 700px; margin: 0 auto; }

.profile-detail-name {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.profile-detail-meta {
  color: var(--ink-mute);
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 16px;
}

.profile-section { margin-bottom: 24px; }

.profile-section h3 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  margin-bottom: 12px;
}

.profile-bio-full {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
}

.values-list { display: flex; flex-direction: column; gap: 14px; }
.value-item { display: flex; flex-direction: column; gap: 6px; }

.value-label {
  font-size: 14px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.value-bar {
  height: 6px;
  background: var(--line-soft);
  border-radius: 3px;
  overflow: hidden;
}

.value-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--terracotta-soft), var(--terracotta));
  border-radius: 3px;
  transition: width 0.6s ease;
}

.value-pos { font-size: 12px; color: var(--ink-mute); }

.prefs-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.pref-item {
  background: var(--bg-warm);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
}

.pref-item .pref-label {
  font-size: 11px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.pref-item .pref-value { font-weight: 600; color: var(--ink); }

.actions-row { display: flex; gap: 12px; margin: 24px 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.01em;
}

.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--terracotta-deep); }
.btn-secondary { background: var(--bg-warm); color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover { background: var(--line-soft); }
.btn-warm { background: var(--terracotta); color: white; }
.btn-warm:hover { background: var(--terracotta-deep); }
.btn-large { padding: 16px 24px; font-size: 16px; }
.btn-block { width: 100%; }

.conv-list { display: flex; flex-direction: column; gap: 4px; }

.conv-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  transition: background 0.15s;
  cursor: pointer;
}

.conv-item:hover { background: var(--bg-warm); }

.conv-photo {
  width: 56px; height: 56px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.conv-info { flex: 1; min-width: 0; }
.conv-name { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.conv-preview { color: var(--ink-mute); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 11px; color: var(--ink-mute); white-space: nowrap; }

.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px);
  max-height: calc(100vh - 64px);
}

@media (max-width: 900px) {
  .chat-container {
    height: calc(100vh - 90px - 32px);
    max-height: calc(100vh - 90px - 32px);
  }
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.chat-header-photo {
  width: 44px; height: 44px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
}

.chat-header-info { flex: 1; min-width: 200px; }
.chat-header-name { font-weight: 600; font-size: 15px; }
.chat-header-meta { font-size: 12px; color: var(--ink-mute); }

.chat-toggles { display: flex; gap: 8px; flex-wrap: wrap; }

.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-warm);
  border: 1px solid var(--line-soft);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s;
}

.toggle-pill.active {
  background: var(--terracotta-tint);
  border-color: var(--terracotta);
  color: var(--terracotta-deep);
}

.toggle-pill.disabled { opacity: 0.4; cursor: not-allowed; }

.toggle-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--line);
  position: relative;
  transition: background 0.15s;
}

.toggle-pill.active .toggle-icon { background: var(--terracotta); }
.toggle-pill.active .toggle-icon::after {
  content: '✓';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 10px;
  font-weight: bold;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  margin-bottom: 12px;
}

.message {
  max-width: 75%;
  display: flex;
  flex-direction: column;
}

.message.sent { align-self: flex-end; align-items: flex-end; }
.message.received { align-self: flex-start; align-items: flex-start; }

.message-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.message.sent .message-bubble {
  background: var(--ink);
  color: var(--bg);
  border-bottom-right-radius: 4px;
}

.message.received .message-bubble {
  background: var(--bg-warm);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}

.message.blocked .message-bubble {
  background: var(--terracotta-tint);
  color: var(--terracotta-deep);
  border: 1px dashed var(--terracotta);
  font-style: italic;
}

.message-time { font-size: 11px; color: var(--ink-mute); margin-top: 4px; padding: 0 4px; }
.message-image { max-width: 280px; border-radius: 12px; margin-bottom: 4px; }

.chat-input-area {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 12px;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 10px 14px;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
  line-height: 1.5;
}

.chat-input:focus { border-color: var(--terracotta); }

.chat-input-actions { display: flex; gap: 4px; }

.icon-btn {
  width: 40px; height: 40px;
  border: none;
  border-radius: 10px;
  background: var(--bg-warm);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.15s;
}

.icon-btn:hover { background: var(--line-soft); color: var(--ink); }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.icon-btn.primary { background: var(--ink); color: var(--bg); }
.icon-btn.primary:hover { background: var(--terracotta-deep); }
.icon-btn.primary:disabled { background: var(--line); color: var(--ink-mute); }

.notif-toast {
  position: fixed;
  top: 20px; right: 20px;
  background: var(--ink);
  color: var(--bg);
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1000;
  max-width: 380px;
  animation: slideIn 0.3s ease-out;
  cursor: pointer;
}

.notif-toast.warning { background: var(--warning); color: var(--ink); }
.notif-toast.danger { background: var(--terracotta); color: white; }

@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(20px); opacity: 0; }
}

.notif-toast.hiding { animation: slideOut 0.3s ease-out forwards; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-mute);
}

.empty-state h3 {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 24px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.kinzzz-app-link {
  display: inline-block;
  padding: 8px 16px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 100px;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
}

.kinzzz-app-link:hover { background: var(--terracotta-deep); }
