body,
html {
 display: flex;
 flex-direction: column;
 justify-content: center;
 align-items: center;
 width: 100vw;
 height: 100vh;
left: 0;
right: 0;
top: 0;
 background-color: black;
 color: white;
  font-family: 'Patrick Hand', cursive;
  overflow-x: hidden;
  background-image: url('images/BG.png');
  background-size: contain;
  background-position: center;
  background-attachment: fixed;
  overflow-y: auto;
}

/* Specific chat page overflow handling */
.chat-container, #notes {
  overflow-x: auto;
  max-width: 100vw;
  box-sizing: border-box;
}

/* Mobile: Allow horizontal scrolling on chat page */
@media (max-width: 768px) {
  body, html {
    overflow-x: auto;
  }
  
  /* Chat page container allows horizontal scroll if needed */
  .chat-container, #notes {
    overflow-x: auto;
    overflow-y: auto;
  }
  
  /* Ensure wide content can scroll horizontally */
  #notes .note {
    max-width: 95vw;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  /* Allow horizontal scroll for any wide elements */
  * {
    max-width: 100vw;
    box-sizing: border-box;
  }
}

h3 {
 width: 100vw;
 text-align: center;
 color: #b86bff;
 font-size: 35px;
  position: absolute;
  top: 3%;
  background-color: rgba(0, 0, 0, 0.5);
  left: 0;
  right: 0;
}

canvas {
 background-color: white;
 color: black;
 cursor: crosshair;
 left: 0;
 right: 0;
}

.left-panel {
 width: 100vw;
 height: 100vh;
  position: fixed;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

 padding: 10px;
}

.right-panel {
 width: 100%;
 padding: 10px;
 display: none;
  overflow-x: hidden;
}

.buttons {
 padding-top: 10px;
 padding-bottom: 10px;
 width: 100vw;
 justify-content: space-between;
  font-family: 'Patrick Hand', cursive;
}

.note-input {
 margin-bottom: 10px;
}

.note {
 margin-bottom: 20px;
 padding: 10px;
 border-bottom: 1px solid #555;

}

.note-name {
 font-weight: bold;
}

.note-name i {
 margin-right: 20px;
}

.note-date {
 color: #b86bff; /* Gold color for date */
 font-size: 20px;
 margin-left: 2px;
}

.note-date i {
 margin-right: 25px;
}

.note-time {
 color: #00ff00; /* Green color for time */
}

.note-content {
 color: #ffffff; /* White color for note content */
  font-size: 20px;
}

/* Load Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;700&display=swap");

.buttons {
 display: flex;
 justify-content: center; /* Center items horizontally */
 align-items: center; /* Center items vertically */
 margin-left: 10px;
 margin-right: 10px;
 width: 90%;
 left: 0;
}

.addNameContainer {
 display: flex;
 justify-content: center; /* Center items horizontally */
 align-items: center; /* Center items vertically */
 margin-left: 10px;
 margin-right: 10px;
 width: 100vw;
 left: 0;
}

#memberName {
 width: 100%;
 height: 35px;
 background-color: #333;
 font-size: 20px;
 color: white;
 border: 1px solid #555;
 border-radius: 5px;
 padding-left: 10px;
 padding-right: 10px;
  font-family: 'Patrick Hand', cursive;
}

#addName,
.buttons button {
 width: 100%;
 height: 40px;
 background-color: #222;
 color: white;
 border: 1px solid #555;
 border-radius: 5px;
 font-size: 16px;
 cursor: pointer;
  font-family: 'Patrick Hand', cursive;
}

#addName:hover,
.buttons button:hover {
 background-color: purple;
}

#selectName {
display: flex;
 justify-content: center;
 align-items: center; /* Center items vertically */
 margin-left: 10px;
 margin-right: 10px;
 width: 100%;
 left: 0;
}

#nameSelector {
 width: 100%;
 height: 40px;
 background-color: #111;
 color: lime;
 border: 1px solid #555;
 border-radius: 5px;
 text-align: center;
 font-size: 25px;
  font-family: 'Patrick Hand', cursive;
}
#deleteName {
 width: 100%;
 height: 40px;
 background-color:#222;
 color: red;
 border: 1px solid #555;
 border-radius: 5px;
 text-align: center;
 font-size: 16px;
  font-family: 'Patrick Hand', cursive;
}

#deleteName:hover {
 background-color: purple;
}

#eraseButton {
 color: red;
}
#updateButton {
 color: lime;
}

