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

/* Consistent sizing across inputs and buttons */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Global */
body {
  margin: 0;
  font-family: 'Share Tech Mono', monospace;
  background-color: #0d0d0d;
  color: #d0d0d0;
  overflow: hidden;
}

.login-body, .inbox-body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: radial-gradient(ellipse at center, #0f0f0f 0%, #000 100%);
}

/* Logo */
.logo {
  text-align: center;
  font-size: 2em;
  letter-spacing: 2px;
  margin-bottom: 1.5em;
  color: #58f4d6;
  text-shadow: 0 0 12px #58f4d6, 0 0 6px #00bfa5;
}

/* Login Container */
.login-container {
  margin: auto;
  width: 320px;
  padding: 2em;
  background-color: #111;
  border: 1px solid #2b2b2b;
  box-shadow: 0 0 20px #000, inset 0 0 10px #222;
  border-radius: 10px;
  backdrop-filter: blur(6px);
}

input {
  display: block;
  width: 100%;
  margin-bottom: 1em;
  padding: 0.8em;
  background: #0d0d0d;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 4px;
  font-family: 'Share Tech Mono', monospace;
}

input:focus {
  outline: none;
  border-color: #58f4d6;
  background-color: #151515;
}

button {
  display: block;
  width: 100%;
  margin-bottom: 1em;
  padding: 0.8em;
  background-color: #58f4d6;
  border: none;
  color: #000;
  font-weight: bold;
  font-family: 'Share Tech Mono', monospace;
  cursor: pointer;
  border-radius: 4px;
  transition: 0.2s ease-in-out;
}

button:hover {
  background-color: #3bd8b9;
}

.error {
  color: red;
  text-align: center;
  margin-top: 1em;
  font-size: 0.9em;
}

/* Footer */
.footer {
  text-align: center;
  padding: 0.5em;
  font-size: 0.75em;
  background-color: #0a0a0a;
  border-top: 1px solid #222;
  color: #666;
  letter-spacing: 0.05em;
}

/* Inbox Layout */
.app-container {
  display: flex;
  flex-grow: 1;
  overflow: hidden;
}

/* Contacts */
.contact-list {
  width: 250px;
  background: #121212;
  border-right: 1px solid #1e1e1e;
  overflow-y: auto;
  padding: 1em;
  box-shadow: inset -2px 0 4px #000;
}

.contact-list div {
  padding: 0.75em 1em;
  margin-bottom: 0.5em;
  background: #1a1a1a;
  border-left: 4px solid transparent;
  color: #ccc;
  cursor: pointer;
  transition: 0.2s;
}

.contact-list div:hover {
  background: #222;
  color: #00ffd1;
}

.contact-list div.active {
  background: #202020;
  border-left: 4px solid #00ffd1;
  font-weight: bold;
  color: #00ffd1;
}

/* Chat Area */
.chat-view {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  padding: 1em;
  background: #0d0d0d;
  overflow: hidden;
}

.chat-header {
  font-weight: bold;
  margin-bottom: 1em;
  border-bottom: 1px solid #333;
  padding-bottom: 0.5em;
  font-size: 1.1em;
  color: #58f4d6;
  text-shadow: 0 0 5px #00bfa5;
}

/* Messages */
.chat-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 1em;
  scrollbar-width: thin;
  scrollbar-color: #444 #111;
}

.message {
  margin-bottom: 1.5em;
  animation: fadeInUp 0.3s ease-out;
}

.message .meta {
    font-size: 1em;
    color: #e33d3d;
    margin-bottom: 0.2em;
}

.message .bubble {
  padding: 0.75em 1em;
  border-radius: 8px;
  white-space: pre-wrap;
  background: rgba(30, 30, 30, 0.9);
  border: 1px solid #2a2a2a;
  color: #e0e0e0;
  box-shadow: inset 0 0 4px #000;
  max-width: 85%;
}

.message.incoming .bubble {
  background: rgba(40, 40, 40, 0.8);
  border-color: #3a3a3a;
  color: #cfcfcf;
}

.message.outgoing .bubble {
  background: rgba(0, 255, 209, 0.08);
  border: 1px solid #00ffd1;
  color: #aff;
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.sidebar {
  width: 250px;
  background: #121212;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid #1e1e1e;
  padding: 1em 0;
}

.profile-info {
  text-align: center;
  padding: 0.5em 1em;
  border-bottom: 1px solid #2a2a2a;
}

.avatar {
  width: 60px;
  height: 60px;
  margin: 0 auto 0.5em;
  background: url('images/avatar-placeholder.png') center center no-repeat;
  background-size: cover;
  border-radius: 50%;
  border: 2px solid #333;
  box-shadow: 0 0 6px #000;
}

.username {
  font-size: 0.9em;
  color: #58f4d6;
  text-shadow: 0 0 6px #00bfa5;
  word-break: break-word;
}

.logout-btn {
  margin: 1em 0;
  padding: 0.5em;
  background-color: #222;
  color: #aaa;
  border: 1px solid #333;
  border-radius: 4px;
  font-family: 'Share Tech Mono', monospace;
  cursor: pointer;
  transition: 0.2s;
}

.logout-btn:hover {
  background-color: #111;
  color: #fff;
}

/* LIVE NODE badge */
.status {
  margin-top: 0.5em;
  font-size: 0.7em;
  color: #ff4444;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.status .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  background-color: #ff4444;
  border-radius: 50%;
  box-shadow: 0 0 8px #ff4444;
  animation: pulseDot 1.2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.4);
    opacity: 0.4;
  }
}

.login-meta {
  font-size: 0.75em;
  color: #888;
  text-align: center;
  margin: -1em 0 1.5em;
  font-style: italic;
  letter-spacing: 0.05em;
}

/* Footer Flicker */
.flicker {
  animation: flicker 3s infinite;
}

@keyframes flicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
    opacity: 1;
  }
  20%, 22%, 24%, 55% {
    opacity: 0.15;
  }
}

/* Optional: Add [🔐] to encrypted bubbles (simulate with CSS) */
.message .bubble::before {
  content: '🔐 ';
  color: #00ffd1;
  font-size: 0.85em;
  opacity: 0.5;
}
