/* =========================================================
   workshop.css — Admin Chapter Workshop  v1.0
   ========================================================= */

/* ── Overlay start modal ── */
#workshop-start-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6,2,0,.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9100;
  backdrop-filter: blur(6px);
}
#workshop-start-overlay[hidden] { display: none; }

.ws-start-box {
  background: linear-gradient(160deg,#1a1008 0%,#0e0a04 100%);
  border: 1px solid #6b4a1e;
  border-radius: 6px;
  padding: 36px 40px 32px;
  width: min(480px, 92vw);
  box-shadow: 0 0 60px rgba(180,120,20,.18);
}
.ws-start-box h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  color: #f0d060;
  letter-spacing: .1em;
  margin: 0 0 24px;
  text-align: center;
}
.ws-start-box input {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid #4a3010;
  border-radius: 3px;
  color: #e8d4a0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  padding: 10px 14px;
  margin-bottom: 14px;
  box-sizing: border-box;
  outline: none;
  transition: border-color .2s;
}
.ws-start-box input:focus { border-color: #c9a45a; }
.ws-start-box input::placeholder { color: rgba(200,180,140,.4); }
.ws-start-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

/* ── Workshop panel overlay ── */
#workshop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4,1,0,.92);
  z-index: 9200;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(4px);
}
#workshop-overlay[hidden] { display: none; }

.ws-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
  padding: 0 16px;
  box-sizing: border-box;
}

/* ── Header ── */
.ws-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 0 16px;
  border-bottom: 1px solid rgba(180,130,30,.25);
  flex-shrink: 0;
}
.ws-title-area { flex: 1; min-width: 0; }
.ws-roman {
  font-family: 'Cinzel', serif;
  font-size: .75rem;
  letter-spacing: .18em;
  color: #c9a45a;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}
.ws-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  color: #f0d060;
  margin: 0;
  font-weight: 600;
}
.ws-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: .95rem;
  color: #a08040;
  margin: 4px 0 0;
  font-style: italic;
}
.ws-header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: 16px;
  padding-top: 4px;
}

/* ── Buttons ── */
.ws-btn {
  font-family: 'Cinzel', serif;
  font-size: .72rem;
  letter-spacing: .1em;
  border: 1px solid;
  border-radius: 2px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all .2s;
  background: transparent;
}
.ws-btn-gold {
  color: #f0d060;
  border-color: #c9a45a;
}
.ws-btn-gold:hover {
  background: rgba(200,160,60,.15);
}
.ws-btn-ghost {
  color: #8a7050;
  border-color: #4a3010;
}
.ws-btn-ghost:hover {
  color: #c9a45a;
  border-color: #6a5020;
}
.ws-btn-close {
  font-family: serif;
  font-size: 1.4rem;
  line-height: 1;
  color: #6a5020;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0 4px;
  transition: color .2s;
}
.ws-btn-close:hover { color: #e8c880; }
.ws-btn-publish {
  background: linear-gradient(135deg,#f0d060,#c9a45a);
  color: #0c0812;
  border-color: transparent;
  font-weight: 700;
}
.ws-btn-publish:hover {
  background: linear-gradient(135deg,#ffe070,#d9b46a);
}
.ws-btn:disabled {
  opacity: .45;
  cursor: default;
}

/* ── Chat area ── */
.ws-chat {
  flex: 1;
  overflow-y: auto;
  padding: 20px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(180,130,30,.3) transparent;
}
.ws-chat::-webkit-scrollbar { width: 4px; }
.ws-chat::-webkit-scrollbar-thumb { background: rgba(180,130,30,.3); border-radius: 2px; }

.ws-msg {
  display: flex;
  gap: 12px;
  max-width: 92%;
}
.ws-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.ws-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.ws-msg-sirus .ws-msg-avatar {
  background: radial-gradient(circle, #3a2808, #1a0e02);
  border: 1px solid #6a4a18;
  color: #c9a45a;
}
.ws-msg-user .ws-msg-avatar {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.5);
}
.ws-msg-bubble {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(180,130,30,.12);
  border-radius: 4px;
  padding: 12px 16px;
  color: #d4c0a0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  line-height: 1.65;
  white-space: pre-wrap;
}
.ws-msg-sirus .ws-msg-bubble {
  border-color: rgba(180,130,30,.22);
  background: rgba(30,18,4,.6);
}
.ws-msg-user .ws-msg-bubble {
  background: rgba(255,255,255,.06);
  color: #e8d8b8;
}
.ws-typing {
  opacity: .6;
  font-style: italic;
  font-size: .95rem;
}

/* ── Input area ── */
.ws-input-area {
  display: flex;
  gap: 10px;
  padding: 14px 0 20px;
  border-top: 1px solid rgba(180,130,30,.2);
  flex-shrink: 0;
  align-items: flex-end;
}
.ws-input-area textarea {
  flex: 1;
  background: rgba(255,255,255,.04);
  border: 1px solid #4a3010;
  border-radius: 3px;
  color: #e8d4a0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  padding: 10px 14px;
  resize: none;
  outline: none;
  min-height: 56px;
  max-height: 160px;
  transition: border-color .2s;
  box-sizing: border-box;
}
.ws-input-area textarea:focus { border-color: #c9a45a; }
.ws-input-area textarea::placeholder { color: rgba(200,180,140,.35); }

/* ── Preview overlay ── */
#workshop-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4,1,0,.95);
  z-index: 9300;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#workshop-preview-overlay[hidden] { display: none; }

.ws-preview-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
  padding: 0 16px;
  box-sizing: border-box;
}
.ws-preview-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 0 24px;
  color: #d4c0a0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  line-height: 1.8;
  scrollbar-width: thin;
  scrollbar-color: rgba(180,130,30,.3) transparent;
}
.ws-preview-content::-webkit-scrollbar { width: 4px; }
.ws-preview-content::-webkit-scrollbar-thumb { background: rgba(180,130,30,.3); border-radius: 2px; }
.ws-preview-content h2 {
  font-family: 'Cinzel', serif;
  color: #f0d060;
  font-size: 1.2rem;
  margin: 28px 0 12px;
  font-weight: 400;
}
.ws-preview-content p { margin: 0 0 16px; }
.ws-preview-content blockquote {
  border-left: 2px solid #c9a45a;
  padding-left: 20px;
  margin: 20px 0;
  color: #c9a45a;
  font-style: italic;
}
.ws-preview-content strong { color: #e8c880; font-weight: 600; }

/* ── "Aggiungi capitolo" button in menu ── */
#add-chapter-btn {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 10px 16px;
  background: transparent;
  border: 1px dashed rgba(200,160,60,.35);
  border-radius: 3px;
  color: rgba(200,160,60,.7);
  font-family: 'Cinzel', serif;
  font-size: .75rem;
  letter-spacing: .1em;
  cursor: pointer;
  text-align: center;
  transition: all .2s;
}
#add-chapter-btn:hover {
  border-color: #c9a45a;
  color: #f0d060;
  background: rgba(200,160,60,.08);
}

/* ── Publish success banner ── */
.ws-publish-banner {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg,#1a1204,#0e0902);
  border: 1px solid #c9a45a;
  border-radius: 4px;
  padding: 14px 28px;
  color: #f0d060;
  font-family: 'Cinzel', serif;
  font-size: .85rem;
  letter-spacing: .08em;
  z-index: 9999;
  box-shadow: 0 4px 30px rgba(0,0,0,.6);
  animation: wsBannerIn .4s ease;
}
@keyframes wsBannerIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
