@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

* {
  box-sizing: border-box;
}

body {
  background: #0a0a0a;
  color: #ccf2ff;
  font-family: 'Share Tech Mono', monospace;
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.scanlines::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(to bottom,
      rgba(204, 242, 255, 0.03),
      rgba(204, 242, 255, 0.03) 2px,
      transparent 2px,
      transparent 4px);
  pointer-events: none;
  z-index: 999;
}

.header {
  text-align: center;
  padding: 1rem;
  font-size: 1.2rem;
  border-bottom: 1px solid #444;
  background-color: #111;
  color: #ff004c;
  text-shadow: 0 0 5px #ff004c;
}

.chat-box {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
}

.msg {
  margin-bottom: 1.5rem;
  animation: flicker 0.8s ease;
}

.msg-user {
  color: #fa5555;
}

.msg-text {
  margin-left: 1rem;
}

.input-box {
  display: flex;
  border-top: 1px solid #444;
  padding: 1rem;
  background: #121212;
  gap: 0.5rem;
}

input {
  flex: 1;
  padding: 0.5rem;
  background: #0a0a0a;
  border: 1px solid #333;
  color: #ccf2ff;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
}

button {
  background: #ff004c;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  font-family: inherit;
  cursor: pointer;
}

.file-upload-btn {
  background: #00ff9d;
  color: #000;
  min-width: auto;
  position: relative;
  overflow: hidden;
}

.file-upload-btn:hover {
  background: #00cc7a;
}

