/* ============================================================
   Chipter Chat — main.css (V2.1) — PC FIX + Dialogs + New Header
   Futuristic Dark UI / Glow / Landing + App
   Author: BODIRHAN
   ============================================================ */

/* ===================== RESET ===================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #070b12;
  color: #e6ebf2;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid rgba(0, 212, 255, .65); outline-offset: 2px; }

/* ===================== TOKENS ===================== */
:root{
  --bg: #070b12;
  --panel: rgba(255,255,255,.06);
  --panel2: rgba(255,255,255,.04);
  --border: rgba(255,255,255,.10);
  --border2: rgba(255,255,255,.08);

  --txt: #e6ebf2;
  --muted: rgba(230,235,242,.72);

  --c1: #00d4ff;
  --c2: #7f5cff;
  --good: #00ffd0;

  --shadow: 0 18px 55px rgba(0,0,0,.45);
  --shadow2: 0 10px 35px rgba(0,0,0,.35);

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;

  --header-h: 74px;
}

/* ===================== GLOBAL ===================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.no-copy { user-select: none; }

.muted { color: var(--muted); }

/* ===================== BACKGROUND ===================== */
.bg-image{
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background-image: var(--bg-image-url);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: .22;               /* хук під фон — не заважає тексту */
  filter: saturate(1.05) contrast(1.05);
}

.aurora {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(0,180,255,.18), transparent 42%),
    radial-gradient(circle at 80% 60%, rgba(120,0,255,.18), transparent 42%),
    radial-gradient(circle at 60% 15%, rgba(0,255,208,.09), transparent 40%);
  animation: auroraMove 12s linear infinite alternate;
  z-index: -2;
  pointer-events: none;
}

@keyframes auroraMove {
  from { filter: hue-rotate(0deg); transform: translate3d(0,0,0) scale(1); }
  to   { filter: hue-rotate(28deg); transform: translate3d(0,-6px,0) scale(1.01); }
}

.noise {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23n)' opacity='.04'/%3E%3C/svg%3E");
  z-index: -1;
  pointer-events: none;
}

/* subtle vignette */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(70% 60% at 50% 25%, rgba(255,255,255,.05), transparent 65%),
    radial-gradient(90% 80% at 50% 90%, rgba(0,0,0,.55), transparent 60%);
}

/* ===================== HEADER ===================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(10,15,25,.62);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.header-inner{
  height: var(--header-h);
  display: flex;
  align-items: center;
}

.header-grid{
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
}

.header-left{
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-right{
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}

/* brand in center */
.brand{
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 18px;
  transition: transform .18s ease, background .18s ease;
}

.brand:hover{
  background: rgba(255,255,255,.04);
  transform: translateY(-1px);
}

.brand-center{ justify-self: center; }

.logo{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg,var(--c1),var(--c2));
  box-shadow: 0 0 28px rgba(0,212,255,.22);
  overflow: hidden;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.14);
}

.logo-img img{
  width: 100%;
  height: 100%;
  object-fit: cover; /* JPEG нормально сідає */
  transform: scale(1.02);
}

.brand-title b{
  font-size: 15px;
  letter-spacing: .2px;
  line-height: 1.1;
}

.brand-title small{
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

/* ===================== BUTTON SYSTEM (chip-btn) ===================== */
.chip-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: var(--txt);
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
  box-shadow: 0 0 0 rgba(0,0,0,0);
  white-space: nowrap;
}

.chip-btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.085);
  border-color: rgba(255,255,255,.18);
  box-shadow: 0 12px 26px rgba(0,0,0,.28);
}

.chip-btn:active{ transform: translateY(0px) scale(.99); }

.chip-btn-primary{
  border: none;
  color: #05070c;
  background: linear-gradient(135deg,var(--c1),var(--c2));
  box-shadow: 0 18px 40px rgba(0,180,255,.25);
}

.chip-btn-primary:hover{
  box-shadow: 0 22px 55px rgba(0,180,255,.32);
}

.chip-btn-glass{
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(16px);
}

.chip-btn-ghost{
  background: transparent;
  border: 1px solid rgba(255,255,255,.10);
}

.chip-btn-lg{
  padding: 14px 22px;
  border-radius: 18px;
  font-size: 15px;
}

.chip-btn-mini{
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13px;
}

/* pulse hook */
.pulse{
  animation: pulseGlow .55s ease;
}
@keyframes pulseGlow{
  0%{ box-shadow: 0 0 0 rgba(0,0,0,0); }
  40%{ box-shadow: 0 0 0 6px rgba(0,212,255,.14), 0 0 28px rgba(0,212,255,.22); }
  100%{ box-shadow: 0 0 0 rgba(0,0,0,0); }
}

/* ===================== ICON / BADGE ===================== */
.icon-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  color: #fff;
  position: relative;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.icon-btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.16);
}

