/* Discord Color Palette */
:root {
  --background-primary: #36393f;
  --background-secondary: #2f3136;
  --background-tertiary: #202225;
  --background-accent: #4f545c;
  --text-normal: #dcddde;
  --text-muted: #72767d;
  --text-link: #00aff4;
  --text-positive: #43b581;
  --text-danger: #f04747;
  --brand: #5865f2;
  --brand-hover: #4752c4;
  --header-primary: #ffffff;
  --header-secondary: #b9bbbe;
  --font-primary: 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

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

body {
  font-family: var(--font-primary);
  background-color: var(--background-tertiary);
  color: var(--text-normal);
  height: 100vh;
  margin: 0;
  overflow: hidden;
}

.app-container {
  display: flex;
  width: 100%;
  height: 100%;
}

.guilds-sidebar {
  width: 72px;
  background-color: var(--background-tertiary);
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  z-index: 10;
}

.guild-icon {
  width: 48px;
  height: 48px;
  background-color: var(--background-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.2s ease;
  position: relative;
}

.guild-icon:hover {
  border-radius: 16px;
  background-color: var(--brand);
  color: white;
  transform: translateY(-2px);
}

.guild-icon.active {
  border-radius: 16px;
  background-color: var(--brand);
}

.guild-icon.active::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 25%;
  height: 50%;
  width: 8px;
  background-color: white;
  border-radius: 0 4px 4px 0;
}

.guild-icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 50%;
}

.sidebar {
  width: 240px;
  background-color: var(--background-secondary);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 5;
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
}

.sidebar-header {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 0 rgba(0,0,0,0.2);
  font-weight: 600;
  cursor: pointer;
}

.sidebar-header:hover {
  background-color: rgba(79, 84, 92, 0.16);
}

.channels-list {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
}

.member-group {
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding: 16px 8px 4px;
}

.channel-item {
  padding: 6px 8px;
  border-radius: 4px;
  margin-bottom: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: var(--text-muted);
}

.channel-item:hover {
  background-color: rgba(79, 84, 92, 0.16);
  color: var(--text-normal);
}

.channel-item.active {
  background-color: rgba(79, 84, 92, 0.32);
  color: var(--header-primary);
}

.channel-item .hash {
  margin-right: 6px;
  font-size: 20px;
  opacity: 0.5;
}

.chat-area {
  flex: 1;
  background-color: var(--background-primary);
  display: flex;
  flex-direction: column;
}

.chat-header {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 0 rgba(0,0,0,0.2);
  font-weight: 600;
}

.chat-header .hash {
  margin-right: 8px;
  color: var(--text-muted);
  font-size: 24px;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.message {
  display: flex;
  gap: 16px;
  animation: fadeIn 0.3s ease;
  padding: 4px 0;
}

.message:hover {
  background-color: rgba(0,0,0,0.05);
}

.message .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--brand);
  flex-shrink: 0;
}

.message .message-content .user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.message .message-content .user-info .username {
  font-weight: 500;
  color: var(--header-primary);
  cursor: pointer;
}

.message .message-content .user-info .username:hover {
  text-decoration: underline;
}

.message .message-content .user-info .timestamp {
  font-size: 12px;
  color: var(--text-muted);
}

.message .message-content .text {
  line-height: 1.375rem;
}

.input-container {
  padding: 0 16px 24px;
}

.input-wrapper {
  background-color: #40444b;
  border-radius: 8px;
  padding: 11px 16px;
  display: flex;
  align-items: center;
  transition: 0.1s ease;
}

.input-wrapper:focus-within {
  box-shadow: 0 0 0 2px var(--brand);
}

.input-wrapper input {
  background: transparent;
  border: none;
  color: var(--text-normal);
  width: 100%;
  font-size: 1rem;
  outline: none;
}

.members-sidebar {
  width: 240px;
  background-color: var(--background-secondary);
  padding: 24px 8px;
  flex-shrink: 0;
}

@media (max-width: 1024px) {
  .members-sidebar {
    display: none;
  }
}

.member-item {
  padding: 6px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.member-item:hover {
  background-color: rgba(79, 84, 92, 0.16);
}

.member-item .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--background-accent);
}

.member-item .username {
  font-weight: 500;
  color: var(--text-muted);
}

.member-item.online .username {
  color: var(--text-normal);
}

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

/* User Popout (Discord Style) */
.user-popout-container {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    width: 300px;
    display: none;
}

.user-popout {
    pointer-events: auto;
    background: #18191c;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    animation: popIn 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.popout-banner {
    height: 60px;
    background: #5865f2;
}

.popout-header {
    position: relative;
    padding: 0 16px;
    height: 40px;
}

.popout-avatar {
    position: absolute;
    top: -40px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #18191c;
    border: 6px solid #18191c;
}

.status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    background: #43b581;
    border-radius: 50%;
    border: 4px solid #18191c;
}

.popout-badge {
    position: absolute;
    top: 10px;
    right: 16px;
    background: #2f3136;
    padding: 4px;
    border-radius: 4px;
}

.popout-badge img { width: 20px; height: 20px; }

.popout-body {
    padding: 16px;
    background: #18191c;
}

.popout-username {
    font-size: 18px;
    font-weight: 700;
    color: white;
    margin-bottom: 12px;
}

.popout-username .tag { color: #b9bbbe; font-size: 14px; font-weight: 400; }

.popout-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 12px 0;
}

.popout-section {
    margin-bottom: 12px;
}

.section-title {
    font-size: 11px;
    font-weight: 700;
    color: #b9bbbe;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.section-content { font-size: 13px; color: #dcddde; }

.popout-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.role-pill {
    background: #292b2f;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #dcddde;
}

.role-dot { width: 12px; height: 12px; border-radius: 50%; background: #5865f2; }

.popout-footer {
    margin-top: 16px;
}

.popout-footer input {
    width: 100%;
    background: #202225;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    color: #dcddde;
    font-size: 13px;
    outline: none;
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.typing-container {
    position: fixed;
    bottom: 0;
    left: 312px;
    padding: 8px;
    font-size: 12px;
    color: #dcddde;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #36393f;
    width: calc(100% - 552px);
    z-index: 100;
}

.typing-dots { display: flex; gap: 2px; }
.typing-dots span {
    width: 6px;
    height: 6px;
    background: #dcddde;
    border-radius: 50%;
    animation: typing 1s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 100% { transform: translateY(0); opacity: 0.3; }
    50% { transform: translateY(-4px); opacity: 1; }
}

