/* ============================
   Friends Page (Dark Chat)
   ============================ */

:root {
  --bg: #000;
  --frame: #00ff88;
  --text: #fff;
  --card: #111;
}

/* Container split */
.friends-container {
  display: flex;
  height: calc(90vh - 120px);
  margin-top: 60px; /* for topbar */
}

/* ===== Friend List ===== */
.friends-list {
  width: 30%;
  background: var(--card);
  border-right: 2px solid var(--frame);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.friend {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid #222;
  cursor: pointer;
  color: var(--text);
}
.friend:hover {
  background: #222;
}
.friend.active {
  background: var(--frame);
  color: #000;
}
.friend .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

/* ===== Chat Section ===== */
.friend-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg) url('../assets/img/chat-bg.png') no-repeat center/cover;
}

/* Chat Header */
.chat-header {
  background: var(--card);
  border-bottom: 2px solid var(--frame);
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-header h3 {
  flex: 1;
}
.chat-header .chat-actions button {
  background: transparent;
  border: 1px solid var(--frame);
  color: var(--frame);
  padding: 5px 8px;
  margin-left: 5px;
  border-radius: 5px;
  cursor: pointer;
}
.chat-header .chat-actions button:hover {
  background: var(--frame);
  color: #000;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg {
  max-width: 70%;
  padding: 10px 15px;
  border-radius: 15px;
  position: relative;
  font-size: 14px;
}
.msg .time {
  display: block;
  font-size: 11px;
  color: #aaa;
  margin-top: 4px;
  text-align: right;
}

/* Friend msg */
.msg.friend {
  background: var(--card);
  border: 1px solid var(--frame);
  border-top-left-radius: 0;
  color: var(--text);
  align-self: flex-start;
}

/* User msg */
.msg.user {
  background: var(--frame);
  border-top-right-radius: 0;
  color: #000;
  align-self: flex-end;
}

/* ===== Input ===== */
.chat-input {
  background: var(--card);
  border-top: 2px solid var(--frame);
  padding: 10px;
  display: flex;
  align-items: center;
}
.chat-input input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--frame);
  border-radius: 20px;
  padding: 10px 15px;
  color: var(--text);
  outline: none;
}
.chat-input button {
  background: transparent;
  border: none;
  color: var(--frame);
  font-size: 20px;
  margin-left: 10px;
  cursor: pointer;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .friends-container {
    flex-direction: column;
  }
  .friends-list {
    width: 100%;
    height: 150px;
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 2px solid var(--frame);
  }
  .friend {
    flex-direction: column;
    justify-content: center;
    padding: 10px;
    min-width: 90px;
  }
  .friend span {
    font-size: 12px;
    text-align: center;
  }
  .friend-chat {
    flex: 1;
  }
}