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

body {
  font-family: "Poppins", sans-serif;
  line-height: 1.6;
  background: #f9fafc;
  color: #333;
}

/* Hero Section */
.community-hero {
  background: linear-gradient(135deg, #7f5af0, #2cb67d);
  color: #fff;
  text-align: center;
  padding: 2rem 1rem;
}

.community-hero h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  font-weight: 900;
}

.community-hero p {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.community-hero .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #fff;
  color: #2cb67d;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: 2rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

.community-hero .btn:hover {
  background: #f1f1f1;
}

/* Stats Section */
.community-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1.5rem auto;
  max-width: 600px;
}

.stat-card {
  text-align: center;
  padding: 1.2rem;
  border-radius: 1rem;
  color: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.stat-card i {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.stat-card h2 {
  font-size: 1.4rem;
  margin: 0.2rem 0;
  color: #f3ef0e;
}

.stat-card p {
  font-size: 0.9rem;
}

.stat-card.green {
  background: #2cb67d;
}
.stat-card.blue {
  background: #3da9fc;
}
.stat-card.purple {
  background: #7f5af0;
}
.stat-card.orange {
  background: #ff8906;
}

/* Categories Section */
.forum-sections-overview {
  padding: 1rem;
}

.forum-sections-overview h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 700;
}

.categories-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.category-card {
  background: #fff;
  padding: 1rem;
  border-radius: 1rem;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.category-card i {
  font-size: 1.5rem;
  color: #7f5af0;
  margin-bottom: 0.5rem;
  display: block;
}

.category-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
  color: #111;
  font-weight: 600;
}

.category-card p {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.category-card span {
  font-size: 0.8rem;
  color: #999;
}

.category-meta {
  display: flex;
  gap: 2rem;
  font-size: 0.8rem;
  color: #aaa;
  margin-top: 0.5rem;
  font-weight: 600;
}

/* Latest Discussions */
.latest-discussions {
  padding: 1rem;
}

.latest-discussions h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 700;
}

.latest-topics-list {
  list-style: none;
}

.latest-topics-list li {
  background: #fff;
  padding: 0.8rem 1rem;
  margin-bottom: 0.6rem;
  border-radius: 0.8rem;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
  transition: background 0.2s ease;
}

.latest-topics-list li:hover {
  background: #f3f4f6;
}

.latest-topics-list a {
  font-weight: 600;
  color: #2cb67d;
  text-decoration: none;
}

.latest-topics-list span {
  display: block;
  font-size: 0.8rem;
  color: #777;
  margin-top: 0.3rem;
}

button.submit-btn {
  background-color: #2cb67d;
  padding: 15px;
}

.like-btn {
  background-color: #2cb67d;
  padding: 5px;
  width: 20%;
  margin-top: 10px;
  font-size: 12px;
  font-weight: normal;
}

.like-discussion-btn {
  background-color: #2cb67d;
  padding: 5px;
  width: 20%;
  margin-top: 10px;
  font-size: 12px;
  font-weight: normal;
}

.comment-discussion-btn {
  background-color: #2cb67d;
  padding: 5px;
  width: 20%;
  margin-top: 10px;
  font-size: 12px;
  font-weight: normal;
}

@media (min-width: 768px) {
  .like-discussion-btn,
  .comment-discussion-btn {
    width: 10%;
    font-size: 14px;
  }

  .like-btn {
    width: 30%;
  }
}

/* Desktop Upgrades */
@media (min-width: 768px) {
  .community-stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .categories-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .community-hero h1 {
    font-size: 2.2rem;
  }
}

/* Base (mobile-first) styles */

/* Make the whole chat room stand out */
.chat-root {
  width: 100%;
  margin: 0.5rem auto;
  font-family: "Poppins", sans-serif;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #ffffffcc;
  border: 1px solid #6a9c89;
  border-radius: 0.6rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(4px);
}

/* Header */
.chat-header {
  background: #2cb67d;
  color: #fff;
  padding: 0.8rem;
  text-align: center;
  border-radius: 0.6rem 0.6rem 0 0;
}

.chat-title {
  font-size: 1.5rem;
  font-weight: 900;
}

#chat-setup-heading {
  font-weight: 600;
}

/* Body */
.chat-body {
  flex: 1;
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;

  background-image: url("../assets/chatRoomWrapperBg.png");
  background-size: cover;
  background-repeat: no-repeat;
  border-radius: 0 0 0.6rem 0.6rem;
}

.online {
  display: flex;
  justify-content: space-between;
  padding: 0 15px;
}

#onlineUsers {
  font-size: 0.9rem;
  font-weight: 600;
  color: #2cb67d;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

/*nickname*/
.nickname {
  margin: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#nicknameInput {
  flex: 1;
  padding: 0.4rem;
  border: 1px solid #f3ecec;
  border-radius: 0.5rem;
  font-weight: 600;
}

#nicknameInput::placeholder {
  color: #dadada;
  font-style: italic; 
}