.file-upload-btn input[type="file"] {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.divergence {
  position: fixed;
  top: 10px;
  right: 20px;
  font-size: 0.8rem;
  background: rgba(255, 0, 76, 0.08);
  border: 1px solid #ff004c;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  color: #ff004c;
  text-shadow: 0 0 4px #ff004c;
}

@keyframes flicker {
  0% {
    opacity: 0;
    transform: scale(0.98);
  }

  40% {
    opacity: 1;
  }

  70% {
    opacity: 0.5;
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Sidebar styles */
.status-indicator {
  font-size: 0.8rem;
  margin-top: 0.3rem;
  color: #00ff9d;
}

.nav-icon {
  margin-right: 8px;
  font-size: 1.1em;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 2rem;
  font-size: 0.8rem;
  color: #888;
  border-top: 1px solid #333;
  padding-top: 1rem;
  margin-top: 2rem;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
}

.sys-label {
  color: #888;
  font-size: 0.8rem;
}

.status-indicator {
  font-size: 1rem;
  color: #00ff9d;
  transition: color 0.3s ease;
}

.status-text {
  color: #ccf2ff;
  font-size: 0.8rem;
}

.status-nominal {
  color: #00ff9d;
}

.status-slow {
  color: #ffaa00;
}

.status-offline {
  color: #ff004c;
}

.status-ok {
  color: #00ff9d;
}

.version-info {
  opacity: 0.7;
}

.sidebar {
  width: 250px;
  height: 100vh;
  background-color: #111;
  border-right: 1px solid #444;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.logo img {
  max-width: 80%;
  height: auto;
  filter: drop-shadow(0 0 5px rgba(255, 0, 76, 0.7));
}

.user-info {
  margin-bottom: 2rem;
  padding: 0.8rem;
  background: rgba(255, 0, 76, 0.08);
  border: 1px solid #ff004c;
  color: #ccf2ff;
  text-align: center;
  font-size: 0.9rem;
}

.user-info p {
  margin: 0;
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

nav li {
  margin-bottom: 0.8rem;
}

nav a {
  display: block;
  padding: 0.7rem 1rem;
  text-decoration: none;
  color: #ccf2ff;
  background: rgba(204, 242, 255, 0.05);
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

nav a:hover,
nav a.active {
  background: rgba(255, 0, 76, 0.1);
  border-left-color: #ff004c;
  text-shadow: 0 0 3px rgba(255, 0, 76, 0.7);
}

/* Main content adjustment to make room for sidebar */
.header,
.chat-box,
.input-box {
  margin-left: 250px;
  width: calc(100% - 250px);
}

/* Media query for mobile responsiveness */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: 220px;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .header,
  .chat-box,
  .input-box {
    margin-left: 0;
    width: 100%;
  }

  .menu-toggle {
    display: block;
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 101;
    background: none;
    border: none;
    color: #ff004c;
    font-size: 1.5rem;
    cursor: pointer;
  }
}

/* Animation for when sidebar items load */
nav a {
  animation: pulse 1s ease-in-out;
  animation-fill-mode: backwards;
}

nav li:nth-child(1) a {
  animation-delay: 0.1s;
}

nav li:nth-child(2) a {
  animation-delay: 0.2s;
}

nav li:nth-child(3) a {
  animation-delay: 0.3s;
}

nav li:nth-child(4) a {
  animation-delay: 0.4s;
}

@keyframes pulse {
  0% {
    opacity: 0;
    transform: translateX(-10px);
  }

  70% {
    opacity: 0.7;
    transform: translateX(5px);
  }

  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Room selector styles */
.room-selector {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.section-header {
  color: #ff004c;
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
  padding-left: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.expand-icon {
  font-size: 0.7rem;
  transition: transform 0.3s ease;
}

.expand-icon.collapsed {
  transform: rotate(-90deg);
}

.room-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 300px;
  overflow-y: auto;
  transition: max-height 0.3s ease;
}

.room-list.collapsed {
  max-height: 0;
  overflow: hidden;
}

.room {
  padding: 0.5rem 0.8rem;
  margin-bottom: 0.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  border-radius: 3px;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  position: relative;
}

.room:hover {
  background: rgba(204, 242, 255, 0.05);
}

.room.active {
  background: rgba(255, 0, 76, 0.1);
  color: #ccf2ff;
  text-shadow: 0 0 3px rgba(204, 242, 255, 0.5);
}

.room-icon {
  margin-right: 8px;
  font-size: 0.8em;
}

.room.active .room-icon {
  color: #00ff9d;
}

.unread-badge {
  position: absolute;
  right: 8px;
  background: #ff004c;
  color: #fff;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  min-width: 1.2rem;
  text-align: center;
}

.private-indicator {
  position: absolute;
  right: 8px;
  background: #444;
  color: #ccc;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

.add-room {
  color: #888;
  border: 1px dashed #444;
  margin-top: 0.5rem;
}

.add-room:hover {
  border-color: #ff004c;
  color: #ff004c;
}

/* Custom scrollbar for room list */
.room-list::-webkit-scrollbar {
  width: 4px;
}

.room-list::-webkit-scrollbar-track {
  background: #111;
}

.room-list::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 2px;
}

.room-list::-webkit-scrollbar-thumb:hover {
  background: #ff004c;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
  background-color: #111;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #ff004c;
  width: 300px;
  color: #ccf2ff;
  font-family: 'Share Tech Mono', monospace;
}

.close {
  color: #ff004c;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: #fff;
}

.modal input {
  width: 100%;
  margin: 10px 0;
  padding: 8px;
  background: #0a0a0a;
  border: 1px solid #333;
  color: #ccf2ff;
  font-family: inherit;
}

.modal button {
  width: 100%;
  margin: 10px 0;
  padding: 10px;
  background: #ff004c;
  border: none;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
}

.error-message {
  color: #ff004c;
  margin: 10px 0;
  font-size: 0.9rem;
}

/* Additional styles for inbox feature */
.inbox-badge {
  background: #ff004c;
  color: #fff;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  margin-left: 0.5rem;
  min-width: 1.2rem;
  text-align: center;
  display: inline-block;
}

.inbox-modal {
  width: 600px;
  max-width: 90vw;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #333;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.modal-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.send-btn {
  background: #00ff9d;
  color: #000;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
}

.send-btn:hover {
  background: #00cc7a;
}

.inbox-messages {
  flex: 1;
  overflow-y: auto;
  max-height: 400px;
}

.inbox-message {
  border: 1px solid #333;
  margin-bottom: 1rem;
  padding: 1rem;
  background: rgba(204, 242, 255, 0.02);
}

.message-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.sender-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-right: 0.5rem;
  border: 1px solid #333;
}

.message-info {
  flex: 1;
}

.sender-name {
  color: #ff004c;
  font-weight: bold;
  margin-right: 1rem;
}

.message-time {
  color: #888;
  font-size: 0.8rem;
}

.delete-btn {
  background: none;
  border: none;
  color: #ff004c;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.1rem 0.2rem;
  width: 1.6em;
  min-width: 0;
  max-width: 2em;
}

.delete-btn:hover {
  color: #fff;
  background: #000000;
}

.message-content {
  margin-top: 0.5rem;
  line-height: 1.4;
}

.no-messages {
  text-align: center;
  color: #888;
  padding: 2rem;
}

#messageText {
  width: 100%;
  min-height: 80px;
  resize: vertical;
  background: #0a0a0a;
  border: 1px solid #333;
  color: #ccf2ff;
  font-family: inherit;
  padding: 0.5rem;
}

/* Scrollbar for inbox messages */
.inbox-messages::-webkit-scrollbar {
  width: 6px;
}

.inbox-messages::-webkit-scrollbar-track {
  background: #111;
}

.inbox-messages::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

.inbox-messages::-webkit-scrollbar-thumb:hover {
  background: #ff004c;
}

/* File link styles */
.file-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 255, 157, 0.1);
  border: 1px solid #00ff9d;
  padding: 0.5rem 0.8rem;
  margin: 0.5rem 0;
  border-radius: 3px;
  text-decoration: none;
  color: #00ff9d;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.file-link:hover {
  background: rgba(0, 255, 157, 0.2);
  transform: scale(1.02);
}

.file-icon {
  font-size: 1.1rem;
}

.file-name {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  color: #888;
  font-size: 0.8rem;
}

/* File upload progress */
.upload-progress {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #111;
  border: 1px solid #ff004c;
  padding: 2rem;
  border-radius: 5px;
  z-index: 1001;
  color: #ccf2ff;
  font-family: 'Share Tech Mono', monospace;
  text-align: center;
}

.progress-bar {
  width: 200px;
  height: 10px;
  background: #333;
  border-radius: 5px;
  overflow: hidden;
  margin: 1rem 0;
}

.progress-fill {
  height: 100%;
  background: #00ff9d;
  width: 0%;
  transition: width 0.3s ease;
}

/* Download warning modal */
.warning-modal .modal-content {
  width: 400px;
  max-width: 90vw;
}

.warning-header {
  color: #ff6b35;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.warning-icon {
  font-size: 1.5rem;
}

.warning-content {
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.file-info {
  background: rgba(255, 107, 53, 0.1);
  border: 1px solid #ff6b35;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 3px;
}

.warning-buttons {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.warning-buttons button {
  width: auto;
  margin: 0;
  padding: 0.5rem 1rem;
}

.btn-proceed {
  background: #ff6b35;
}

.btn-cancel {
  background: #666;
}

.disable-warnings {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.disable-warnings input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.download-btn {
  background: #ff004c;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  margin-left: 5px;
}

.download-btn:hover {
  background: #cc0039;
}

.private-indicator {
  margin-left: 0.5rem;
  font-size: 0.8em;
  color: #ff6b35;
}

/* Room details section */
.room-details {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(255, 0, 76, 0.05);
  border: 1px solid rgba(255, 0, 76, 0.2);
  border-radius: 3px;
}

.room-details p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.room-settings-btn {
  width: 100%;
  margin-top: 1rem;
  background: rgba(255, 0, 76, 0.2);
  color: #ccf2ff;
  border: 1px solid #ff004c;
  padding: 0.5rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
}

.room-settings-btn:hover {
  background: rgba(255, 0, 76, 0.3);
}

/* Room members modal */
.members-list {
  max-height: 400px;
  overflow-y: auto;
  margin-top: 1rem;
}

.room-member {
  display: flex;
  align-items: center;
  padding: 0.8rem;
  margin-bottom: 0.5rem;
  background: rgba(204, 242, 255, 0.03);
  border-radius: 3px;
}

.member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 1rem;
  border: 1px solid #333;
}

.member-name {
  flex: 1;
  color: #ccf2ff;
}

.view-profile-btn {
  background: rgba(0, 255, 157, 0.1);
  color: #00ff9d;
  border: 1px solid #00ff9d;
  padding: 0.3rem 0.8rem;
  border-radius: 3px;
  text-decoration: none;
  font-size: 0.8rem;
  margin-left: 1rem;
}

.view-profile-btn:hover {
  background: rgba(0, 255, 157, 0.2);
}

.chat-link {
  color: #00ff9d;
  text-decoration: underline;
  cursor: pointer;
  word-break: break-all;
}

.chat-link:hover {
  text-shadow: 0 0 5px #00ff9d;
  color: #fff;
}