/* Fase 20D.3 · Encuestas + ajustes visuales del editor de lectura */

/* Correcciones solicitadas en Organizar la lectura */
.club-reading-date-fields{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:14px!important}
.club-reading-date-fields>label{min-width:0}
.club-reading-date-fields input{box-sizing:border-box;min-width:0}
.club-reading-editor-row{position:relative;grid-template-columns:16px minmax(130px,1fr) 130px 88px!important;gap:8px!important;align-items:end;padding:34px 0 10px!important}
.club-reading-remove{position:absolute!important;top:9px!important;right:2px!important;width:auto!important;height:auto!important;padding:3px 0!important;border:0!important;background:transparent!important;font-size:0!important;color:#bd7489!important;line-height:1!important;cursor:pointer}
.club-reading-remove::after{content:"Eliminar tramo";font-size:9px;font-weight:700;letter-spacing:.01em}
.club-reading-remove:hover::after{text-decoration:underline}

/* Encuestas del club */
.club-polls-d3{margin:15px 0;border:1px solid #2d2931;border-radius:20px;background:linear-gradient(180deg,#141419,#0e0e12);overflow:hidden}
.club-polls-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:17px;border-bottom:1px solid #29262d}
.club-polls-head>div{min-width:0}
.club-polls-kicker{display:block;color:#b88662;text-transform:uppercase;letter-spacing:.14em;font-size:8px;font-weight:800}
.club-polls-head h4,.club-polls-locked h4{margin:5px 0 4px;font:22px Georgia,"Times New Roman",serif;color:#eee5dc}
.club-polls-head p,.club-polls-locked p{margin:0;color:#837b75;font-size:8.5px;line-height:1.45}
.club-polls-list{display:grid;gap:0}
.club-poll-card{padding:16px 17px;border-bottom:1px solid #29262d}
.club-poll-card:last-child{border-bottom:0}
.club-poll-card-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:8px}
.club-poll-status{font-size:7.5px;text-transform:uppercase;letter-spacing:.12em;font-weight:800;color:#c07b91}
.club-poll-card.closed .club-poll-status{color:#77706b}
.club-poll-close{border:0;background:transparent;color:#9e777f;font-size:8px;font-weight:700;padding:4px 0;cursor:pointer}
.club-poll-close.confirm{color:#d58a9e}
.club-poll-card h5{margin:0 0 12px;font:18px Georgia,"Times New Roman",serif;color:#e8dfd6;line-height:1.25}
.club-poll-options{display:grid;gap:8px}
.club-poll-option{position:relative;width:100%;min-height:46px;overflow:hidden;border:1px solid #302d34;border-radius:12px;background:#0c0c10;color:#dcd3cb;padding:9px 11px;display:flex;align-items:center;justify-content:space-between;gap:10px;text-align:left;cursor:pointer;transition:border-color .16s ease,background .16s ease,transform .12s ease}
.club-poll-option:not(:disabled):active{transform:scale(.995)}
.club-poll-option:not(:disabled):hover{border-color:#4d3942;background:#111016}
.club-poll-option.selected{border-color:#87415b;background:#181117}
.club-poll-option.closed{cursor:default}
.club-poll-option>em{position:absolute;inset:auto auto 0 0;width:var(--poll-pct,0%);height:2px;background:linear-gradient(90deg,#7f2946,#c16d80);transition:width .25s ease}
.club-poll-option-main{min-width:0;display:grid;grid-template-columns:20px minmax(0,1fr) auto;gap:8px;align-items:center;z-index:1}
.club-poll-option-main i{width:20px;height:20px;border:1px solid #3a343b;border-radius:50%;display:grid;place-items:center;color:#d691a5;font-style:normal;font-size:9px;background:#111116}
.club-poll-option.selected .club-poll-option-main i{border-color:#98516a;background:#28151d}
.club-poll-option-main b{min-width:0;font-size:9px;font-weight:700;color:#cfc6be;white-space:normal}
.club-poll-option-main small{font-size:7.5px;color:#766f69;white-space:nowrap}
.club-poll-option>strong{z-index:1;font:15px Georgia,"Times New Roman",serif;color:#c5bcb5}
.club-poll-choice{font-size:8px;color:#a97887;z-index:1}
.club-poll-meta{display:flex;justify-content:space-between;gap:12px;margin-top:9px;color:#6f6862;font-size:7.5px;line-height:1.4}
.club-poll-meta span:last-child{text-align:right}
.club-polls-empty{padding:18px 17px;display:grid;grid-template-columns:38px minmax(0,1fr);gap:11px;align-items:center}
.club-polls-empty>span{width:38px;height:38px;border:1px solid #3a3339;border-radius:12px;display:grid;place-items:center;color:#9f7381;background:rgba(140,41,71,.07)}
.club-polls-empty b{display:block;color:#c9c0b8;font-size:10px}
.club-polls-empty p{margin:4px 0 0;color:#756e68;font-size:8px;line-height:1.45}
.club-polls-locked{padding:17px;display:grid;grid-template-columns:44px minmax(0,1fr);gap:13px;align-items:center}
.club-polls-lock-mark{width:44px;height:44px;border:1px solid #3a3339;border-radius:14px;display:grid;place-items:center;color:#9f7381;background:rgba(140,41,71,.07)}

/* Modal nueva encuesta */
.club-poll-modal{position:fixed;inset:0;z-index:530;display:none;align-items:center;justify-content:center;padding:18px}
.club-poll-modal.open{display:flex}
.club-poll-modal-backdrop{position:absolute;inset:0;background:rgba(4,4,6,.8);backdrop-filter:blur(6px)}
.club-poll-dialog{position:relative;z-index:1;width:min(100%,620px);max-height:min(88dvh,720px);overflow:auto;border:1px solid #342f37;border-radius:22px;background:linear-gradient(180deg,#17171d,#0d0d11);box-shadow:0 28px 80px rgba(0,0,0,.52);padding:20px}
.club-poll-dialog-x{position:absolute;right:14px;top:12px;width:36px;height:36px;border:1px solid #332f36;border-radius:50%;background:#111116;color:#aaa19a;font-size:20px}
.club-poll-dialog h3{margin:5px 42px 6px 0;font-size:28px;color:#eee5dc}
.club-poll-dialog>p{margin:0 0 12px;color:#8d857e;font-size:9px;line-height:1.5}
.club-poll-templates{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:16px}
.club-poll-templates button{border:1px solid #342f37;border-radius:999px;background:#101015;color:#9f9690;padding:6px 9px;font-size:8px}
.club-poll-templates button:hover{border-color:#674252;color:#c9a4b0}
.club-poll-question{display:grid;gap:5px}
.club-poll-question>span{color:#817971;font-size:8px}
.club-poll-question input,.club-poll-create-option input{width:100%;min-height:42px;box-sizing:border-box;border:1px solid #312e35;border-radius:11px;background:#0d0d11;color:#e8dfd6;padding:8px 10px;outline:0;font-size:10px}
.club-poll-question input:focus,.club-poll-create-option input:focus{border-color:#684150}
.club-poll-editor-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:18px 0 9px}
.club-poll-editor-head b{font:16px Georgia;color:#d8cec6}
.club-poll-editor-head button{border:0;background:transparent;color:#c08498;font-size:9px}
.club-poll-editor-head button:disabled{opacity:.4}
#clubPollOptionEditor{display:grid;gap:8px}
.club-poll-create-option{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}
.club-poll-create-option button{border:0;background:transparent;color:#b87388;font-size:8px;font-weight:700;padding:6px 0}
.club-poll-create-option button:disabled{visibility:hidden}
.club-poll-dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:17px;padding-top:14px;border-top:1px solid #29262d}

@media(max-width:620px){
  .club-reading-date-fields{grid-template-columns:1fr!important;gap:12px!important}
  .club-reading-editor-row{grid-template-columns:14px minmax(0,1fr)!important;gap:7px!important;padding:36px 0 12px!important}
  .club-reading-editor-row label.wide,.club-reading-editor-row label:not(.wide){grid-column:2/3!important}
  .club-reading-editor-grip{grid-row:1/4!important;grid-column:1!important;align-self:center}
  .club-reading-remove{top:10px!important;right:1px!important;grid-column:auto!important;grid-row:auto!important;align-self:auto!important}
  .club-polls-head{padding:14px;gap:10px}
  .club-polls-head h4{font-size:20px}
  .club-polls-head .btn{font-size:8px;padding:7px 9px;white-space:nowrap}
  .club-poll-card{padding:14px}
  .club-poll-card h5{font-size:17px}
  .club-poll-option-main{grid-template-columns:20px minmax(0,1fr)}
  .club-poll-option-main small{grid-column:2;grid-row:2}
  .club-poll-meta{display:grid;gap:3px}
  .club-poll-meta span:last-child{text-align:left}
  .club-poll-dialog{padding:17px 14px}
  .club-poll-create-option{grid-template-columns:minmax(0,1fr)}
  .club-poll-create-option button{justify-self:end;margin-top:-3px}
}

/* Tema claro */
html[data-theme="light"] .club-polls-d3{background:linear-gradient(180deg,#fffdf9,#f8f3ec);border-color:#ddd3c8}
html[data-theme="light"] .club-polls-head,html[data-theme="light"] .club-poll-card{border-color:#ddd3c8}
html[data-theme="light"] .club-polls-head h4,html[data-theme="light"] .club-polls-locked h4,html[data-theme="light"] .club-poll-card h5{color:#40352f}
html[data-theme="light"] .club-polls-head p,html[data-theme="light"] .club-polls-locked p,html[data-theme="light"] .club-polls-empty p,html[data-theme="light"] .club-poll-meta{color:#786e66}
html[data-theme="light"] .club-poll-option{background:#fffaf4;border-color:#ddd3c8;color:#4d413a}
html[data-theme="light"] .club-poll-option:not(:disabled):hover{background:#fff7ef;border-color:#cbb7ac}
html[data-theme="light"] .club-poll-option.selected{background:#faeef1;border-color:#bd8798}
html[data-theme="light"] .club-poll-option-main i{background:#fffdf9;border-color:#d7cdc4;color:#9d4d68}
html[data-theme="light"] .club-poll-option.selected .club-poll-option-main i{background:#f3dfe5;border-color:#bd8798}
html[data-theme="light"] .club-poll-option-main b,html[data-theme="light"] .club-polls-empty b{color:#554a43}
html[data-theme="light"] .club-poll-option-main small{color:#80766e}
html[data-theme="light"] .club-polls-empty>span,html[data-theme="light"] .club-polls-lock-mark{background:#faeef1;border-color:#dcc7ce;color:#9d5c70}
html[data-theme="light"] .club-poll-dialog{background:linear-gradient(180deg,#fffdf9,#f7f1e9);border-color:#d9cec4;box-shadow:0 28px 70px rgba(75,59,48,.2)}
html[data-theme="light"] .club-poll-dialog h3{color:#3f342e}
html[data-theme="light"] .club-poll-dialog>p{color:#766c64}
html[data-theme="light"] .club-poll-dialog-x{background:#fffaf4;border-color:#d8cec4;color:#746a62}
html[data-theme="light"] .club-poll-templates button{background:#fffaf4;border-color:#ddd3c8;color:#776b64}
html[data-theme="light"] .club-poll-question input,html[data-theme="light"] .club-poll-create-option input{background:#fffaf4;color:#443832;border-color:#d8cec4}
html[data-theme="light"] .club-poll-editor-head b{color:#4d413a}
html[data-theme="light"] .club-poll-dialog-actions{border-color:#ddd3c8}
html[data-theme="light"] .club-reading-remove{color:#a6536d!important}

/* Fix 20D.3 móvil: el editor solo puede desplazarse verticalmente */
@media(max-width:620px){
  .club-reading-modal{box-sizing:border-box!important;width:100vw!important;max-width:100vw!important;padding:12px!important;overflow:hidden!important}
  .club-reading-dialog{box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-width:0!important;overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior-x:none;touch-action:pan-y;padding:17px 14px!important}
  .club-reading-dialog *,
  .club-reading-dialog *::before,
  .club-reading-dialog *::after{box-sizing:border-box;max-width:100%}
  #clubReadingSetupForm,.club-reading-date-fields,#clubReadingMilestoneEditor,.club-reading-editor-row,.club-reading-editor-row label,.club-reading-percent-input{width:100%;max-width:100%;min-width:0}
  .club-reading-date-fields input,.club-reading-editor-row input,.club-reading-percent-input input{width:100%!important;max-width:100%!important;min-width:0!important}
  .club-reading-editor-row{overflow:hidden!important}
  .club-reading-dialog-actions{max-width:100%;flex-wrap:wrap}
}