#writeMessage,
#closeMessage {
  position: fixed;
  top: 0;
  width: 100vw;
  left: 0;
  right: 0;
  text-align: center;
  color: white;
  font-size: 16px;
  cursor: pointer;
  height: auto;
  background-color: black;
  padding-top: 20px;
  padding-bottom: 20px;
  border-bottom: 2px solid #b86bff;
}

#closeMessage {
 margin-bottom: 20px
}
#writeMessage:hover,
#closeMessage:hover {
 color: red;
 background-color: #111;
}

#noteInput {
 position: fixed;
 bottom: 0;
left: 0;
 right: 0;
 width: 100vw;
 height: 50px;
 background-color: black;
 font-size: 20px;
 color: white;
 border: none;
 border-top: 1px solid #b86bff;
z-index: 9999;
 padding-left: 20px;
 padding-right: 20px;
 padding-top: 10px;
  font-family: 'Patrick Hand', cursive;

}

footer {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: 100%;
}

footer p {
  font-size: 14px;
  color: white;
}

#notes {
  position: absolute;
  top: 16%;
  bottom: 0; /* Extend to the bottom of the viewport */
  max-height: 70vh; /* Adjust this value as needed */
  overflow-y: auto;
  overflow-x: hidden;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  border: 2px solid #b86bff;
  border-radius: 10px;
  padding-top: 10px;
  padding-left: 20px;
  padding-right: 20px;
  padding-bottom: 120px; /* Increase padding to match input field height */
  background-color: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
  font-size: 20px;
  margin-bottom: 100px; /* Added margin-bottom */
  display: flex;
  flex-direction: column;
}

.note-delete {
  float: right;
  margin-right: 5%; /* Change this value to adjust the position */
}

.note-delete:hover {
  color: red;
}

#resetNameIcon {
position: fixed;
top: 8%;
left: 2%;
color: #b86bff;
font-size: 10px;
  cursor: pointer;
  border-radius: 5px;
  padding: 10px;
  box-shadow: 0 0 10px rgb(247, 247, 247, 0.6);
  z-index: 9999;
}

@media (max-width: 768px) {
  #resetNameIcon {
    font-size: 16px;
    padding: 15px;
    top: 12%;
    left: 3%;
  }
}

#resetNameIcon:hover {

color: white;

  box-shadow: 0 0 10px rgb(68, 255, 0, 0.9);

}

.notification {
    display: none;
    position: fixed;
  text-align: center;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: black;
    color: lime;
    padding: 20px;
    font-size: 2em;
    border-radius: 10px;
    z-index: 1000;
    padding: 20px;
   box-shadow: 0 0 20px rgb(247, 247, 247, 0.3);
}

#audioControl {
position: fixed;
top: 1%;
right: 5%;
color: red;
z-index: 9999999999;
background-color: rgb(0, 0, 0, 0.5);
padding: 8px;
border-radius: 10px;
cursor: pointer;
font-size: 12px;
  box-shadow: 0 0 15px rgb(250, 250, 250, 0.5);
}

/* Mobile responsive for header icons */
@media (max-width: 768px) {
  #audioControl {
    font-size: 14px;
    padding: 8px;
    top: 2%;
    right: 3%;
  }
}

#inputContainer #inputIcons {
display: flex;
  position: fixed;
  bottom: 80px;
flex-direction: row;
justify-content: flex-start;
align-items: center;
  gap: 2px;
  left: 2%;
  right: 2%;
  width: calc(96% - 20px);
  max-width: 100vw;
  z-index: 9999999999;
  cursor: pointer;
  font-size: 14px;
  padding: 0 10px;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}

#inputContainer #inputIcons i {
  font-size: 30px !important;
  padding: 4px !important;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}

/* NO CONFLICTS - All icons handled by general rule above */


/* Ensure input container doesn't overflow */
#inputContainer {
  max-width: 100vw;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* File Attachments & Documents */
.file-attachment {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(145deg, rgba(44, 44, 44, 0.9), rgba(60, 60, 60, 0.7));
  padding: 25px;
  border-radius: 16px;
  margin: 20px auto;
  border: 1px solid rgba(184, 107, 255, 0.3);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  max-width: 95%;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.file-attachment:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(184, 107, 255, 0.3);
  border-color: rgba(184, 107, 255, 0.5);
}

