/* ============================================================
   Módulo: Encuestas — Ted.Student
   Este módulo tiene identidad visual propia vs el resto del app.
   ============================================================ */

#surveyModal .modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 16px 56px rgba(45,21,182,.22), 0 4px 16px rgba(0,0,0,.1);
    overflow: hidden;
}

/* Header — gradiente profundo con glows ambiентales */
#surveyModal .survey-modal-header {
    background: linear-gradient(150deg, #2d15b6 0%, #1e0f9e 100%);
    padding: 22px 24px 16px;
    color: #fff;
    position: relative;
    overflow: hidden;
}
#surveyModal .survey-modal-header::before {
    content: '';
    position: absolute;
    top: -35px; right: -20px;
    width: 180px; height: 180px;
    background: radial-gradient(circle, rgba(227,152,26,.32) 0%, transparent 65%);
    pointer-events: none;
}
#surveyModal .survey-modal-header::after {
    content: '';
    position: absolute;
    bottom: -40px; left: 5%;
    width: 130px; height: 130px;
    background: radial-gradient(circle, rgba(255,255,255,.08) 0%, transparent 70%);
    pointer-events: none;
}
#surveyModal .survey-modal-header .s-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 3px;
    position: relative;
}
#surveyModal .survey-modal-header .s-desc {
    font-size: .82rem;
    opacity: .85;
    margin: 0;
    position: relative;
}

/* Contador de encuestas pendientes */
.s-pending-count {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: .72rem;
    font-weight: 700;
    color: rgba(255,255,255,.92);
    margin-top: 8px;
    position: relative;
}
.s-pending-count::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #fdd835;
    animation: pulse-badge 1.8s infinite;
    flex-shrink: 0;
}

/* Badge docente en el header */
.s-teacher-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,.18);
    border-radius: 40px;
    padding: 6px 16px 6px 6px;
    margin-top: 14px;
    width: fit-content;
    position: relative;
    border: 1px solid rgba(255,255,255,.15);
    backdrop-filter: blur(4px);
}
.s-teacher-badge img {
    width: 52px; height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,.5);
    background: #ddd;
    flex-shrink: 0;
}
.s-teacher-badge .t-name { font-size: .9rem; font-weight: 700; }
.s-teacher-badge .t-spec { font-size: .75rem; opacity: .82; margin-top: 1px; }

/* Barra de progreso — spring en el dot activo */
.survey-progress {
    display: flex;
    gap: 5px;
    padding: 14px 24px 0;
}
.survey-step-dot {
    flex: 1;
    height: 5px;
    border-radius: 5px;
    background: #e8e6f5;
    transition: background .35s cubic-bezier(.4,0,.2,1),
                transform .35s cubic-bezier(.34,1.56,.64,1);
}
.survey-step-dot.active {
    background: #2d15b6;
    transform: scaleY(1.3);
    transform-origin: center;
}
.survey-step-dot.done { background: #43a047; }

/* Cuerpo pregunta */
.survey-question-card {
    padding: 22px 24px 14px;
    min-height: 200px;
}
.survey-question-card .q-counter {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #2d15b6;
    margin-bottom: 6px;
}
.survey-question-card .q-text {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 18px;
    line-height: 1.4;
    text-wrap: balance;
}

/* Escala de calificación */
.rating-scale-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: .7rem;
    color: #aaa;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.rating-options {
    display: flex;
    justify-content: center;
    gap: 7px;
    flex-wrap: nowrap;
}

.rating-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f7f7fb;
    border: 2px solid #e8e8f0;
    border-radius: 12px;
    padding: 14px 6px 10px;
    cursor: pointer;
    transition: all .22s cubic-bezier(.4,0,.2,1);
    flex: 1;
    min-width: 52px;
    max-width: 76px;
    user-select: none;
    position: relative;
}

.rating-btn .r-num {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 5px;
    color: #bbb;
    transition: color .18s;
    font-variant-numeric: tabular-nums;
}

.rating-btn .r-label {
    font-size: .62rem;
    text-align: center;
    line-height: 1.2;
    color: #aaa;
    font-weight: 600;
    letter-spacing: .02em;
    transition: color .18s;
}

/* Colores semánticos por valor */
.rating-btn[data-val="1"] { --rc: #e53935; }
.rating-btn[data-val="2"] { --rc: #fb8c00; }
.rating-btn[data-val="3"] { --rc: #f9a825; }
.rating-btn[data-val="4"] { --rc: #7cb342; }
.rating-btn[data-val="5"] { --rc: #2e7d32; }

.rating-btn:hover {
    border-color: var(--rc);
    background: #fff;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,.1);
}
.rating-btn:hover .r-num   { color: var(--rc); }
.rating-btn:hover .r-label { color: var(--rc); }

/* Press state — feedback táctil */
.rating-btn:active {
    transform: translateY(-2px) scale(0.95);
    transition-duration: .08s;
}

.rating-btn.selected {
    border-color: var(--rc);
    background: var(--rc);
    transform: translateY(-6px);
    box-shadow: 0 10px 24px rgba(0,0,0,.18);
}
.rating-btn.selected .r-num   { color: #fff; }
.rating-btn.selected .r-label { color: rgba(255,255,255,.9); }

.rating-btn.selected:active {
    transform: translateY(-3px) scale(0.96);
    transition-duration: .08s;
}

/* Área de comentario */
.survey-comment-area {
    width: 100%;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px;
    font-size: .9rem;
    resize: vertical;
    min-height: 88px;
    transition: border-color .2s, box-shadow .2s;
    font-family: inherit;
}
.survey-comment-area:focus {
    outline: none;
    border-color: #2d15b6;
    box-shadow: 0 0 0 3px rgba(45,21,182,.1);
}

/* Footer — superficie diferenciada */
.survey-modal-footer {
    padding: 12px 24px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #ececf5;
    background: #fafafa;
}
.btn-postpone {
    background: none;
    border: none;
    font-size: .78rem;
    color: #bbb;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    transition: color .15s;
}
.btn-postpone:hover { color: #888; }

/* Pantalla de agradecimiento — spring physics */
.survey-thanks {
    text-align: center;
    padding: 44px 24px;
}
.survey-thanks .thanks-icon {
    font-size: 3.8rem;
    margin-bottom: 16px;
    animation: popIn .5s cubic-bezier(.34,1.56,.64,1);
    display: block;
    filter: drop-shadow(0 4px 14px rgba(46,125,50,.25));
}
.survey-thanks h5 { font-weight: 700; color: #1b5e20; margin-bottom: 6px; }
.survey-thanks p  { color: #888; font-size: .88rem; }

@keyframes popIn {
    0%   { transform: scale(.4); opacity: 0; }
    70%  { transform: scale(1.18); }
    100% { transform: scale(1);  opacity: 1; }
}
