/* Base Styles */
* { box-sizing: border-box; }
html, body {
  height: 100%;    
  margin: 0;
}
body {
  font-family: 'Permanent Marker', cursive;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #1a1a1a;
  background-size: cover;
  color: #eee;
  transition: background 0.5s, color 0.5s;
}
body.light-theme {
  background: #f4f4f4;
  background-size: cover;
  color: #333;
}

#app-container {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-radius: 30px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(0,0,0,0.1), rgba(0,0,0,0.4));   
  background-size: cover;
  box-shadow: 0 6px 12px rgba(0,0,0,0.7);
  margin-top: 128px;
}

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(1800deg); }
}

body.light-theme #app-container {
  background: #fff;
  background-size: cover;
}
/* Account Page */
#account-page {
  padding: 10px;
  text-align: center;
  background-size: cover;
  color: #fff;
  height: 100%;
  overflow: auto;
  margin-top: 5vh;
  border-radius: 35px 35px 0 0;
  background: linear-gradient(-135deg, black, #1a1a1a);
}

#account-page h2 { margin-bottom: 10px; font-size: 1.8em; }
#account-page input, #account-page button {
  width: 90%;
  padding: 12px;
  margin: 10px auto;      
  border: none;
  border-radius: 0 25px 0 25px;
  font-size: 1em;
  display: block;
  
}

#account-page input {
  outline: 0;
  background: rgba(0,0,0,0.5);
  background-size: cover;
  color: #00ff81;
  transition: all 0.9s ease;
  box-shadow: 0 0 5px #ff0088;    
}

#account-page input:focus {
  animation: borderGlow 3s infinite;
}

.typing-container {
  border-right: 3px solid #00ffcc;
  white-space: nowrap;
  overflow: hidden;
  display: inline-block;
  font-family: monospace;
  white-space: pre-wrap;
  word-wrap: break-word;
}

@keyframes blink {
  50% { border-color: transparent; }
}

#account-page button {
  background: linear-gradient(135deg, #00ff96, #00c0ff);
  background-size: cover;
  color: black;
  cursor: pointer;
  transition: background 0.3s;
  font-weight: bold;
}

#account-page button:hover { 
  background: linear-gradient(135deg, #ce00ff, #00ffd5);
  background-size: cover;
  
}

.cr {
  animation: bg 5s infinite;
}

@keyframes bg {
  0% {
    text-shadow: 0 0 10px rgba(255, 64, 129, 1), 0 0 10px rgba(255, 64, 129, 0.7), 0 0 10px rgba(255, 64, 129, 0.5);
  }
  25% {
    text-shadow: 0 0 5px rgba(68, 138, 255, 1), 0 0 10px rgba(68, 138, 255, 0.7), 0 0 10px rgba(68, 138, 255, 0.5);
  }
  50% {
    text-shadow: 0 0 10px rgba(0, 230, 118, 1), 0 0 5px rgba(0, 230, 118, 0.7), 0 0 20px rgba(0, 230, 118, 0.5);
  }
  75% {
    text-shadow: 0 0 5px rgba(255, 235, 59, 1), 0 0 10px rgba(255, 235, 59, 0.7), 0 0 5px rgba(255, 235, 59, 0.5);
  }
  100% {
    text-shadow: 0 0 5px rgba(255, 64, 129, 1), 0 0 10px rgba(255, 64, 129, 0.7), 0 0 20px rgba(255, 64, 129, 0.5);
  }
}

#chat-page {
  position: relative; 
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  margin-top: 20px;
}

/* Chat Header */
#chat-header {
  background: linear-gradient(135deg, #006960, #00ffea);
  background-size: cover;
  color: #fff;
  padding: 2px;
  padding-right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
  margin-bottom: 0;
  z-index: 100;
}

#header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

#online-status {
  font-size: 0.7em;
  background: #4caf50;
  background-size: cover;
  padding: 4px 4px;
  border-radius: 12px;
  margin: 5px;
  display: flex;
  grid-column-gap: 3px;
}

#header-right { display: flex; align-items: center; }
#settings-btn { background: transparent; border: none; cursor: pointer; }
#settings-btn img { width: 30px; height: 30px; }

