@font-face {
  font-family: IRANSans;
  src: url("../assets/fonts/IRANSansWeb.ttf");
}

:root {
  --primary: #01579b;
  --sidebar: #f0f6ff;
  --text: #263238;
  --muted: #607d8b;
  --border: #d9e3ec;
  --white: #ffffff;
}

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

body {
  font-family: IRANSans;
  background: #fff;
}

/* Sidebar */

.sidebar {
  width: 286px;
  background: var(--sidebar);
  border-left: 1px solid #e8eef5;

  display: flex;
  flex-direction: column;
  height: 100vh;

  padding: 24px;
}

/* Main */

.main-wrapper {
  flex: 1;
}

/* Header */

.topbar {
  height: 93px;
  padding: 24px 32px;
  border-bottom: 1px solid #edf1f5;
  background: #fff;
  direction: ltr;
}
/* Content */

.content-area {
  padding: 40px;
}

.header-btn {
  width: 120px;
  height: 42px;
  border: 1px solid var(--primary);
  background: #fff;
  color: var(--primary);
  border-radius: 8px;
  font-size: 16px;
  transition: 0.2s;
}

.header-btn:hover {
  background: var(--primary);
  color: #fff;
}
.header-btn img {
  width: 18px;
  height: 18px;
  transition: 0.2s;
}

.header-btn:hover img {
  filter: brightness(0) invert(1);
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 8px;
}

.name {
  font-size: 16px;
  color: var(--text);
  font-weight: 600;
}

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

.avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #ddd;
}

.icon-btn {
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sidebar-logo {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.9;
  margin-bottom: 24px;
  padding-bottom: 16px;
}

.sidebar-logo::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 1px;
  background-color: #d9d9d9;
}
.logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.menu-item {
  text-decoration: none;
  color: var(--text);
  padding: 12px 14px;
  border-radius: 8px;
  transition: 0.2s;
}

.menu-item:hover,
.menu-item.active {
  background: #fff;
  color: var(--primary);
}

.new-chat-btn {
  height: 48px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  direction: ltr;
  transition: all 0.2s ease;
}

.new-chat-btn:hover {
  background: #0266a8;
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.chat-date {
  color: var(--primary);
  font-size: 18px;
}
.chat-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  margin-top: 16px;
  padding-left: 4px;
}
.chat-list::-webkit-scrollbar {
  width: 6px;
}

.chat-list::-webkit-scrollbar-thumb {
  background: #cfd8dc;
  border-radius: 10px;
}
.chat-item {
  text-decoration: none;
  color: var(--text);
  font-size: 16px;
  line-height: 1.8;
}

.more-btn {
  width: 100%;
  height: 42px;
  border: none;
  border-radius: 10px;
  background: #e7f0fa;
  color: var(--primary);
}

.sidebar-footer {
  color: var(--text);
}

/* Content Area */

.content-area {
  position: relative;
  padding: 40px;
  min-height: calc(100vh - 93px);
}

/* Model Dropdown */

.model-dropdown {
  position: absolute;
  top: 24px;
  left: 32px;
  right: auto;
}

.model-btn {
  height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  background: #0277bd;
  color: var(--white);
  font-size: 16px;
  direction: ltr;
}

.model-btn:hover {
  background: #f8fafc;
  border-color: #c9d7e5;
}

.model-btn::after {
  margin-right: 8px;
}

/* Dropdown Menu */

.dropdown-menu {
  min-width: 180px;
  padding: 8px;
}

.dropdown-item {
  height: 42px;
  border-radius: 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
}

.dropdown-item:hover {
  background: #f0f6ff;
  color: var(--primary);
}

.dropdown-item.active {
  background: #0277bd;
  color: #fff;
}

/* Hero */

.hero-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
}

.hero-subtitle {
  font-size: 16px;
  color: var(--muted);
}

/* Search */

.search-wrapper {
  max-width: 760px;
}

.search-box {
  height: 68px;
  background: #fff;
  border: 1px solid #d9e3ec;
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

.search-box input {
  font-size: 15px;
  background: transparent;
}

.search-box input::placeholder {
  color: #90a4ae;
}

.send-btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
}

.send-btn:hover {
  background: #02497f;
  color: #fff;
}

.input-icon {
  width: 24px;
  height: 24px;
}

/* markdown style */

.markdown-body {
  line-height: 2;
  font-size: 16px;
  padding-inline: 16px;
}

.markdown-body pre {
  background: #1e1e1e;
  color: white;
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  direction: ltr;
}

.markdown-body code {
  background: #eee;
  padding: 8px 8px;
  border-radius: 4px;
}

.markdown-body p {
  margin: 16px 8px;
}

.markdown-body ul,
.markdown-body ol {
  padding-right: 20px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin-top: 16px;
  margin-bottom: 8px;
}

/* =========================
   RESPONSIVE
========================= */

/* hamburger hidden desktop */

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 20px;
}

/* =========================
   TABLET
========================= */

