/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

html, body {
  height: 100%;
  scrollbar-color: rgba(255, 255, 255, 0.5) transparent;
  overscroll-behavior: none; /* prevent scroll chaining */
}

main {
  flex: 1;
  min-height: 0;   /* allow children to shrink */
  overflow: hidden; /* prevent page overflow */
}

body {
  word-break: break-all;
  font-family: Arial, sans-serif;
  color: white;
  margin: 0;
  background: url('https://tse4.mm.bing.net/th/id/OIP.t_MKZo7TAAPISL1gwZGe4QHaE8?rs=1&pid=ImgDetMain&o=7&rm=3');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

main {
  margin: 50px;
}

hr {
    height: 1px;
    color: rgba(200, 200, 200, 0.3);
    background: rgba(200, 200, 200, 0.3);
    font-size: 0;
    border: 0;
}

.section {
  padding: 20px;
  border-radius: 12px;
  background-color: rgba(50, 50, 50, 0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 0.5px solid rgba(50, 50, 50, 0.3);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.section-light {
  background-color: rgba(50, 50, 50, 0.1);
}

header {
  background-color: rgba(50, 50, 50, 0.8);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  padding: 10px 20px;
  border-bottom: rgba(25, 25, 25, 0.3) 1px solid;
}

header.titlebar {
  -webkit-app-region: drag;
  app-region: drag;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

header.titlebar h1 {
  margin: 0;
  white-space: nowrap;
}

header.titlebar img {
  height: 40px;
  padding: 5px;
}

header.titlebar ul,
header.titlebar ul li a,
header.titlebar ul li {
  -webkit-app-region: no-drag;
  app-region: no-drag;
}

@media (display-mode: window-controls-overlay) {
  body {
    padding-top: env(titlebar-area-height, 0px);
  }

  header.titlebar {
    position: fixed;
    top: env(titlebar-area-y, 0);
    left: env(titlebar-area-x, 0);
    width: env(titlebar-area-width, 100%);
    height: env(titlebar-area-height, auto);
    z-index: 1000;
    padding: 0 10px;
    gap: 4px;
    overflow: hidden;
  }

  header.titlebar h1 {
    font-size: 14px;
  }

  header.titlebar img {
    height: 20px;
    padding: 2px 4px;
  }

  header.titlebar ul {
    margin: 0;
    padding: 0;
    gap: 0;
  }

  header.titlebar ul li {
    padding: 4px 6px;
  }

  header.titlebar ul li a {
    font-size: 13px;
  }
}

header ul, header h1 {
  display: inline;
}

header ul {
  vertical-align: middle;
}

header ul li {
  list-style-type: none;
  display: inline;
  padding: 10px;
  margin: 0;
}

header ul li a {
  color: white;
  text-decoration: none;
  font-size: 18px;
}

header ul li a:hover {
  text-decoration: underline;
}

.btn, input, button, select {
  display: inline-block;
  padding: 10px 20px;
  background-color: #333;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease;
  margin: 5px;
}

option {
  padding: 5px;
  border-radius: 5px;
}

.btn:hover, input:hover, button:hover {
  background-color: #555;
}

.btn-primary {
  background-color: #45AC70;
  color: white;
}

.btn-danger {
  background-color: #D9534F;
  color: white;
}

@media screen and (max-width: 700px) {
  #members {
    display: none;
  }
  #messages_section {
    grid-column: span 2 !important; 
  }
}

#messages {
  overflow-x: hidden;
}

#messages_section {
  overflow-x: hidden;
}

/* .message-row {
  display: flex;
  width: 100%;
}

.message-bubble {
  display: inline-flex;
  flex-direction: column;
  max-width: 70%;
} */

.message {
  padding: 0.1px 15px;
  margin-bottom: 10px;
  border-radius: 25px 25px 25px 0;
  background-color: #45AC7050;
  width: fit-content;
  max-width: 40%;
  min-width: 50px;
}

.message-you {
  border-radius: 25px 25px 0 25px;
  margin-left: auto;
  background-color: #45AC7080;
}

/* .message-meta {
  font-size: 0.8em;
  color: gray;
  margin: 0 0 5px 10px;
} */

.message pre {
  border: 1px solid #333;
  background-color: #00000030;
  padding: 10px;
  border-radius: 8px;
  text-align: left;
  text-wrap: initial;
}

.message img {
  margin: 10px 0;
  width: min(60%, 200px);
}

/* Semantic layout classes */
.chat-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  height: calc(100% - 30px);
  min-height: 0;
}

.messages-section {
  grid-row: 1;
  grid-column: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.message-form-field {
  display: flex;
  gap: 10px;
}

.message-input {
  flex: 1;
  resize: none;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.scrollable-content {
  overflow-y: auto;
  min-height: 0;
  height: calc(100% - 90px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.full-height-layout {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  min-height: 0;
}

.members-section {
  grid-row: 1;
  grid-column: 2;
}

.message-own-alignment {
  align-self: right;
  text-align: right;
}

.message-meta {
  font-size: 0.8em;
  color: gray;
  margin-bottom: 5px;
  margin-left: 10px;
}

.attachment-image-own {
  max-width: 100%;
  height: auto;
}

.attachment-image-other {
  max-width: 200px;
  height: auto;
}

.form-field-flex {
  display: flex;
  gap: 10px;
}

.form-input-flex {
  flex: 1;
}

.btn-margin {
  margin: 5px;
}

.btn-no-margin {
  margin: 0;
}

.text-no-margin {
  margin: 0;
}

.link-no-decoration {
  text-decoration: none;
  color: white;
}

.image-width-300 {
  width: 300px;
}

.image-auto-height {
  height: auto;
}

.grid-form-field {
  grid-row: 3;
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
}

.vertical-align-middle {
  vertical-align: middle;
}

.padding-10 {
  padding: 10px;
}

.gap-20 {
  gap: 20px;
}

.error-messages {
  color: red;
}

.chats-layout {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: calc(100% - 50px);
  min-height: 0;
}

.chats-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chats-list {
  overflow-y: auto;
  min-height: 0;
  height: calc(100% - 100px);
}

.chat-link {
  text-decoration: none;
  color: white;
}

.label-block {
  display: block;
}

.users-layout {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  min-height: 0;
}

.users-list {
  overflow-y: auto;
  min-height: 0;
  height: calc(100% - 100px);
}

.attachment-icon {
  font-size: 2em;
}

.vertical-align-middle {
  vertical-align: middle;
}

.padding-10 {
  padding: 10px;
}

.flash-notice {
  color: green;
}

.flash-alert {
  color: red;
}

.overflow-hidden {
  overflow: hidden;
}

.overflow-hidden-x {
  overflow-x: hidden;
}

.overflow-hidden-y {
  overflow-y: hidden;
}