/* Style général inspiré du thème Nissarta Tchat : noir + rose néon */

:root {
  --bg-main: #050308;
  --bg-panel: #09040f;
  --bg-panel-soft: #111;
  --accent: #ff0a8c;
  --accent-soft: #ff4fb7;
  --accent-alt: #00f5ff;
  --text-main: #f4f4ff;
  --text-dim: #b0a3c5;
  --border-strong: 1px solid rgba(255, 10, 140, 0.8);
  --shadow-neon: 0 0 12px rgba(255, 10, 140, 0.75);
  --radius-big: 12px;
  --radius-small: 6px;
  --font-main: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-main);
  color: var(--text-main);
  background: radial-gradient(circle at top, #1a0824 0, #020106 45%, #000 100%);
  overflow: hidden;
}

/* Faux cadre de navigateur en haut */

.chrome-bar {
  height: 26px;
  background: linear-gradient(to bottom, #1b1b1b, #050505);
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 6px;
  color: #aaa;
  font-size: 12px;
}

.browser-btn {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #444;
  box-shadow: inset 0 0 2px #000;
}

.browser-btn:nth-child(1) { background:#ff5f57; }
.browser-btn:nth-child(2) { background:#febc2e; }
.browser-btn:nth-child(3) { background:#28c840; }

.chrome-url {
  margin-left: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #111;
  border: 1px solid #333;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Cadre principal de l'appli */

.app-frame {
  position: relative;
  margin: 6px auto 0;
  width: 98vw;
  height: calc(100vh - 32px);
  border-radius: var(--radius-big);
  background: radial-gradient(circle at top left, rgba(255, 10, 140, 0.12), transparent 55%),
              radial-gradient(circle at bottom right, rgba(0, 255, 240, 0.08), transparent 50%),
              #050308;
  border: 2px solid rgba(255, 10, 140, 0.55);
  box-shadow: var(--shadow-neon), inset 0 0 20px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */

.app-header {
  height: 60px;
  display: grid;
  grid-template-columns: 260px 1fr 260px;
  align-items: center;
  padding: 0 18px;
  background: repeating-linear-gradient(
               -45deg,
               #07030c 0,
               #07030c 4px,
               #090111 4px,
               #090111 8px
             );
  border-bottom: 1px solid rgba(255, 10, 140, 0.7);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.7);
}

.logo {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
}

.logo-main {
  font-size: 22px;
  color: var(--accent-alt);
  text-shadow: 0 0 12px rgba(0, 245, 255, 0.8);
  display: block;
}

.logo-sub {
  font-size: 16px;
  color: var(--accent-soft);
  text-shadow: 0 0 10px rgba(255, 10, 140, 0.85);
}

.header-icons {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.icon-btn {
  border-radius: 999px;
  border: 1px solid rgba(255, 10, 140, 0.6);
  background: radial-gradient(circle at top, rgba(255, 10, 140, 0.5), rgba(9, 1, 17, 1));
  color: #fff;
  font-size: 15px;
  padding: 6px 10px;
  box-shadow: 0 0 8px rgba(255, 10, 140, 0.55);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.1s ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(255, 10, 140, 0.9);
  border-color: #fff;
}

.icon-btn.active {
  box-shadow: 0 0 16px rgba(0, 245, 255, 0.9);
  border-color: var(--accent-alt);
}

.header-social {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.social-btn {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 999px;
  text-decoration: none;
  color: #fff;
  border: 1px solid rgba(255, 10, 140, 0.7);
  background: linear-gradient(90deg, rgba(255, 10, 140, 0.8), rgba(0, 245, 255, 0.8));
  box-shadow: 0 0 10px rgba(255, 10, 140, 0.7);
}

.credits-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 10, 140, 0.7);
  font-size: 11px;
}
.credits-label {
  color: var(--text-dim);
  margin-right: 4px;
}
.credits-value {
  color: var(--accent-alt);
}

/* Layout des pages */

.page-home .app-frame {
  grid-template-rows: auto 1fr auto;
}

.page-room .app-frame {
  grid-template-rows: auto 1fr auto;
}

/* HOME */

.home-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(260px, 0.9fr);
  gap: 16px;
  padding: 14px;
}

.home-hero {
  position: relative;
  border-radius: var(--radius-big);
  border: var(--border-strong);
  overflow: hidden;
  background-image: url("../img/home-bg-placeholder.jpg");
  background-size: cover;
  background-position: center;
}

.home-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.9)),
    radial-gradient(circle at top left, rgba(255, 10, 140, 0.5), transparent 60%);
  mix-blend-mode: normal;
}

.home-hero-content {
  position: relative;
  z-index: 1;
  padding: 32px;
  max-width: 70%;
}

.home-title {
  font-size: 32px;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 14px;
}
.home-title span {
  font-size: 46px;
  display: block;
  color: var(--accent-soft);
  text-shadow: 0 0 15px rgba(255, 10, 140, 0.9);
}

.home-text {
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid #fff;
  background: radial-gradient(circle at top, var(--accent-soft), var(--accent));
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 0 14px rgba(255, 10, 140, 0.8);
  text-transform: uppercase;
  letter-spacing: .12em;
}

.home-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel {
  border-radius: var(--radius-small);
  border: var(--border-strong);
  background: linear-gradient(145deg, #050308, #110419);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.panel-header {
  padding: 6px 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  background: linear-gradient(90deg, rgba(255, 10, 140, 0.8), rgba(0, 245, 255, 0.5));
}

.panel-body {
  padding: 10px;
  font-size: 13px;
  color: var(--text-dim);
}

.user-mini-list {
  list-style: none;
  margin: 0;
  padding: 6px 10px 10px;
  font-size: 13px;
}
.user-mini-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.user-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
}
.user-status.online { background:#00ff90; }
.user-status.idle { background:#ffd400; }
.user-status.offline { background:#555; }

/* FOOTER */

.app-footer {
  height: 28px;
  font-size: 11px;
  color: var(--text-dim);
  padding: 0 14px;
  display: flex;
  align-items: center;
  border-top: 1px solid rgba(255, 10, 140, 0.6);
  background: #050308;
}

/* PAGE SALON */

.room-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) minmax(430px, 2fr) minmax(230px, 1.1fr);
  gap: 12px;
  padding: 12px;
  min-height: 0;
}

/* colonnes */
.column {
  min-height: 0;
}

/* Chat gauche */

.panel-chat {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  padding: 10px;
  background: radial-gradient(circle at top left, rgba(0, 245, 255, 0.18), rgba(0, 0, 0, 0.96));
  overflow-y: auto;
  font-size: 13px;
}

/* Style des messages simulés */

.msg-line {
  margin-bottom: 4px;
}

.msg-sys {
  color: #42f5ff;
  font-size: 12px;
}

.msg-user {
  color: #ffea00;
}

.msg-nick {
  font-weight: 600;
}

.msg-text {
  color: var(--text-main);
}

.msg-me .msg-nick {
  color: var(--accent-soft);
}

/* Webcams centre */

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(140px, 1fr);
  gap: 8px;
  height: 100%;
}

.cam-box {
  border-radius: var(--radius-small);
  border: 1px solid rgba(255, 10, 140, 0.8);
  background: radial-gradient(circle at top, rgba(255, 10, 140, 0.45), rgba(0, 0, 0, 0.95));
  box-shadow: var(--shadow-neon);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cam-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  font-size: 11px;
  background: linear-gradient(90deg, rgba(255, 10, 140, 0.8), rgba(0, 0, 0, 0.9));
}

.cam-username {
  text-shadow: 0 0 4px #000;
}

.cam-controls span {
  margin-left: 4px;
  cursor: pointer;
}

.cam-body {
  flex: 1;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#localVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.fake-video {
  width: 95%;
  height: 90%;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.9);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.1), transparent 55%),
    repeating-linear-gradient(135deg, #151515 0, #151515 4px, #111 4px, #111 8px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 12px;
  text-transform: uppercase;
}