.room-name {
  font-weight: 600;
  font-size: 12px;
}

/* Available rooms section */
.availableChatroom {
  font-size: 0.9rem;
  font-weight: 600;
  color: #2cb67d;
  margin-bottom: 0.4rem;
}

.rooms-section {
  background: #eef7f3;
  border: 1px solid #d9eae2;
  border-radius: 0.4rem;
  padding: 0.6rem;
  margin-bottom: 0.8rem;
}

.rooms-list {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

/* Room buttons */
.room-btn {
  background: #e4eff9;
  color: #85b5f9;
  border: 1px solid #ccc;
  border: none;
  border-radius: 0.3rem;
  padding: 2px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
  font-weight: normal;
}

.room-btn:hover {
  background: #f1f1f1;
}

/* Create Room section */
.create-room {
  background: #fafafa;
  border: 1px dashed #ccc;
  border-radius: 0.4rem;
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.create-room input {
  flex: 1;
  padding: 0.4rem;
  border: 1px solid #ccc;
  border-radius: 0.3rem;
}

.create-room input::placeholder {
  font-size: 14px;
  font-style: italic;
  color: #dadada;
}

.create-room button {
  background: #6a9c89;
  color: #fff;
  font-weight: 600;
  padding: 0.5rem;
  border-radius: 0.3rem;
}

/* ===== Chat Room Area ===== */
.chat-room-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  background: #ffffffcc;
  border: 1px solid #ddd;
  border-radius: 0.4rem;
  padding: 0.6rem;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* Room header */
.room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f5f9f7;
  border: 1px solid #d9eae2;
  border-radius: 0.4rem;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.6rem;
}

.room-header h3 {
  margin: 0;
  font-size: 0.9rem;
  color: #333;
  font-weight: 600;
}

#currentRoomName {
  font-weight: 700;
  color: #2cb67d;
}

.room-header button {
  margin-top: 8px;
  background: #e57373;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 0.3rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  width: 50%;
}

.room-header button:hover {
  background: #d9534f;
}

/* Messages container */
.messages-container {
  flex: 1;
  background: #fafafa;
  border-radius: 0.4rem;
  padding: 0.5rem;
  overflow-y: auto;
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  border: 1px solid #eee;
}

/* Message bubbles */
.message {
  max-width: 85%;
  padding: 0.4rem 0.6rem;
  border-radius: 1rem;
  font-size: 0.85rem;
  line-height: 1.3;
  word-wrap: break-word;
}

.message.user {
  background: #57eebc;
  align-self: flex-end;
  border-bottom-right-radius: 0.3rem;
}

.message.other {
  background: #ffffff;
  align-self: flex-start;
  border-bottom-left-radius: 0.1rem;
}

.message-meta {
  font-size: 0.65rem;
  color: #666;
  margin-bottom: 0.2rem;
}

/* Send form */
.send-message-form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: auto;
}

.send-message-form input {
  flex: 1;
  padding: 0.5rem;
  border-radius: 0.2rem;
  border: 1px solid #ccc;
  font-size: 0.85rem;
  outline: none;
}

.send-message-form input:focus {
  border-color: #6a9c89;
  box-shadow: 0 0 0 2px rgba(106, 156, 137, 0.2);
}

.btn.send {
  margin-top: 8px;
  background: #2cb67d;
  color: #fff;
  font-weight: 600;
  border-radius: 0.2rem;
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  width: 20%;
}

/* ========================
   Responsive Enhancements
   ======================== */

/* Tablets and up */
@media (min-width: 600px) {
  .chat-root {
    margin: 1rem auto;
    border-radius: 0.8rem;
  }

  .create-room {
    flex-direction: row;
    align-items: center;
  }

  .btn.send,
  .room-header button {
    margin: 0;
  }
}

.chat-disclaimer {
  background: #fff3cd; 
  border-left: 4px solid #ffc107; 
  padding: 0.6rem 0.8rem;
  border-radius: 0.5rem;
  margin-bottom: 0.8rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  color: #856404; 
}

.chat-disclaimer a {
  color: #856404;
  text-decoration: underline;
}

.chat-disclaimer ul.guidelines-list {
  margin: 0.4rem 0 0 1rem;
  padding: 0;
  list-style-type: disc;
}

.chat-disclaimer ul.guidelines-list li {
  margin-bottom: 0.2rem;
}

.chat-agree {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  color: #856404;
}


/* Desktops */
@media (min-width: 900px) {
  .chat-root {
    max-width: 650px;
    margin: 1.5rem auto;
    border-radius: 1rem;
    height: 90vh;
  }

  .chat-header {
    padding: 1rem;
  }

  .room-btn {
    font-size: 0.9rem;
    padding: 0.5rem 0.8rem;
  }

  .send-message-form input {
    font-size: 1rem;
  }

  .send-message-form input::placeholder {
    font-size: 14px;
    font-style: italic;
    color: #dadada;
  }

  .btn.send {
    padding: 0.6rem 1rem;
  }
}
