@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #070b14;
  --panel: #101827;
  --panel2: #151f30;
  --blue: #168bff;
  --blue2: #46b5ff;
  --text: #f1f6ff;
  --muted: #8b9bb3;
  --border: rgba(255,255,255,.08);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Vazirmatn', sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse at 10% 5%, rgba(0,105,255,.17), transparent 38%),
    radial-gradient(ellipse at 90% 90%, rgba(0,160,255,.09), transparent 40%),
    var(--bg);
}

button, input {
  font-family: inherit;
}

button {
  cursor: pointer;
  border: 0;
  transition: .25s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.12);
}

.app {
  max-width: 1200px;
  min-height: 100vh;
  margin: auto;
  padding: 24px;
}

.header {
  padding: 20px 0 28px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #087cff, #36b7ff);
  box-shadow: 0 0 30px rgba(20,130,255,.28);
  font-size: 28px;
  font-weight: 800;
  color: white;
}

.brand h1 {
  margin: 0;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -.5px;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-section {
  max-width: 460px;
  margin: 55px auto;
}

.welcome {
  text-align: center;
  margin-bottom: 28px;
}

.welcome h2 {
  font-size: 27px;
  margin-bottom: 10px;
}

.welcome p {
  color: var(--muted);
  font-size: 14px;
}

.auth-card {
  background: rgba(16,24,39,.86);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 28px;
  backdrop-filter: blur(20px);
  box-shadow: 0 25px 80px rgba(0,0,0,.35);
}

.auth-tabs {
  display: flex;
  gap: 8px;
  background: #080e19;
  padding: 5px;
  border-radius: 14px;
  margin-bottom: 24px;
}

.auth-tabs button {
  flex: 1;
  padding: 12px;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  font-weight: 600;
}

.auth-tabs button.active {
  background: linear-gradient(135deg, #087cff, #199fff);
  color: white;
  box-shadow: 0 5px 20px rgba(0,120,255,.25);
}

label {
  display: block;
  margin: 14px 0 8px;
  color: #cbd8e9;
  font-size: 13px;
}

input {
  width: 100%;
  padding: 14px 15px;
  border-radius: 13px;
  background: #080f1b;
  border: 1px solid rgba(255,255,255,.09);
  outline: none;
  color: white;
  font-size: 14px;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(22,139,255,.12);
}

input::placeholder {
  color: #65758b;
}

.primary {
  width: 100%;
  margin-top: 22px;
  padding: 14px;
  color: white;
  font-size: 15px;
  font-weight: 700;
  border-radius: 13px;
  background: linear-gradient(135deg, #087cff, #29aaff);
  box-shadow: 0 8px 25px rgba(0,120,255,.2);
}

.message {
  text-align: center;
  font-size: 13px;
  color: var(--blue2);
  margin-top: 12px;
}

.chat-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: min(720px, calc(100vh - 170px));
  min-height: 500px;
  margin-top: 25px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(13,20,32,.92);
  box-shadow: 0 25px 70px rgba(0,0,0,.3);
}

.sidebar {
  padding: 20px;
  background: rgba(16,24,39,.95);
  border-left: 1px solid var(--border);
  overflow-y: auto;
}

.user-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}

#current-user {
  font-weight: 700;
  color: #dcecff;
  overflow-wrap: anywhere;
}

#logout-btn {
  padding: 8px 12px;
  border-radius: 10px;
  background: #1b293b;
  color: #b6c8df;
}

.sidebar h3 {
  font-size: 14px;
  margin: 22px 0 12px;
}

.search-box {
  display: flex;
  gap: 8px;
}

.search-box input {
  min-width: 0;
}

.search-box button {
  padding: 0 13px;
  border-radius: 12px;
  background: var(--blue);
  color: white;
}

#search-results,
#conversation-list {
  margin-top: 12px;
}

.conversation {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-header {
  min-height: 72px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: rgba(17,26,40,.7);
}

.chat-header p {
  color: #dbe8fa;
  margin: 0;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  background:
    radial-gradient(ellipse at center, rgba(0,110,255,.04), transparent 70%);
}

.message-form {
  display: flex;
  gap: 10px;
  padding: 15px;
  border-top: 1px solid var(--border);
  background: #101827;
}

.message-form input {
  flex: 1;
  min-width: 0;
}

.message-form button {
  padding: 0 22px;
  border-radius: 13px;
  color: white;
  font-weight: 700;
  background: linear-gradient(135deg, #087cff, #29aaff);
}

footer {
  text-align: center;
  color: #65758b;
  padding: 28px 10px;
  font-size: 12px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 750px) {
  .app {
    padding: 15px;
  }

  .header {
    padding: 12px 0 20px;
  }

  .brand h1 {
    font-size: 20px;
  }

  .auth-section {
    margin: 35px auto;
  }

  .auth-card {
    padding: 22px;
  }

  .chat-layout {
    grid-template-columns: 1fr;
    height: calc(100vh - 150px);
    min-height: 550px;
  }

  .sidebar {
    max-height: 230px;
    border-left: 0;
    border-bottom: 1px solid var(--border);
  }

  .conversation {
    min-height: 300px;
  }

  .messages {
    padding: 14px;
  }

  .message-form {
    padding: 10px;
  }

  .message-form button {
    padding: 0 16px;
  }
                         }