#refresh-btn { background: transparent; border: none; cursor: pointer; }
#refresh-btn img { width: 30px; height: 30px; }

/* Typing Indicator */
#typing-indicator {
  padding: 1px 10px;
  font-size: 0.8em;
  color: #fff;
  /* display: none; */
}

/* Messages Container: ensure vertical scrolling */
#messages-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  background: transparent;
  background-size: cover;
  padding: 5px;
  /* Ensure messages don't hide behind the fixed input */
  padding-bottom: 180px;
  padding-top: 35px;
  height: 90vh;
}

/* Input Area: fixed at the bottom center, disconnected from the app container */
#input-area {
  position: fixed;      
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 950px;     
  background: #2e2e2e;
  padding: 10px;
  border-radius: 30px 30px 0 0;
}

/* Message bubble styling */
.message {
  margin-bottom: 18px;
  animation: fadeIn 0.3s ease-in-out;
  display: flex;
  align-items: flex-start;
  z-index: 50;
}

.message.incoming { 
  flex-direction: row; 
}

.message.outgoing { 
  flex-direction: row-reverse; 
}

.profile-pic {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 2px;
  cursor: pointer;
  border: 2px solid white;
}

.message-content {
  flex: 1;
  padding: 5px 5px;
  background: white;            
  color: #1a1a1a;
  border-radius: 14px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
  position: relative;
  font-size: 12px;
  overflow-x: auto;
  height: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.sender-name { 
  font-weight: bold;
  margin-bottom: 10px; 
  margin-top: 25px; 
  font-size: 13px;
}

.message-time {
  font-size: 0.9em;
  color: #777;
  margin-top: 8px;
  margin-bottom: 5px;    
  text-align: right;
  color: black;
}

.mention {
  background: #00c0ff;
  padding: 0 2px;
  border-radius: 3px;
  color: #1100ff;
  font-weight: bold;
}

.bubble-actions {
  position: absolute;
  top: 2px;
  right: 5px;
  display: flex;
  gap: 2px;
}

.bubble-actions button {
  background: transparent;
  border: none;
  cursor: pointer;
  transition: opacity 0.5s;
}

#account-page input::placeholder {
  color: rgba(100, 255, 255, 0.8);
  text-shadow: 0 0 3px #00ffab;
  font-size: 14px; 
  font-weight: bold;
}

#account-page input:focus::placeholder {
  color: rgba(255, 255, 255, 0.6);
  text-shadow: 0 0 3px #ff0088;
}

.bubble-actions button:hover { opacity: 0.8; }

.emoji-popup {
  position: absolute;
  bottom: 80%;
  right: 0;
  background: linear-gradient(135deg, #1e243c, #1a1a1a);
  border: 2px solid #00ff96;
  border-radius: 10px;
  display: flex;
  gap: 5px;
  padding: 5px;
  z-index: 10;
  overflow: auto;
  max-width: 250px;
}

.emoji-popup span { cursor: pointer; font-size: 1.5em; }

/* HTML Sample Panel */
#sample-panel {
  margin-bottom: 10px;   
  padding: 3px 3px;
  background: #222;
  border-radius: 18px;
  max-height: 350px;
  margin-bottom: 10px;
  overflow-x: auto;
  white-space: nowrap;
  padding: 3px 5px;
}

/* Chat Input Row */
.input-row { position: relative; }

#message-input {
  width: 100%;
  padding: 8px 45px;
  padding-right: 30px;
  border: 1px solid #00ff96;
  border-radius: 25px;
  resize: vertical;
  min-height: 20px;
  font-size: 1em;
  background: #1a1a1a;
  color: #eee;
  outline: none;
  white-space: pre-wrap;
  resize: none;
}

#message-input::placeholder {
  color: #ffffff;
}

#send-btn {
  position: absolute;
  right: 0;
  bottom: 13px;
  padding: 1px;
  background: transparent;
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.4s;
  margin-right: 10px;
}

#send-btn:hover { 
  transform: scale(1.3);
  border-radius: 50%;
  cursor: pointer;
  filter: drop-shadow(0 0 7px #15ffcb);
}

#img-upload-btn {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-60%);      
  background: #444;      
  border: none;
  border-radius: 50%;
  padding: 0 1px;
  cursor: pointer;
  outline: none;
  color: #fff;      
  filter: drop-shadow(0 0 5px #0ff);
}