/* Liste users */

.panel-users {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.users-list {
  flex: 1;
  padding: 4px 6px 8px;
  background: radial-gradient(circle at top, rgba(0, 245, 255, 0.18), rgba(0, 0, 0, 0.95));
  overflow-y: auto;
}

.users-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
}

.user-row,
.users-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
}

.user-name {
  flex: 1;
}

.user-row.is-me .user-name {
  color: var(--accent-soft);
}

.user-icons {
  font-size: 11px;
}

/* Barre d'entrée */

.input-bar {
  height: 56px;
  border-top: 1px solid rgba(255, 10, 140, 0.75);
  background: linear-gradient(90deg, #050308, #110419);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.9);
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 190px;
  align-items: center;
  padding: 0 10px;
  gap: 10px;
  font-size: 13px;
}

.input-left {
  display: flex;
  align-items: center;
}

.room-select {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(255, 10, 140, 0.8);
  background: #050308;
  color: var(--text-main);
  padding: 4px 10px;
}

.input-center {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar {
  display: flex;
  gap: 4px;
}

.tool-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 10, 140, 0.7);
  background: radial-gradient(circle at top, rgba(255, 10, 140, 0.7), #050308);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}

.chat-input {
  flex: 1;
  border-radius: 999px;
  border: 1px solid rgba(0, 245, 255, 0.7);
  background: #000;
  color: var(--text-main);
  padding: 6px 12px;
}

.input-right {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.btn-send {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #fff;
  background: radial-gradient(circle at top, #00f5ff, #007bff);
  color: #fff;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .12em;
  cursor: pointer;
}

.btn-disconnect {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 10, 140, 0.9);
  background: radial-gradient(circle at top, rgba(255, 10, 140, 0.8), #4a0028);
  color: #fff;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .12em;
  cursor: pointer;
}

/* Scrollbars */

.chat-messages::-webkit-scrollbar,
.users-list::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-thumb,
.users-list::-webkit-scrollbar-thumb {
  background: rgba(255, 10, 140, 0.7);
  border-radius: 999px;
}

/* Responsive simplifié */

@media (max-width: 1024px) {
  .room-main {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 2fr);
    grid-template-areas:
      "chat video"
      "users video";
  }

  .column-users {
    grid-row: 2;
  }
}

@media (max-width: 860px) {
  body {
    overflow: auto;
  }
  .app-frame {
    height: auto;
    min-height: calc(100vh - 32px);
  }
  .room-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
}

/* Simple helper for hidden elements */

.hidden {
  display: none !important;
}
