/* Modern, flat, monotone palette (complimentary accents) */
:root{
  --bg-1:#0f1320;
  --bg-2:#171b2e;
  --fg:#e6e9f2;
  --muted:#a8b0c3;
  --accent:#2999e4a6; /* teal */
  --accent-2:#9f7aea; /* purple */
  --bubble-me:#2b3150;
  --bubble-them:#1d223b;
  --border:#33395c;
}
*{ box-sizing:border-box; }
html,body{ height:100%; margin:0; font-family:'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; color:var(--fg); background:var(--bg-1); }

/* Gradient bg for login */
/* Apply linear gradient background with overlay */
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: linear-gradient(to bottom, #0a164e56, #1a1a1a); /* Dark red to dark grey */
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
  overflow: hidden;
}

/* Overlay PNG styling */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('public/img/overlay.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  opacity: 0.08; /* Faint fade look */
  z-index: 0;
  pointer-events: none;
}

/* Ensure login container stays above the overlay */
.login-container, .login-box, .login-form {
  position: relative;
  z-index: 1;
}

.login-container{ display:flex; align-items:center; justify-content:center; height:100%; padding:16px; }
.login-card{
  width:min(560px, 100%);
  background:rgba(255,255,255,0.02);
  border:1px solid var(--border);
  border-radius:20px;
  padding:24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.login-logo {
  width: 100%;
  max-width: 1000px;
  height: auto;
  margin: 0 auto 20px;
  display: block;
  filter: drop-shadow(0 0 10px rgba(0,0,0,0.3));
}
.login-fields{ display:flex; flex-direction:column; gap:12px; }
.login-fields input{
  width:100%;
  padding:14px 16px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(0,0,0,0.2);
  color:var(--fg);
  font-weight:500;
}
.login-fields button{
  padding:14px 16px; border:0; border-radius:12px; background:var(--accent);
  color:#081316; font-weight:800; cursor:pointer;
}
.hint{ color:var(--muted); font-size:12px; margin:6px 2px 0; }

/* App layout */
#app{ display:flex; height:100vh; width:100vw; overflow:hidden; }
.panel{
  width:360px; max-width:80vw; background:var(--bg-2); border-right:1px solid var(--border);
  transition: transform .3s ease;
}
.panel.hidden-on-mobile{ transform: translateX(0); }
@media (max-width: 900px){
  .messages {
    padding: 6px !important;
    gap: 6px !important;
  }
  .msg {
    max-width: 50% !important;
    padding: 7px 10px !important;
    font-size: 14px !important;
  }
  .msg img {
    max-width: 80vw !important;
    max-height: 30vw !important;
  }
  .composer input[type="text"] {
    font-size: 10px;
    padding: 10px 8px !important;
  }
  .composer button {
    padding: 10px 10px !important;
    font-size: 15px !important;
  }
  .chat-header {
    padding: 6px !important;
    font-size: 15px !important;
  }
  .panel.hidden-on-mobile{ transform: translateX(-100%); position:absolute; z-index:5; height:100%; }
}

.panel-header{
  display:flex; align-items:center; justify-content:space-between; padding:12px 12px; border-bottom:1px solid var(--border);
}
.panel-header .title{ font-weight:800; letter-spacing:.02em; }
.panel-header .actions{ display:flex; gap:10px; }
.icon{ width:22px; height:22px; opacity:.9; cursor:pointer; }

.contact-list{ padding:10px; overflow:auto; height:calc(100vh - 52px); }
.contact-item{
  background:rgba(255,255,255,0.02); border:1px solid var(--border); border-radius:14px; padding:12px;
  display:flex; align-items:center; gap:12px; margin-bottom:10px; cursor:pointer; transition: background .2s ease;
}
.contact-item:hover{ background:rgba(255,255,255,0.06); }
.contact-avatar{ width:36px; height:36px; border-radius:50%; background:#111522; display:inline-flex; align-items:center; justify-content:center; font-weight:800; }

/* Chat */
#chatArea{ flex:1; display:flex; flex-direction:column; }
.chat-header{ display:flex; align-items:center; gap:12px; padding:10px; border-bottom:1px solid var(--border); }
.chat-title{ font-weight:900; }
.toggle-contacts{ display:none; }
@media (max-width: 900px){
  .toggle-contacts{ display:inline-flex; align-items:center; justify-content:center; width:40px; height:36px; border-radius:10px; border:1px solid var(--border); background:transparent; color:var(--fg); }
}

.messages{ flex:1; overflow:auto; padding:16px; display:flex; flex-direction:column; gap:10px; }
.msg{
  max-width:75%;
  background:var(--bubble-them);
  border:1px solid var(--border);
  padding:10px 12px;
  border-radius:14px;
  position:relative;
  word-wrap: break-word;
}
.msg.me{ align-self:flex-end; background:var(--bubble-me); }
.msg .content{ font-weight:500; }
.msg img{ max-width:100%; border-radius:10px; border:1px solid var(--border); display:block; }
.timestamp{ font-size:11px; color:var(--muted); margin-top:4px; }
.reactions{ position:absolute; top:-10px; right:-10px; background:#0e1220; border:1px solid var(--border); border-radius:12px; padding:2px 6px; font-size:11px; }

.composer{ display:flex; gap:8px; padding:12px; border-top:1px solid var(--border); }
.composer input[type="text"]{ flex:1; padding:12px 14px; border-radius:12px; border:1px solid var(--border); background:rgba(0,0,0,0.2); color:var(--fg); }
.composer input[type="file"] {
  display: none;
}.composer button{ padding:12px 16px; border:0; border-radius:12px; background:var(--accent-2); color:white; font-weight:800; cursor:pointer; }
.composer label.upload-btn {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  display: inline-block;
  margin-right: 4px;
  white-space: nowrap;
}


/* Context menu for reactions */
.context-menu{
  position:fixed; display:none; flex-direction:column; background:#0b0f1a; border:1px solid var(--border); border-radius:10px; overflow:hidden;
}
.context-menu button{ background:transparent; color:var(--fg); border:0; padding:10px 14px; cursor:pointer; text-align:left; }
.context-menu button:hover{ background:rgba(255,255,255,0.06); }

/* Forms */
.form-container{ max-width:620px; margin:40px auto; padding:20px; border:1px solid var(--border); border-radius:16px; background:rgba(255,255,255,0.02); }
.form-container h1{ margin-top:0; font-weight:900; }
.form-container label{ display:block; margin-bottom:12px; }
.form-container input{ width:100%; padding:10px 12px; border-radius:10px; border:1px solid var(--border); background:rgba(0,0,0,0.2); color:var(--fg); }
.form-actions{ display:flex; gap:12px; align-items:center; }
.link-btn{ padding:10px 14px; border:1px solid var(--border); border-radius:10px; text-decoration:none; color:var(--fg); }
.note{ color:var(--muted); font-size:12px; margin-top:8px; }
