/* =========================================================
   Planning Poker
   - Usa variables del tema global (styles.css)
   - Soporta modo oscuro real (sin "parches" blancos)
   - Alterna logos laterales (light/dark) por CSS
   ========================================================= */

/* Cards del módulo */
.pp-card { border-radius: 1rem; }

.pp-room-code { color: var(--primary-color); }

.pp-link {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

.pp-controls { min-width: 260px; }

/* =========================
   LAYOUT CON LATERALES
   ========================= */

.pp-layout {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - 80px); /* descuenta navbar fija */
  background: var(--page);
  color: var(--text);
}

.pp-center {
  flex: 1;
  background: var(--page);
}

.pp-side {
  width: 260px;
  background: var(--topbar);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.pp-side-logo {
  width: 220px;
  max-width: 90%;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Mostrar light por defecto */
.pp-side-logo--dark { display: none; }

/* En modo oscuro, alternar */
html[data-theme="dark"] .pp-side-logo--light { display: none; }
html[data-theme="dark"] .pp-side-logo--dark { display: block; }

.pp-side-text {
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 1.35rem;
  color: var(--text);
}

/* ocultar laterales en pantallas pequeñas */
@media (max-width: 992px) {
  .pp-side { display: none; }
}

/* =========================
   DECK
   ========================= */

.pp-deck {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 992px) {
  .pp-deck { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 576px) {
  .pp-deck { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.pp-card-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 0.9rem;
  padding: 14px 10px;
  font-weight: 800;
  font-size: 1.15rem;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.pp-card-btn:hover {
  transform: translateY(-2px);
  border-color: var(--primary-color);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.10);
}

/* ✅ CARTA SELECCIONADA (naranja) */
.pp-card-btn.pp-selected {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 16px 34px rgba(249, 99, 59, 0.25);
  transform: translateY(-1px);
}

/* accesibilidad: foco visible */
.pp-card-btn:focus-visible {
  outline: 3px solid rgba(249, 99, 59, 0.35);
  outline-offset: 2px;
}

/* =========================
   USERS
   ========================= */

.pp-users {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pp-user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 0.85rem;
  border: 1px solid var(--border);
  background: rgba(127,127,127,.05);
}

html[data-theme="dark"] .pp-user-row {
  background: rgba(255,255,255,.04);
}

.pp-user-name { font-weight: 700; }

.pp-user-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.pp-vote-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(249, 99, 59, 0.12);
  border: 1px solid rgba(249, 99, 59, 0.35);
  font-weight: 800;
  color: var(--text);
}

html[data-theme="dark"] .pp-vote-pill { color: var(--text); }

/* =========================
   HISTORIAS PANEL
   ========================= */

.pp-stories-panel {
  position: fixed;
  top: 80px; /* navbar height */
  right: -420px;
  width: 420px;
  height: calc(100vh - 80px);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -20px 0 45px rgba(15, 23, 42, 0.10);
  transition: right 0.18s ease;
  z-index: 999;
  display: flex;
  flex-direction: column;
}

html[data-theme="dark"] .pp-stories-panel {
  box-shadow: -20px 0 45px rgba(0, 0, 0, 0.25);
}

.pp-stories-panel.is-open { right: 0; }

@media (max-width: 576px) {
  .pp-stories-panel {
    width: 100%;
    right: -100%;
  }
  .pp-stories-panel.is-open { right: 0; }
}

.pp-stories-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.pp-stories-body {
  padding: 14px 16px;
  overflow: auto;
  flex: 1;
}

.pp-stories-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pp-story-item {
  border: 1px solid var(--border);
  background: var(--page);
  border-radius: 12px;
  padding: 10px 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.pp-story-item.is-active {
  border-color: rgba(249, 99, 59, 0.55);
  box-shadow: 0 12px 26px rgba(249, 99, 59, 0.10);
}

.pp-story-title { font-weight: 800; }

.pp-story-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2px;
  white-space: pre-wrap;
}

.pp-trash-btn { min-width: 40px; }

.pp-active-story {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.pp-active-title { font-weight: 800; }

.pp-active-desc {
  margin-top: 4px;
  white-space: pre-wrap;
  color: var(--muted);
}

/* Inputs dentro del panel (asegura legibilidad en dark) */
.pp-stories-panel .form-control,
.pp-stories-panel textarea {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

/* Card "Historia activa" dentro del main */
.pp-center .pp-active-story {
  background: var(--surface);
}

/* Botones outline-dark en modo oscuro: que se vean */
html[data-theme="dark"] .btn-outline-dark {
  color: var(--text) !important;
  border-color: var(--border) !important;
}
html[data-theme="dark"] .btn-outline-dark:hover {
  background: rgba(231, 233, 238, 0.08) !important;
}
