* {

  margin: 0;
  padding: 0;
  box-sizing: border-box;

}

body {

  background: #0f0f0f;

  color: white;

  font-family: Arial, sans-serif;

}

/* =========================
TOPBAR
========================= */

.topbar {

  position: sticky;

  top: 0;

  z-index: 1000;

  background: #111;

  border-bottom: 1px solid #222;

  padding: 14px 18px;

  display: flex;

  align-items: center;

  justify-content: space-between;

}

.brand {

  display: flex;

  align-items: center;

  gap: 10px;

}

.logo img {

  width: 48px;

  height: 48px;

  object-fit: contain;

  border-radius: 12px;

}

.logo-text {

  font-size: 24px;

  font-weight: bold;

}

.status {

  color: #00ff88;

  font-size: 14px;

}

/* =========================
APP
========================= */

.app-shell {

  max-width: 700px;

  margin: auto;

  padding: 20px;

}

/* =========================
LOCATION
========================= */

.location-bar {

  margin-top: 10px;

  margin-bottom: 20px;

  color: #aaa;

  font-size: 15px;

}

/* =========================
POST BOX
========================= */

.post-box {

  display: flex;

  gap: 10px;

  margin-bottom: 30px;

}

.create-box input {

  flex: 1;

  background: #111;

  border: 1px solid #222;

  color: white;

  padding: 16px;

  border-radius: 16px;

  font-size: 16px;

}

.create-box button {

  background: white;

  color: black;

  border: none;

  padding: 16px 22px;

  border-radius: 16px;

  font-weight: bold;

}

/* =========================
ROOMS
========================= */

.feed {

  display: flex;

  flex-direction: column;

  gap: 16px;

}

.room-card {

  background: #171717;

  border: 1px solid #262626;

  border-radius: 22px;

  padding: 18px;

  transition: 0.2s;

}

.room-card:hover {

  transform: translateY(-2px);

  border-color: #00ff88;

}

.room-title {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.5;
}

.room-meta {

  color: #999;

  font-size: 14px;

  margin-bottom: 8px;

}

.room-location {

  color: #666;

  font-size: 13px;

}

.room-topic {
  background: #111;
  color: white;
  border: 1px solid #333;
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: bold;
}

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

.messages {

  display: flex;

  flex-direction: column;

  gap: 12px;

  margin-top: 20px;

}

.message {

  background: #1a1a1a;

  border-radius: 18px;

  padding: 14px;

}

.message-user {

  color: #00ff88;

  margin-bottom: 6px;

  font-size: 14px;

}

.message-text {

  color: white;

  line-height: 1.5;

}

/* =========================
TYPING
========================= */

.typing {

  margin-top: 10px;

  color: #888;

  font-size: 13px;

}

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

@media (max-width: 700px) {

  .app-shell {

    padding: 14px;

  }

  .logo-text {

    font-size: 20px;

  }

  .post-input {

    padding: 14px;

    font-size: 15px;

  }

}

.room-owner-bar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px 15px;
  background:#111;
  color:white;
}

.user-info {
  display:flex;
  align-items:center;
  gap:10px;
}

.user-info img {
  width:35px;
  height:35px;
  border-radius:50%;
}

.actions {
  display:flex;
  gap:10px;
}

.actions button {
  background:#0A66C2;
  border:none;
  color:white;
  padding:6px 14px;
  border-radius:20px;
  cursor:pointer;
}

.product-card {

background:#111;

color:white;

padding:15px;

margin:10px;

border-radius:12px;

}

.product-card button {

background:#0A66C2;

color:white;

border:none;

padding:8px 15px;

border-radius:20px;

margin:5px;

}

/* ===== FIXED APP LAYOUT ===== */

html,
body {
    height:100%;
    overflow-x:hidden;
    overflow-y: auto;
}


.app-shell {
    height:100vh;
    display:flex;
    flex-direction:column;
}



/* بالا ثابت */

.topbar,
.room-header,
.room-owner,
.room-topic,
.location-bar {
    flex-shrink:0;
}



/* محتوای وسط */

.messages {
    flex:1;
    overflow-y:auto;
    padding:15px;
    padding-bottom:90px;

    display:flex;
    flex-direction:column;
    gap:12px;
}



/* پایین ثابت */

.chat-box {

    position:fixed;

    bottom:0;
    left:0;
    right:0;

    height:70px;

    background:#000;

    display:flex;
    align-items:center;

    padding:10px;

    z-index:1000;
}



.chat-box input {

    flex:1;

    height:45px;

    border-radius:25px;

    padding:0 15px;

}



.chat-box button {

    height:45px;

    margin-left:10px;

    border-radius:25px;

}

/* =========================
   CITY PAGE LAYOUT
========================= */


/* پست های شهر فقط اسکرول */

.feed {

    flex:1;

    overflow-y:auto;

    padding:15px;

    padding-bottom:90px;

}



/* باکس ساخت پست پایین ثابت */

.create-post {

    position:fixed;

    bottom:0;

    left:0;

    right:0;


    height:70px;


    background:#000;


    display:flex;

    align-items:center;


    padding:10px;


    z-index:1000;

}



.create-post input,
.create-post textarea {

    flex:1;

    height:45px;

    border-radius:25px;

    padding:0 15px;

}


/* دکمه ارسال */

.create-post button {

    height:45px;

    margin-left:10px;

    border-radius:25px;

}



.post-media {
  width: 100%;
  max-height: 300px;
  border-radius: 12px;
  object-fit: cover;
  margin-top: 8px;
}


.media-preview {

    margin-bottom:10px;

}


.room-topic {
    background:#111;
    color:white;
    border:1px solid #333;
    padding:8px;
    border-radius:12px;

    display:flex;
    align-items:center;
}

.room-topic .post-media {
    width:90px;
    height:70px;
    object-fit:contain;
}

/* =========================
   ROOM TOPIC - HORIZONTAL
========================= */

#roomTopic {
  width: 100%;
  margin: 10px 0 15px 0;
}

.room-topic-card {

  width: 100%;

  min-height: 105px;
  max-height: 125px;

  display: flex;
  flex-direction: row;

  background: #171717;
  border: 1px solid #262626;
  border-radius: 18px;

  overflow: hidden;
}


/* =========================
   LEFT - TEXT
========================= */

.room-topic-content {

  flex: 1;

  min-width: 0;

  padding: 14px 16px;

  display: flex;
  flex-direction: column;

  justify-content: center;

  text-align: left;
}

.room-topic-title {

  font-size: 18px;
  font-weight: bold;

  color: white;

  line-height: 1.3;

  overflow: hidden;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.room-topic-user {

  margin-top: 7px;

  font-size: 14px;

  color: #999;
}


/* =========================
   RIGHT - IMAGE / VIDEO
========================= */

.room-topic-media {

  width: 125px;
  height: 100%;

  flex-shrink: 0;

  overflow: hidden;

  background: #111;
}

.room-topic-media img,
.room-topic-media video {

  width: 100%;
  height: 100%;

  display: block;

  object-fit: cover;
}


/* =========================
   EMPTY
========================= */

.room-topic-empty {

  background: #171717;

  border: 1px solid #262626;

  border-radius: 18px;

  padding: 18px;

  color: #888;
}


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

@media (max-width: 700px) {

  .room-topic-card {

    min-height: 95px;
    max-height: 110px;

    border-radius: 16px;
  }

  .room-topic-content {

    padding: 12px 14px;
  }

  .room-topic-title {

    font-size: 16px;
  }

  .room-topic-user {

    font-size: 13px;
    margin-top: 5px;
  }

  .room-topic-media {

    width: 105px;
  }

}