.file-attachment i {
  margin-right: 10px;
  font-size: 24px;
  color: #b86bff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* PDFs & Documents */
.file-attachment iframe {
  border-radius: 12px;
  background-color: #fff;
  margin: 15px 0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(184, 107, 255, 0.3);
  transition: all 0.3s ease;
  max-width: 100%;
  min-height: 400px;
}

.file-attachment iframe:hover {
  box-shadow: 0 8px 25px rgba(184, 107, 255, 0.4);
  border-color: rgba(184, 107, 255, 0.6);
}

/* Download & Action Links */
.file-attachment a {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  margin: 8px;
  background: linear-gradient(145deg, rgba(184, 107, 255, 0.2), rgba(184, 107, 255, 0.1));
  border: 1px solid rgba(184, 107, 255, 0.4);
  border-radius: 25px;
  color: #b86bff;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.file-attachment a:hover {
  background: linear-gradient(145deg, rgba(184, 107, 255, 0.4), rgba(184, 107, 255, 0.2));
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(184, 107, 255, 0.3);
}

.file-attachment a i {
  margin-right: 8px;
  font-size: 16px;
}

/* ============================================ */
/* PERFECT CENTERED MEDIA DISPLAY - RESTORED */
/* ============================================ */

/* Universal Media Container - PERFECTLY CENTERED */
.media-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-align: center;
  margin: 15px auto;
  padding: 0;
  background: transparent;
}

/* Images & GIFs - PERFECTLY CENTERED */
.uploaded-image, .gif-image {
  display: block;
  margin: 15px auto;
  max-width: 90%;
  max-height: 500px;
  width: auto;
  height: auto;
  cursor: pointer;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
  object-fit: contain;
  border: 2px solid rgba(184, 107, 255, 0.3);
  background: transparent;
}

.uploaded-image:hover, .gif-image:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(184, 107, 255, 0.4);
  border-color: rgba(184, 107, 255, 0.6);
}

/* Videos - PERFECTLY CENTERED */
.media-container video {
  display: block;
  margin: 15px auto;
  border-radius: 12px;
  background-color: #000;
  max-width: 90%;
  max-height: 400px;
  width: auto;
  height: auto;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(184, 107, 255, 0.3);
  transition: all 0.3s ease;
}

.media-container video:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 25px rgba(184, 107, 255, 0.4);
  border-color: rgba(184, 107, 255, 0.6);
}

/* Audio Players - PERFECTLY CENTERED */
.media-container audio {
  display: block;
  margin: 15px auto;
  background: linear-gradient(145deg, #1a1a1a, #2d2d2d);
  border-radius: 25px;
  width: 90%;
  max-width: 450px;
  height: 50px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(184, 107, 255, 0.3);
  transition: all 0.3s ease;
}

.media-container audio:hover {
  box-shadow: 0 6px 20px rgba(184, 107, 255, 0.4);
  border-color: rgba(184, 107, 255, 0.6);
}

/* SVG Images */
.media-display svg, .uploaded-image[src$=".svg"] {
  max-width: 350px;
  max-height: 350px;
  background: rgba(255, 255, 255, 0.05);
  padding: 15px;
  border-radius: 12px;
  margin: 10px auto;
}

/* Media Container & Titles - TRANSPARENT */
.media-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 10px 0;
  padding: 0;
  background: transparent;
}

.media-title {
  color: #fff;
  font-size: 14px;
  margin-bottom: 8px;
  font-weight: normal;
  text-align: center;
  text-shadow: none;
  background: transparent;
  padding: 0;
  border-radius: 0;
  border: none;
  backdrop-filter: none;
  display: inline-block;
}

/* Mobile Responsive Media - PROPERLY CENTERED */
@media (max-width: 768px) {
  .uploaded-image, .gif-image {
    max-width: 95%;
    max-height: 400px;
    margin: 15px auto;
  }
  
  .media-container video {
    max-width: 95%;
    max-height: 250px;
    margin: 15px auto;
  }
  
  .media-container audio {
    max-width: 95%;
    margin: 15px auto;
  }
  
  .file-attachment {
    max-width: 95vw;
    padding: 20px 15px;
    margin: 15px auto;
  }
  
  .file-attachment iframe {
    max-width: 100%;
    min-height: 300px;
    margin: 15px auto;
  }
}

@media (max-width: 480px) {
  .uploaded-image, .gif-image {
    max-width: 98%;
    max-height: 350px;
    margin: 15px auto;
  }
  
  .media-container video {
    max-width: 98%;
    max-height: 200px;
    margin: 15px auto;
  }
  
  .media-container audio {
    max-width: 98%;
    margin: 15px auto;
  }
  
  .file-attachment {
    padding: 15px 10px;
    margin: 15px auto;
  }
  
  .file-attachment iframe {
    min-height: 250px;
    margin: 15px auto;
  }
}

