/* src/css/style.css (Restauration V2 + Fix Salle) */

/* --- VARIABLES & RESET --- */
:root {
  --primary: #2271b1;
  /* Bleu WordPress */
  --primary-dark: #135e96;
  --primary-light: #f0f6fc;
  --text: #1d2327;
  --text-light: #646970;
  --bg-body: #f6f7f7;
  --white: #ffffff;
  --border: #c3c4c7;
  --danger: #d63638;
  --success: #00a32a;
  --radius: 8px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  color: var(--text);
  line-height: 1.5;
  background-color: var(--bg-body);
}

a {
  text-decoration: none;
  color: inherit;
  transition: 0.2s;
}

a:hover {
  color: var(--primary);
}

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

/* --- BOUTONS --- */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.btn-fill {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.btn-fill:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-full {
  width: 100%;
  display: block;
}

/* --- HEADER --- */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 5%;
  background: var(--white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo svg {
  fill: var(--primary);
  width: 24px;
  height: 24px;
}

.nav-links {
  display: flex;
  gap: 15px;
  align-items: center;
}

/* --- SECTIONS (Hero, Features, Pricing) --- */
.hero {
  text-align: center;
  padding: 100px 20px;
  background: linear-gradient(180deg, var(--white) 0%, #e8f0fe 100%);
}

.hero h1 {
  font-size: 42px;
  margin: 0 0 20px;
  color: #101010;
  letter-spacing: -0.5px;
}

.hero p {
  font-size: 18px;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto 30px;
}

.features {
  padding: 80px 5%;
  background: var(--white);
  text-align: center;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

.feature-card {
  padding: 30px;
  background: var(--white);
  border: 1px solid #eee;
  border-radius: var(--radius);
  transition: transform 0.3s;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  border-color: transparent;
}

.feature-icon {
  font-size: 32px;
  margin-bottom: 15px;
  display: block;
}

.pricing {
  padding: 80px 5%;
  background: var(--bg-body);
  text-align: center;
}

.pricing-grid {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 40px;
}

.price-card {
  background: var(--white);
  padding: 30px;
  border-radius: var(--radius);
  width: 300px;
  border: 1px solid #e2e4e7;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: 0.3s;
}

.price-card.featured {
  border: 2px solid var(--primary);
  transform: scale(1.05);
  z-index: 2;
  box-shadow: var(--shadow);
}

.price-header h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.price {
  font-size: 40px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 20px;
}

.price span {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-light);
}

.features-list {
  margin: 20px 0;
  text-align: left;
  flex-grow: 1;
}

.features-list li {
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-icon {
  color: var(--primary);
  font-weight: bold;
}

/* --- PAGES AUTHENTIFICATION (Login / Register) --- */
.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 85vh;
  /* Centre verticalement */
  padding: 20px;
}

.auth-card {
  background: var(--white);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 450px;
  border: 1px solid var(--border);
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-header h2 {
  margin: 0 0 10px;
  color: var(--text);
}

.auth-header p {
  margin: 0;
  color: var(--text-light);
  font-size: 15px;
}

/* Formulaires */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  text-align: left;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 15px;
  transition: 0.2s;
  background: var(--white);
}

.form-group input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 1px var(--primary);
}

/* Plan Summary Box (dans register) */
.plan-summary {
  background: var(--primary-light);
  border: 1px solid #cce5ff;
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.plan-name {
  font-weight: 700;
  color: var(--primary-dark);
  display: block;
}

.plan-price {
  font-size: 13px;
  color: var(--text-light);
}

.plan-change {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}

/* Boutons de login / Auth */
.btn-login {
  width: 100%;
  height: 45px;
  background-color: var(--primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
}

.btn-login:hover {
  background-color: var(--primary-dark);
}

/* Messages d'erreur */
.notice-error {
  background: #fbeaea;
  color: var(--danger);
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 20px;
  font-size: 14px;
  border-left: 4px solid var(--danger);
}

.auth-footer {
  margin-top: 25px;
  text-align: center;
  font-size: 14px;
  color: var(--text-light);
  border-top: 1px solid #eee;
  padding-top: 20px;
}

.auth-footer a {
  color: var(--primary);
  font-weight: 600;
}

/* ========================================================= */
/* --- RECONSTRUCTED SALLE.PHP & ROOM CONTEXT LAYOUT ---    */
/* ========================================================= */

body.body-room {
  background-color: #f4f6f9;
}

body.body-login {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: #f0f0f1;
  margin: 0;
}

.login-card {
  background: white;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.room-header {
  background: #fff;
  padding: 15px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

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

.room-header .header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.room-header h1 {
  margin: 0;
  font-size: 1.5rem;
  color: #2c3e50;
  border-bottom: none;
  /* override global if needed */
  padding-bottom: 0;
}

.room-container {
  width: 100%;
  padding: 30px 40px;
  transition: padding-right 0.3s ease;
}

body.chat-is-docked .room-container {
  padding-right: 380px;
  /* Space for docked chat */
}

.btn-quit {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.btn-quit:hover {
  background: #c0392b;
}

/* ========================================================= */
/* --- CHAT DOCKED STYLES ---                               */
/* ========================================================= */

#chat-container {
  background: #fff;
  border: 1px solid #ccc;
  box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 999;
  transition: right 0.3s, top 0.3s, height 0.3s;
  font-family: inherit;
}

.chat-docked {
  position: fixed;
  top: 68px;
  /* Below the header */
  bottom: 0;
  right: 0;
  width: 350px;
  height: calc(100vh - 68px) !important;
}

.chat-floating {
  position: fixed;
  width: 350px;
  height: 450px;
  resize: both;
  border-radius: 8px;
  /* restoring bottom radius for floating */
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.25);
}

.chat-collapsed {
  height: 40px !important;
}

.chat-header {
  background: #2271b1;
  color: white;
  padding: 10px 15px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.chat-header-handle {
  cursor: grab;
}

.chat-header-handle:active {
  cursor: grabbing;
}

#chat-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: calc(100% - 40px);
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  background: #f9f9f9;
}

.chat-input-area {
  display: flex;
  border-top: 1px solid #eee;
  background: #fff;
}

#chat-input {
  flex: 1;
  border: none;
  padding: 12px;
  outline: none;
  font-size: 14px;
}

.btn-send {
  border: none;
  background: #2271b1;
  color: white;
  cursor: pointer;
  padding: 0 18px;
  font-weight: bold;
}

.btn-send:hover {
  background: #135e96;
}

/* ============================================= */
/* POST-IT BOARD STYLES                          */
/* ============================================= */

.body-postit {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f1f5f9;
  overflow: auto;
}

#postit-controls {
  position: sticky;
  top: 0;
  z-index: 100;
  background: white;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid #e2e8f0;
}

.controls-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.palette {
  display: flex;
  gap: 6px;
}

.color-option {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.2s, border-color 0.2s;
}

.color-option:hover {
  transform: scale(1.15);
}

.color-option.selected {
  border-color: #334155;
  transform: scale(1.15);
}

/* Couleurs des post-its */
.bg-yellow {
  background-color: #fef9c3;
  border-left-color: #eab308;
}

.bg-blue {
  background-color: #dbeafe;
  border-left-color: #3b82f6;
}

.bg-green {
  background-color: #dcfce7;
  border-left-color: #22c55e;
}

.bg-pink {
  background-color: #fce7f3;
  border-left-color: #ec4899;
}

/* Board */
#board {
  position: relative;
  min-height: calc(100vh - 60px);
  padding: 20px;
}

/* Notes (Post-its) */
.note {
  position: absolute;
  width: 320px;
  min-height: 220px;
  padding: 18px 20px 14px;
  border-radius: 3px;
  box-shadow:
    3px 3px 10px rgba(0, 0, 0, 0.12),
    1px 1px 4px rgba(0, 0, 0, 0.06);
  cursor: grab;
  user-select: none;
  transition: box-shadow 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
  word-wrap: break-word;
  overflow-wrap: break-word;
  border-left: 4px solid rgba(0, 0, 0, 0.08);
}

.note:hover {
  box-shadow:
    5px 8px 20px rgba(0, 0, 0, 0.16),
    2px 3px 6px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.note:active {
  cursor: grabbing;
  box-shadow:
    8px 12px 26px rgba(0, 0, 0, 0.22),
    3px 4px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

.note h3 {
  margin: 0 0 6px 0;
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.3;
}

.note-content-text {
  margin: 0;
  font-size: 0.9rem;
  color: #334155;
  line-height: 1.5;
  flex: 1;
  white-space: pre-wrap;
}

/* Footer du post-it : export à gauche, auteur à droite */
.note-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: 8px;
}

.note-author {
  font-size: 0.72rem;
  color: #64748b;
  font-style: italic;
  text-align: right;
  white-space: nowrap;
}

/* Actions sur les notes */
.postit-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.note:hover .postit-actions {
  opacity: 1;
}

.btn-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.7);
  transition: background 0.2s;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 1);
}