#image-input { display: none; }

/* Fullscreen Modal */
#fs-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
}

#fs-content {
  background: #fff;
  padding: 2px;
  border-radius: 8px;
  max-width: 95%;
  max-height: 95%;
  overflow: auto;
  color: #333;
}

#fs-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #f44336;
  color: #fff;
  border: none;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 4px;
}

#settings-modal {
  display: none;
  position: fixed;
  z-index: 11000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.3);
  justify-content: center;
  align-items: center;
}

#settings-content {
  background: #fff;
  padding: 20px;
  border-radius: 18px;
  max-width: 450px;
  width: 90%;
  font-family: 'Open Sans', sans-serif;
  color: #00ff96;
  backdrop-filter: blur(6px);
  background: rgba(0,0,0,0.3);
  overflow-y: auto;
  scroll-snap-align: center;
  max-height: 650px;
}

#settings-content h3 { text-align: center; margin-top: 0; }
#settings-content h4 { margin-bottom: 20px; }

#settings-content input,
#settings-content select,
#settings-content button {
  width: 100%;
  padding: 10px;
  margin: 14px 0;
  border: 0;
  border-radius: 30px;
  font-size: 1em;
  background: rgba(0,0,0,0.3);      
  color: #00ff96;
  outline: 0;
}

#settings-content button:hover {
  width: 100%;
  padding: 7px;
  margin: 8px 0;
  border: 0;
  border-radius: 35px;
  font-size: 1em;
  background: rgba(0,0,0,1);
  transform: scale(0.95);
  color: #ffffff;
  outline: 0;
}

#settings-content input, select {
  transition: all 0.5s ease;
  box-shadow: 0 0 5px #00ff96;
}

#settings-content input:focus {
  border-color: #6e8efb;
  box-shadow: 0 0 8px #ff0073;
}


#settings-content input::placeholder{
   color: rgba(0,255,230,0.7);
   text-shadow: #00ff96;
}


#settings-content button {
  background: rgba(0,0,0,0.4);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-family: 'Permanent Marker', cursive;
  text-decoration: none;
  color: #00ff96;
  box-shadow: 0 0 5px #00ff96;
}

.h1 {
  font-size: 25px;
  background: linear-gradient(45deg, #00ffff, #00ffab);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 20px 20px 12px #00ffab;
  text-align: center;
}

#settings-content button img, #create-acc-btn img { width: 38px; height: 38px; }

#create-acc-btn img, .url {
  width: 16px; 
  height: 16px;
  transform: translateY(3px);
  margin-left: 5px;
  margin-right: 5px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Popup Notification */
#popup-notification {
  position: fixed;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(45deg, #ff6a00, #ee0979);
  color: #fff;
  padding: 15px 25px;
  border-radius: 30px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.5s, transform 0.5s;
  z-index: 1200;
  font-family: 'Permanent Marker', cursive;
}

label {
  font-weight: bold;
  font-size: 0.8rem;

}

@keyframes borderGlow {
  0% { box-shadow: 0 0 5px #ff0088; }
  50% { box-shadow: 0 0 15px #00ffea; }
  100% { box-shadow: 0 0 5px #ff0088; }
}


   #settings-content input[type="range"] {
      -webkit-appearance: none;
      width: 100%;
      height: 8px;
      background: transparent;
      border-radius: 10px;
      outline: none;
      transition: all 0.3s;
      position: relative;
    }

   #settings-content input[type="range"]::-webkit-slider-thumb {
      -webkit-appearance: none;
      width: 28px;
      height: 28px;
      background: transparent;
      border-radius: 50% 0 50% 0;
      cursor: pointer;
      box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      border: 3px solid #fff;
    }

  #settings-content input[type="range"]::-webkit-slider-thumb:hover {
      transform: scale(1.1);
      box-shadow: 0 6px 20px #00ffab;
    }

  #settings-content  input[type="range"]::-moz-range-thumb {
      width: 24px;
      height: 24px;
      background: transparent;
      border-radius: 50%;
      cursor: pointer;
      box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
      border: 3px solid #fff;
    }
    
    
    .chat-icon{
      height: 17px;
      width: 17px;
   }