.badge{
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ff3b3b;
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22);
}

/* ===================== HERO ===================== */
.hero{
  padding: 84px 0 98px;
}

.hero-wrap{
  position: relative;
}

.hero-grid{
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  gap: 54px;
  align-items: center;
}

.hero-copy{
  max-width: 680px;
}

.badge-row{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.chip-badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.10);
  color: rgba(230,235,242,.86);
  font-size: 12px;
  letter-spacing: .2px;
  backdrop-filter: blur(10px);
}

.hero-title{
  font-size: 44px;
  line-height: 1.07;
  letter-spacing: -.6px;
  margin-bottom: 16px;
  text-shadow: 0 0 22px rgba(0,180,255,.12);
}

.hero-lead{
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 26px;
  max-width: 560px;
}

.hero-actions{
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.hero-micro{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  color: rgba(230,235,242,.68);
  font-size: 13px;
}

.dot{
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.dot-green{
  background: rgba(0,255,208,.95);
  box-shadow: 0 0 18px rgba(0,255,208,.22);
}

/* ===================== GLASS CARD / DEMO ===================== */
.glass-card{
  border-radius: 26px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.glass-card::before{
  content:"";
  position: absolute;
  inset: -2px;
  background:
    radial-gradient(80% 60% at 20% 10%, rgba(0,212,255,.18), transparent 55%),
    radial-gradient(70% 60% at 80% 70%, rgba(127,92,255,.18), transparent 55%);
  opacity: .55;
  pointer-events: none;
}

.glass-top{
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  padding: 18px 18px 12px;
  flex-wrap: wrap;
}

.pill{
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.10);
  font-size: 12px;
  color: rgba(230,235,242,.86);
}

.pill.good{
  background: rgba(0,255,180,.18);
  border-color: rgba(0,255,208,.28);
  color: var(--good);
}

.demo-body{
  position: relative;
  z-index: 1;
  padding: 16px 18px 18px;
}

.demo-line{
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(230,235,242,.70);
  margin-bottom: 10px;
}

.demo-user{
  font-weight: 700;
  color: rgba(230,235,242,.92);
}

.demo-text{
  color: rgba(230,235,242,.78);
  line-height: 1.6;
  margin-bottom: 14px;
}

.demo-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.demo-footer{
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
  color: rgba(230,235,242,.64);
  font-size: 12px;
}

.spark{
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(135deg,var(--c1),var(--c2));
  box-shadow: 0 0 18px rgba(0,212,255,.25);
  display: inline-block;
}

/* ===================== SECTIONS ===================== */
.section{
  padding: 56px 0 64px;
}

.section-head{
  margin-bottom: 22px;
}

.section-head h2{
  font-size: 24px;
  letter-spacing: -.2px;
  margin-bottom: 8px;
}

.section-head p{
  color: rgba(230,235,242,.68);
  line-height: 1.6;
}

.feature-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-card{
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 22px;
  padding: 18px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow2);
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.feature-card:hover{
  transform: translateY(-2px);
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.14);
}

.feature-card h3{
  font-size: 16px;
  margin-bottom: 8px;
}

.feature-card p{
  color: rgba(230,235,242,.70);
  line-height: 1.55;
}

/* ===================== FOOTER ===================== */
.footer{
  border-top: 1px solid rgba(255,255,255,.06);
  background: rgba(10,15,25,.35);
  backdrop-filter: blur(10px);
}

.footer-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 0;
}

.footer-left small{
  display: block;
  color: rgba(230,235,242,.62);
  margin-top: 4px;
}

