/* ============================================================
   ZYNOCHAT — styles.css
   Design System: "Obsidian Cosmos" - Enhanced Premium Edition
   ============================================================ */

/* ── Fonts ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=DM+Sans:wght@300;400;500;600&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
  --bg-0:          #050505; /* Deep Obsidian */
  --bg-1:          #0a0a0a;
  --bg-2:          #111111;
  --bg-card:       rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);

  --accent-v:      #ffffff;
  --accent-c:      #cccccc;
  --accent-v-dim:  rgba(255, 255, 255, 0.1);
  --accent-c-dim:  rgba(255, 255, 255, 0.05);
  --glow-v:        rgba(255, 255, 255, 0.15);
  --glow-c:        rgba(255, 255, 255, 0.05);

  --text-1:        #ffffff;
  --text-2:        #b3b3b3;
  --text-3:        #777777;

  --border-1:      rgba(255, 255, 255, 0.08);
  --border-2:      rgba(255, 255, 255, 0.15);

  --grad-brand:    linear-gradient(135deg, #ffffff 0%, #333333 100%);
  --grad-text:     linear-gradient(135deg, #ffffff 0%, #888888 100%);
  --grad-card:     linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);

  --radius-s:      8px;
  --radius-m:      14px;
  --radius-l:      22px;
  --radius-xl:     32px;

  --shadow-sm:     0 2px 10px rgba(0,0,0,0.5);
  --shadow-md:     0 8px 30px rgba(0,0,0,0.8);

  --ease:          cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast:        0.2s var(--ease);
  --t-med:         0.4s  var(--ease);
  --t-slow:        0.6s  var(--ease);

  --font-head:     'Syne', sans-serif;
  --font-body:     'DM Sans', sans-serif;
  --font-mono:     'Space Grotesk', sans-serif;

  --nav-h:         72px;
  --bottom-nav-h:  72px;
  --container:     1200px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-1);
  background-color: var(--bg-0);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }
ul { list-style: none; }

/* ── Custom Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-v); }

/* ── Global Layout Components ───────────────────────────────── */

/* App Header */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-h);
  background: rgba(5, 5, 5, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-1);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
}

.app-logo-text {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon-main, .logo-icon {
    width: 32px;
    height: 32px;
    background: var(--text-1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon-main svg, .logo-icon svg {
    width: 20px;
    height: 20px;
    fill: var(--bg-0);
}

.profile-box {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-1);
  border-radius: 12px;
  background: var(--bg-card);
  transition: all var(--t-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--text-1);
  font-weight: 700;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 480px;
  height: var(--bottom-nav-h);
  background: rgba(15, 15, 15, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-xl);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  transition: all var(--t-fast);
  padding: 8px 16px;
  border-radius: 16px;
}

.nav-item svg { width: 24px; height: 24px; stroke-width: 2; }

.nav-item.active {
  color: var(--accent-v);
  background: var(--accent-v-dim);
}

/* ── Container ──────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Section Styles ─────────────────────────────────────────── */
.section { padding: 120px 0; }
.section-sm { padding: 80px 0; }

.center { text-align: center; }

.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-head);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-1);
  margin-bottom: 24px;
  letter-spacing: -0.03em;
}

.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-sub {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-2);
  max-width: 640px;
  margin: 0 auto;
}

/* ── UI Components ─────────────────────────────────────────── */

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-l);
  padding: 40px;
  transition: all var(--t-med);
  position: relative;
  overflow: hidden;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-2);
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 36px;
  border-radius: var(--radius-m);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all var(--t-med);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary { background: var(--accent-v); color: var(--bg-0); }
.btn-primary:hover { background: #ffffff; transform: translateY(-2px); box-shadow: 0 10px 20px rgba(255,255,255,0.1); }
.btn-ghost { background: transparent; color: var(--text-1); border: 1px solid var(--border-2); }
.btn-ghost:hover { background: var(--accent-v-dim); border-color: var(--accent-v); }

/* FAQ */
.faq-list { max-width: 800px; margin: 64px auto 0; }
.faq-item { background: var(--bg-card); border: 1px solid var(--border-1); border-radius: var(--radius-m); margin-bottom: 12px; }
.faq-q { width: 100%; padding: 24px; background: none; border: none; color: var(--text-1); font-weight: 700; font-size: 17px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; text-align: left; }
.faq-chevron { transition: transform var(--t-med); }
.faq-a { max-height: 0; overflow: hidden; transition: all var(--t-med); color: var(--text-2); font-size: 15px; }
.faq-item.open .faq-a { max-height: 500px; padding: 0 24px 24px; }
.faq-item.open .faq-chevron { transform: rotate(180deg); }

/* ── Chat Page Styles ──────────────────────────────────────── */
.chat-container {
  display: flex;
  height: calc(100vh - var(--nav-h));
  margin-top: var(--nav-h);
}

.chat-sidebar {
  width: 320px;
  background: var(--bg-1);
  border-right: 1px solid var(--border-1);
  display: flex;
  flex-direction: column;
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-0);
  position: relative;
  overflow: hidden;
}

.chat-header {
  height: 72px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-messages {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 100px; /* Space for input */
}

.message {
  max-width: 75%;
  padding: 12px 18px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.5;
}

.message.sent { align-self: flex-end; background: var(--accent-v); color: var(--bg-0); border-bottom-right-radius: 4px; }
.message.received { align-self: flex-start; background: var(--bg-card); color: var(--text-1); border-bottom-left-radius: 4px; border: 1px solid var(--border-1); }

.chat-input-area {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 24px;
  background: linear-gradient(to top, var(--bg-0) 80%, transparent);
}

.input-form {
  display: flex;
  gap: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: 30px;
  padding: 8px 12px 8px 24px;
  align-items: center;
}

.message-input { flex: 1; background: none; border: none; color: var(--text-1); font-size: 15px; outline: none; }

.btn-send {
  width: 44px; height: 44px; border-radius: 50%; background: var(--accent-v); color: var(--bg-0); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform 0.2s;
}

.btn-send:hover { transform: scale(1.05); }

/* ── Login/Auth Styles ─────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-l);
    padding: 48px 32px;
    text-align: center;
}

.auth-input {
    width: 100%;
    background: var(--bg-2);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-s);
    padding: 14px 18px;
    color: var(--text-1);
    margin-bottom: 16px;
    outline: none;
}

.auth-input:focus { border-color: var(--accent-v); }

/* ── Animations ────────────────────────────────────────────── */
.fade-up { opacity: 0; transform: translateY(30px); transition: all 0.8s var(--ease); }
.fade-up.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }

/* ── Footer ───────────────────────────────────────────────── */
.footer { background: var(--bg-1); border-top: 1px solid var(--border-1); padding: 80px 0 140px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 64px; }
.footer-links a { display: block; color: var(--text-2); font-size: 14px; margin-bottom: 12px; transition: color var(--t-fast); }
.footer-bottom { margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--border-1); display: flex; justify-content: space-between; align-items: center; color: var(--text-3); font-size: 13px; }

@media (max-width: 768px) {
  .chat-sidebar { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 40px; }
}
