/* === Global Reset === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", "Poppins", sans-serif;
}

/* === Body Styling === */
body {
  background: linear-gradient(135deg, #eef2ff 0%, #ffffff 100%);
  color: #1a1a1a;
  min-height: 100vh;
  display: flex;
}

/* === Layout === */
.layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* ---------------------------
   Sidebar — professional & elegant
   --------------------------- */
.sidebar {
  background: linear-gradient(180deg, #071028 0%, #0d1b2a 60%, rgba(13,27,42,0.95) 100%);
  color: #e6eef8;
  width: 260px;
  min-width: 260px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-start;
  box-shadow: 2px 0 20px rgba(8,12,20,0.45);
  transition: width 220ms ease, padding 220ms ease, background 300ms ease;
  position: relative;
  border-right: 1px solid rgba(255,255,255,0.03);
  backdrop-filter: blur(6px);
}

/* logo / header */
.sidebar .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 6px;
}

.sidebar .logo .badge {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg,#2dd4bf,#06b6d4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #021024;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(3,12,20,0.35);
}

/* new chat button */
.sidebar .new-chat {
  background: linear-gradient(80deg,#254d9b,#08101a);
  color: #f8fbff;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.03);
  width: 100%;
  text-align: left;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(2,6,23,0.45);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 200ms ease;
}

.sidebar .new-chat .plus {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.02);
  font-size: 1.05rem;
  color: #aeeef6;
}

.sidebar .new-chat:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(3,12,20,0.6);
}

/* menu sections */
.sidebar .menu-section {
  width: 100%;
}

.sidebar .menu-section h4 {
  margin: 6px 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #9fb0cc;
  letter-spacing: 0.2px;
  padding-left: 2px;
}

.sidebar .menu-section ul {
  list-style: none;
  width: 100%;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  
}

/* list items */
.sidebar .menu-section li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 10px;
  color: #cfe6ff;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 180ms ease, color 180ms ease, transform 160ms ease;
  position: relative;
  background-color: #1e293b;
  border-radius: 15px;
  margin-top: 10px;
  
}

.sidebar .menu-section li span.icon {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  color: #aeeef6;
  font-size: 1.05rem;
  flex: 0 0 36px;
}

.sidebar .menu-section li span.text {
  display: inline-block;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar .menu-section li:hover {
  background: linear-gradient(90deg, rgba(99,102,241,0.08), rgba(56,189,248,0.03));
  color: #fff;
  transform: translateX(6px);
}

.sidebar .menu-section li.active {
  background: linear-gradient(90deg, rgba(56,189,248,0.12), rgba(99,102,241,0.06));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

/* divider */
.sidebar .divider {
  height: 1px;
  width: 100%;
  background: rgba(255,255,255,0.03);
  margin: 8px 0;
}

/* scrollbar */
.sidebar {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.06) transparent;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
}

/* collapse at tablet */
@media (max-width: 900px) {
  .sidebar {
    width: 80px;
    min-width: 80px;
    padding: 16px 10px;
    align-items: center;
    gap: 12px;
  }
  .sidebar .logo { display: none; }
  .sidebar .new-chat { padding: 8px; width: 48px; border-radius: 10px; justify-content: center; }
  .sidebar .new-chat .plus { width: 34px; height: 34px; }
  .sidebar .menu-section h4 { display: none; }
  .sidebar .menu-section li { justify-content: center; padding: 10px; width: 48px; border-radius: 10px; }
  .sidebar .menu-section li span.icon { width: 40px; height: 40px; }
  .sidebar .menu-section li span.text { display: none; }
  .sidebar .divider { display: none; }
}

/* hide sidebar on phones */
@media (max-width: 480px) {
  .sidebar { display: none; }
}

/* === Main Content === */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: transparent;
  padding: 30px 40px;
}

/* === Topbar === */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: #111827;
}

.version {
  font-size: 0.8rem;
  color: #6b7280;
  margin-left: 5px;
}

.profile img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

/* === Hero Section === */
.hero {
  text-align: center;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.hero h1 span {
  color: #111827;
}

.hero h2 {
  font-size: 1.5rem;
  color: #6b7280;
  font-weight: 500;
}

.hero .subtext {
  color: #9ca3af;
  font-size: 0.95rem;
  margin-top: 0.8rem;
}

/* === Action Cards === */
.actions {
  margin: 2rem auto;
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.action-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 1.4rem 2rem;
  width: 200px;
  text-align: center;
  text-decoration: none;
  color: #111827;
  transition: all 0.25s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.action-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.action-card .icon {
  font-size: 1.6rem;
  display: block;
  margin-bottom: 0.6rem;
  background-color: #f4f7ff;
  border-radius: 30px;
}

/* === Search Bar === */
.search-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  width: 80%;
  max-width: 500px;
  margin: 2rem auto 0;
  padding: 0.4rem 0.6rem;
}

.search-bar input {
  border: none;
  flex: 1;
  padding: 0.8rem;
  font-size: 1rem;
  outline: none;
  background: transparent;
}

.search-bar button {
  background: #111827;
  color: #fff;
  border: none;
  padding: 0.8rem 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  transition: 0.2s;
}

.search-bar button:hover {
  background: #1f2937;
}

/* === Buttons === */
.btn {
  background: #111827;
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 0.9rem 1.4rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.25s ease;
  min-width: 180px;
}

.btn:hover {
  background: #1f2937;
  transform: translateY(-2px);
}

.btn.outline {
  background: transparent;
  color: #111827;
  border: 2px solid #111827;
}

.btn.outline:hover {
  background: #111827;
  color: #fff;
}

.btn.danger {
  background: #dc2626;
}

.btn.danger:hover {
  background: #b91c1c;
}

/* === Input Fields === */
input[type="text"],
input[type="password"],
input[type="number"] {
  padding: 0.9rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  font-size: 1rem;
  width: 100%;
  transition: 0.2s;
}

input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* === Chat Container === */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 80vh;
  max-height: 800px;
}

#chat-box {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #f9fafb;
  margin-bottom: 1rem;
}

.message {
  background: #fff;
  border-radius: 10px;
  padding: 0.8rem;
  margin-bottom: 0.6rem;
  text-align: left;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.message strong.you {
  color: #4f46e5;
}

.time {
  font-size: 0.8rem;
  color: #6b7280;
}

/* === Animations === */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Responsive === */
@media (max-width: 900px) {
  .main { padding: 20px; }
  .hero h1 { font-size: 1.6rem; }
  .actions { gap: 15px; }
  .action-card { width: 100%; max-width: 260px; }
  .search-bar { width: 95%; }
}