.profile-image {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
  margin-right: 15px;
  border: 2px solid white;
  display: inline-block;
  vertical-align: middle;
}

.control-panel {
  position: absolute;
  background-color: rgba(0, 0, 0, 0.9);
  border: 1px solid #b86bff;
  border-radius: 5px;
  padding: 10px;
  z-index: 1000;
  display: flex;
  gap: 10px;
}

.control-panel button {
  background-color: #b86bff;
  border: none;
  color: black;
  padding: 5px 10px;
  cursor: pointer;
  font-family: 'Patrick Hand', cursive;
  font-size: 16px;
  border-radius: 5px;
}

.control-panel button:hover {
  background-color: #864fba;
}

.control-panel button:active {
  background-color: #b86bff;
}

emoji-picker {
    --category-emoji-size: 1.375rem;
    --emoji-size: 1.375rem;
    --emoji-padding: 0.5rem;
    --border-size: 0;
    --background: #000000;
    --indicator-color: #385ac1;
    --input-border-color: #555;
    --input-font-color: #fff;
    --input-placeholder-color: #aaa;
    --num-columns: 8;
    width: 300px;
    height: 400px;
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

emoji-picker::part(emoji) {
    color: initial;
}

emoji-picker::part(nav-button) {
    color: #fff;
}

emoji-picker::part(indicator) {
    background-color: #385ac1;
}

emoji-picker::part(category-name) {
    color: #fff;
}

emoji-picker::part(search-field) {
    background-color: #222;
    color: #fff;
    border: 1px solid #555;
}

#emojiIcon {
    cursor: pointer;
    color: white;
}

#emojiIcon:hover {
    color: #b86bff;
}


/* Add this CSS to your styles.css file */
.clear-all-btn {
    position: fixed;
    top: 10px;
    margin: 0 auto;
    background-color: transparent;
    border: none;
    cursor: pointer;
  z-index: 9999;
}

.clear-all-btn .fa-trash-alt {
    color: white; /* Purple color */
}

.clear-all-btn:hover .fa-trash-alt {
    color: red; /* Lighter purple on hover */
}

#greeting {
position: fixed;
top: 10px;
margin: 0 auto;
font-size: 12px;
  padding: 10px;
  border-radius: 10px;
  background-color: rgba(0, 0, 0, 0.5);
box-shadow: 0 0 10px rgb(255, 255, 255, 0.3);
}

#giphyIcon {
    cursor: pointer;
    color: white;
}

#giphyIcon:hover {
    color: #a061db;
}

#jokeIcon:hover {
    color: #844fb5;
}

#biochemFactIcon {
    cursor: pointer;
    color: white;
}

#biochemFactIcon:hover {
    color: #8e55c3;
}

#moleculeIcon {
    cursor: pointer;
    color: white;
}

#moleculeIcon:hover {
    color: #8b54c0;
}

/* Parent container */
.parent-container {
    position: relative;
}

/* Molecule viewer */
.moleculeViewer {
    position: absolute;
    bottom: 0;
    margin: 0 auto;
    width: 100px;
    height: 100px;
    background-color: #000;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.moleculeViewer canvas {
  width: 100%;
  height: 100%;
  /* Remove margin-top here */
}

#businessAdviceIcon {
    cursor: pointer;
    color: white;
}

#businessAdviceIcon:hover {
    color: #b86bff;
}

#startupTipIcon {
    cursor: pointer;
    color: white;
}

#startupTipIcon:hover {
    color: #b86bff;
}

#toggleOnlineUsers {
    position: fixed;
    top: 10px;
    left: 10px;
    background: rgba(184, 107, 255, 0.8);
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    z-index: 1000;
    font-family: 'Patrick Hand', cursive;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

@media (max-width: 768px) {
  #toggleOnlineUsers {
    font-size: 20px;
    padding: 15px 20px;
    top: 15px;
    left: 15px;
  }
}

#nowPlaying {
    position: fixed;
    top: 10px;
    right: 70px;
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    z-index: 1000;
    font-family: 'Patrick Hand', cursive;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 768px) {
  #nowPlaying {
    position: fixed;
    font-size: 18px;
    padding: 12px 18px;
    top: 90px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: auto;
    text-align: center;
  }
}