@media (max-width: 992px) {
  .sidebar {
    width: 220px;

    padding: 20px 16px;
  }

  .topbar {
    padding: 20px;
  }

  .hero-title {
    font-size: 30px;
  }

  .search-wrapper {
    max-width: 100%;
  }

  .menu-item {
    padding: 10px 12px;
  }

  .new-chat-btn {
    height: 44px;
  }

  .sidebar-logo {
    font-size: 14px;
  }

  .chat-item {
    font-size: 14px;
  }
}

/* =========================
   MOBILE
========================= */

.mobile-topbar {
  display: none;
}

@media (max-width: 768px) {
  /* desktop navbar hidden */

  .topbar {
    display: none !important;
  }

  /* mobile navbar */

  .mobile-topbar {
    height: 72px;

    padding-inline: 16px;

    background: #fff;

    border-bottom: 1px solid #edf1f5;

    display: flex;

    align-items: center;

    justify-content: space-between;

    position: sticky;

    top: 0;

    z-index: 100;
  }

  /* title */

  .mobile-title {
    font-size: 18px;

    font-weight: 700;

    color: var(--primary);
  }

  /* avatar */

  .mobile-topbar .avatar {
    width: 38px;

    height: 38px;

    background: #e0e0e0;
  }

  /* hamburger */

  .menu-toggle {
    width: 48px;

    height: 48px;

    border-radius: 14px;

    background: #ffffff;

    border: 1px solid #edf1f5;

    box-shadow:
      0 2px 6px rgba(0, 0, 0, 0.04),
      0 8px 20px rgba(0, 0, 0, 0.06);

    display: flex;

    align-items: center;

    justify-content: center;

    color: #263238;

    font-size: 20px;

    transition: 0.2s;
  }

  .menu-toggle:hover {
    transform: translateY(-1px);

    box-shadow:
      0 4px 10px rgba(0, 0, 0, 0.06),
      0 10px 24px rgba(0, 0, 0, 0.08);
  }

  /* sidebar */

  .sidebar {
    position: fixed;

    top: 0;

    right: -100%;

    width: 280px;

    height: 100vh;

    z-index: 999;

    transition: 0.3s ease;

    padding: 24px;

    align-items: stretch;
  }

  .sidebar.active {
    right: 0;
  }

  /* show sidebar texts */

  .sidebar-logo span,
  .menu-item span,
  .new-chat-btn span,
  .chat-list,
  .sidebar-footer span {
    display: block;
  }

  .menu-item {
    width: 100%;

    height: auto;

    justify-content: flex-start;

    padding: 12px 14px;
  }

  .new-chat-btn {
    width: 100%;

    height: 48px;
  }

  /* content */

  .main-wrapper {
    width: 100%;
  }

  .content-area {
    padding: 24px 16px;

    min-height: calc(100vh - 72px);
  }

  .hero-title {
    font-size: 24px;

    line-height: 1.8;
  }

  .hero-subtitle {
    font-size: 14px;
  }

  .search-box {
    height: 60px;

    border-radius: 14px;
  }

  .send-btn {
    width: 42px;

    height: 42px;
  }

  .name {
    font-size: 14px;
  }

  .username {
    font-size: 12px;
  }
}

/* overlay */

.sidebar-overlay {
  position: fixed;

  inset: 0;

  background: rgba(0, 0, 0, 0.35);

  z-index: 998;

  opacity: 0;

  visibility: hidden;

  transition: 0.3s;
}

.sidebar-overlay.active {
  opacity: 1;

  visibility: visible;
}

.menu-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

@media (max-width: 992px) {
  .content-area {
    justify-content: flex-start !important;

    padding-top: 200px;
  }
}

/* ===== CHAT ITEM ===== */

.chat-item-wrapper {
  position: relative;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 8px 10px;

  border-radius: 10px;

  transition: 0.2s;
}

.chat-item-wrapper:hover {
  background: #ffffff;
}

.chat-item {
  flex: 1;

  text-decoration: none;

  color: var(--text);

  font-size: 15px;

  line-height: 1.8;
}

/* ===== THREE DOT BUTTON ===== */

.chat-more-btn {
  width: 32px;
  height: 32px;

  border: none;

  border-radius: 8px;

  background: transparent;

  color: var(--muted);

  cursor: pointer;

  opacity: 0;

  transition: 0.2s;

  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-item-wrapper:hover .chat-more-btn {
  opacity: 1;
}

.chat-more-btn:hover {
  background: #edf4fb;
}

/* ===== DROPDOWN ===== */

.chat-actions {
  position: absolute;

  top: calc(100% + 6px);

  left: 8px;

  width: 170px;

  background: #ffffff;

  border: 1px solid #e6edf5;

  border-radius: 12px;

  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);

  padding: 6px;

  z-index: 999;

  display: none;
}

.chat-actions.active {
  display: block;
}

/* ===== ACTION BUTTONS ===== */

.action-btn {
  width: 100%;

  border: none;

  background: transparent;

  height: 42px;

  border-radius: 8px;

  display: flex;
  align-items: center;
  gap: 10px;

  padding-inline: 12px;

  cursor: pointer;

  font-size: 14px;

  color: var(--text);

  transition: 0.2s;
}

.action-btn:hover {
  background: #f0f6ff;

  color: var(--primary);
}

.action-btn.delete:hover {
  background: #fff1f1;

  color: #d32f2f;
}

.action-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}