.footer-right{
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* ===================== DIALOGS ===================== */
.chip-dialog{
  width: min(620px, calc(100% - 32px));
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 22px;
  background: rgba(10,15,25,.78);
  color: var(--txt);
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  backdrop-filter: blur(18px);
  padding: 0;
}

.chip-dialog::backdrop{
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
}

.dialog-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.dialog-head b{
  font-size: 14px;
  letter-spacing: .2px;
}

.dialog-body{
  padding: 14px 16px 16px;
}

.dialog-body p{ line-height: 1.6; margin-bottom: 10px; }
.dialog-body ul{ padding-left: 18px; }
.dialog-body li{ margin: 8px 0; color: rgba(230,235,242,.78); }

.dialog-actions{
  padding: 12px 16px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ===================== APP MODE ===================== */
.app-layout{
  display: grid;
  grid-template-columns: 230px 1fr 300px;
  gap: 18px;
  padding: 22px;
  max-width: 1400px;
  margin: 0 auto;
}

.sidebar{
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 22px;
  padding: 16px;
  height: calc(100vh - (var(--header-h) + 44px));
  position: sticky;
  top: calc(var(--header-h) + 18px);
  overflow: hidden;
}

.sidebar nav a{
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  opacity: .78;
  transition: background .16s ease, opacity .16s ease, transform .16s ease;
}

.sidebar nav a:hover{
  background: rgba(255,255,255,.08);
  opacity: 1;
  transform: translateX(2px);
}

.sidebar nav a.active{
  background: linear-gradient(135deg, rgba(0,212,255,.22), rgba(127,92,255,.18));
  border: 1px solid rgba(255,255,255,.10);
  opacity: 1;
}

.feed-top{
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.global-search{
  flex: 1;
}

.global-search input{
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  color: #fff;
  outline: none;
}

.global-search input::placeholder{
  color: rgba(230,235,242,.45);
}

.avatar-btn img{
  width: 44px;
  height: 44px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  object-fit: cover;
  transition: transform .16s ease;
}
.avatar-btn:hover img{ transform: translateY(-1px); }

.feed-tabs{
  display: flex;
  gap: 10px;
  margin: 10px 0 16px;
}

.feed-tabs button{
  padding: 10px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  color: #fff;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.feed-tabs button:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.085);
  border-color: rgba(255,255,255,.16);
}

.feed-tabs .active{
  background: linear-gradient(135deg,var(--c1),var(--c2));
  border: none;
  color: #05070c;
}

.post-card{
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 22px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow2);
}

.post-card header{
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.post-card header img{
  width: 42px;
  height: 42px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.12);
}

.post-card header span{
  display: block;
  color: rgba(230,235,242,.6);
  font-size: 12px;
  margin-top: 3px;
}

.post-card p{
  line-height: 1.6;
  color: rgba(230,235,242,.86);
  margin: 10px 0 12px;
}

.post-media{
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
}

.post-media img{
  width: 100%;
  height: auto;
  display: block;
}

.post-card footer{
  margin-top: 12px;
  color: rgba(230,235,242,.68);
  font-size: 13px;
}

.widgets .widget{
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 22px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow2);
}

.widgets h4{
  margin-bottom: 10px;
  font-size: 13px;
  letter-spacing: .2px;
  color: rgba(230,235,242,.88);
}

.widgets ul{ list-style: none; }
.widgets li{
  padding: 10px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  margin-bottom: 10px;
  color: rgba(230,235,242,.76);
}

.voice-room, .friend{
  padding: 10px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  margin-bottom: 10px;
  color: rgba(230,235,242,.78);
}

/* ===================== FAB ===================== */
.fab{
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg,var(--c1),var(--c2));
  border: none;
  color: #05070c;
  font-size: 34px;
  cursor: pointer;
  box-shadow: 0 0 40px rgba(0,180,255,.6);
  transition: transform .16s ease, box-shadow .16s ease;
  z-index: 50;
}
.fab:hover{
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 0 55px rgba(0,180,255,.72);
}

/* ===================== REVEAL ===================== */
.reveal{
  opacity: 0;
  transform: translateY(18px);
  transition: .65s ease;
  will-change: transform, opacity;
}
.reveal.show{
  opacity: 1;
  transform: none;
}

/* ============================================================
   RESPONSIVE — TABLET
   ============================================================ */
@media (max-width: 1024px){
  :root{ --header-h: 68px; }

  .container{ padding: 0 18px; }

  .hero-grid{
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .hero-title{
    font-size: 36px;
  }

  .feature-grid{
    grid-template-columns: 1fr;
  }

  .app-layout{
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .sidebar, .widgets{
    display: none;
  }

  .header-grid{
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
  }

  .brand-title small{
    display: none;
  }
}

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 768px){
  :root{ --header-h: 62px; }

  .header-grid{
    grid-template-columns: auto 1fr auto;
    gap: 8px;
  }

  .header-left .chip-btn{
    padding: 9px 10px;
    border-radius: 14px;
    font-size: 13px;
  }

  .header-right .chip-btn{
    padding: 9px 10px;
    border-radius: 14px;
    font-size: 13px;
  }

  /* на мобілі ліві кнопки не розтягуємо */
  .header-left{
    gap: 8px;
  }

  .brand{
    padding: 6px 8px;
    border-radius: 16px;
    justify-content: center;
  }

  .logo{
    width: 38px;
    height: 38px;
    border-radius: 14px;
  }

  .brand-title b{
    font-size: 14px;
  }
  .brand-title small{
    display: none;
  }

  .hero{
    padding: 58px 0 70px;
  }

  .hero-title{
    font-size: 30px;
    line-height: 1.12;
  }

  .hero-actions{
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .chip-btn-lg{
    width: 100%;
  }

  .footer-inner{
    flex-direction: column;
    align-items: flex-start;
  }

  .fab{
    bottom: 18px;
    width: 56px;
    height: 56px;
    font-size: 28px;
  }
}

/* ===================== SMALL DEVICES ===================== */
@media (max-width: 380px){
  .hero-title{ font-size: 26px; }
  .hero-lead{ font-size: 14px; }
}
