/* =========================================================================
   Ghost Chat - habillage "Graphite"
   Surcouche posee APRES styles.css: on ne redefinit que l'apparence.
   Aucune regle de structure, aucun changement de comportement.
   ========================================================================= */

/* Roboto - heberge en local, aucun appel a Google */
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/roboto-latin-ext-400.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/roboto-latin-400.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/roboto-latin-ext-500.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/roboto-latin-500.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/roboto-latin-ext-700.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/roboto-latin-700.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- 1. Palette ---------- */
:root {
  --bg: #0b0d0c;
  --bg-soft: #101413;
  --panel: #151a18;
  --panel-strong: #1e2422;
  --panel-elevated: #2b332f;

  /* Les variables gardent leurs noms d'origine (--green-*) pour que toutes
     les regles existantes suivent sans avoir a etre reecrites. */
  --green-primary: #46a883;
  --green-secondary: #33866a;
  --green-soft: #132520;
  --green-glow: rgba(70, 168, 131, 0.30);

  --orange-accent: #d0a24e;
  --orange-vivid: #b0842f;
  --orange-soft: #2b2412;

  --text: #e9edeb;
  --text-secondary: #98a49e;
  --text-muted: #6d7a74;

  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);
  --divider: rgba(255, 255, 255, 0.07);

  --danger: #e0685f;
  --danger-soft: #361b19;
  --read-blue: #6fc7d8;

  --self-bubble-start: #2b8362;
  --self-bubble-end: #216b50;
  --peer-bubble: #1e2422;

  --notes-start: #d0a24e;
  --notes-end: #b0842f;

  /* Ombres plus courtes et plus basses: celle d'avant, 48px de flou, faisait
     flotter les panneaux au lieu de les poser. */
  --shadow-card: 0 18px 44px -18px rgba(0, 0, 0, 0.72);
  --shadow-bubble: 0 1px 2px rgba(0, 0, 0, 0.28);
  --shadow-glow: 0 0 0 1px rgba(70, 168, 131, 0.30);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

/* ---------- 2. Typographie ---------- */
body,
button,
input,
textarea {
  font-family: "Roboto", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1, "liga" 1;
}

body {
  font-size: 14px;
  letter-spacing: -0.004em;
  background: radial-gradient(1200px 800px at 18% -10%, #101413 0%, #0b0d0c 62%);
}

/* Titres resserres, corps de texte qui respire: ce contraste d'interlettrage
   est ce qui fait lire "soigne" plutot que "par defaut". */
.brand h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.021em;
}

.brand p {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0;
}

.chat-header h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.016em;
}

.chat-header p,
.notice {
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* Intitules de section en petites capitales espacees */
.users-panel h2 {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}

.auth-form label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.message-text {
  font-size: 14.5px;
  line-height: 1.55;
  letter-spacing: 0;
}

.message-meta {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.015em;
  opacity: 0.62;
}

.user-row strong,
.conversation-row strong {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.008em;
}

.user-row small {
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- 3. Boutons ---------- */
.primary-btn,
.send-btn {
  background: linear-gradient(135deg, #46a883, #33866a);
  border: none;
  font-weight: 600;
  letter-spacing: -0.005em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: transform 0.14s ease, filter 0.14s ease, box-shadow 0.14s ease;
}

.primary-btn:hover,
.send-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px -4px rgba(70, 168, 131, 0.30);
}

.primary-btn:active,
.send-btn:active {
  transform: translateY(0);
  filter: brightness(0.96);
}

.secondary-btn,
.icon-text-btn,
.tool-btn,
.screen-control-btn,
.group-create-btn {
  background: #1e2422;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 500;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.secondary-btn:hover,
.icon-text-btn:hover,
.tool-btn:hover,
.screen-control-btn:hover,
.group-create-btn:hover {
  background: #2b332f;
  border-color: var(--border-strong);
  color: var(--text);
}

.secondary-btn.active,
.tool-btn.active {
  background: #132520;
  border-color: #46a883;
  color: #46a883;
}

.danger-btn,
.screen-control-btn.danger-btn {
  color: var(--danger);
  border-color: rgba(224, 104, 95, 0.34);
}

.danger-btn:hover,
.screen-control-btn.danger-btn:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: #ffffff;
}

/* ---------- 4. Champs de saisie ---------- */
.auth-form input,
.composer textarea {
  background: #101413;
  border: 1px solid var(--border);
  color: var(--text);
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.auth-form input:focus,
.composer textarea:focus {
  border-color: #46a883;
  background: #151a18;
  /* Anneau de focus net, sans le halo diffus d'avant. */
  box-shadow: 0 0 0 3px rgba(70, 168, 131, 0.16);
  outline: none;
}

.auth-form input::placeholder,
.composer textarea::placeholder {
  color: var(--text-muted);
}

/* ---------- 5. Panneaux et separations ---------- */
.sidebar,
.chat-panel,
.auth-card {
  background: #151a18;
  border-color: var(--border);
  box-shadow: var(--shadow-card);
}

.sidebar-header,
.chat-header {
  background: #101413;
  border-bottom: 1px solid var(--border);
}

.composer {
  background: #101413;
  border-top: 1px solid var(--border);
}

/* Le filigrane etait assez present pour concurrencer le texte. */
.auth-view::before {
  opacity: 0.09;
}

.chat-panel::before {
  opacity: 0.045;
}

.sidebar::before {
  opacity: 0.035;
}

/* ---------- 6. Liste des conversations ---------- */
.user-row,
.conversation-row,
.personal-notes-row {
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: background 0.13s ease, border-color 0.13s ease;
}

.user-row:hover,
.conversation-row:hover,
.personal-notes-row:hover {
  background: #1e2422;
  border-color: var(--border);
}

/* La conversation ouverte se signale par un lisere, pas par un aplat criard. */
.conversation-row.active,
.user-row.active {
  background: #132520;
  border-color: rgba(70, 168, 131, 0.38);
  box-shadow: inset 3px 0 0 #46a883;
}

.dot.online {
  background: #46a883;
  box-shadow: 0 0 0 2px #151a18, 0 0 6px rgba(70, 168, 131, 0.30);
}

/* ---------- 7. Bulles de message ---------- */
.message {
  box-shadow: var(--shadow-bubble);
}

.message.mine {
  background: linear-gradient(135deg, #2b8362, #216b50);
  border-radius: var(--radius-lg) var(--radius-lg) 5px var(--radius-lg);
  color: #ffffff;
}

.message.theirs {
  background: #1e2422;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 5px;
  color: var(--text);
}

.message-text a {
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.message.theirs .message-text a {
  color: #46a883;
}

/* ---------- 8. Barre de defilement ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #2b332f;
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #33866a;
  background-clip: content-box;
}

/* ---------- 9. Fenetre des filtres d'image ---------- */
.image-filter-card {
  background: #151a18;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card);
}

.image-filter-option {
  border: 1px solid var(--border);
  background: #1e2422;
  transition: border-color 0.13s ease, background 0.13s ease;
}

.image-filter-option:hover {
  border-color: var(--border-strong);
  background: #2b332f;
}

.image-filter-option.active {
  border-color: #46a883;
  background: #132520;
}

/* ---------- 10. Banniere d'appel ---------- */
.call-banner {
  background: #132520;
  border: 1px solid rgba(70, 168, 131, 0.38);
  border-radius: var(--radius-md);
}

.call-banner strong {
  color: #46a883;
  font-weight: 600;
  letter-spacing: -0.01em;
}