.btn-delete {
  color: #ef4444;
}

/* Barre d'export par note */
.postit-export-bar {
  display: flex;
  gap: 6px;
  align-items: center;
}

.postit-export-bar a {
  font-size: 0.8rem;
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  transition: background 0.2s;
}

.postit-export-bar a:hover {
  background: rgba(0, 0, 0, 0.12);
}

/* Boutons de contrôle */
.btn-control {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-range {
  background: #e2e8f0;
  color: #475569;
}

.btn-range:hover {
  background: #cbd5e1;
}

.btn-add {
  background: #3b82f6;
  color: white;
}

.btn-add:hover {
  background: #2563eb;
}

.btn-export-all {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  text-decoration: none;
  border: 1px solid #e2e8f0;
  transition: all 0.2s;
}

.btn-export-all:hover {
  background: #e2e8f0;
  color: #334155;
}

/* Modal nouveau post-it */
#modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  justify-content: center;
  align-items: center;
}

#modal-box {
  background: white;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 450px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

#modal-box h3 {
  margin: 0 0 10px 0;
  font-size: 1.2rem;
}

#modal-box input[type="text"],
#modal-box textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  margin-bottom: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

#modal-box input[type="text"]:focus,
#modal-box textarea:focus {
  border-color: #3b82f6;
}

#modal-box textarea {
  min-height: 100px;
  resize: vertical;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 5px;
}