/* teacher/polls — test modülü ile uyumlu anket stüdyosu */

/* Modal — Tailwind'e bağlı değil */
.poll-overlay {
    position: fixed;
    inset: 0;
    z-index: 320;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(4px);
}
.poll-overlay.hidden { display: none !important; }

.poll-sheet {
    width: min(100%, 40rem);
    max-height: 92vh;
    background: #fff;
    border-radius: 1.25rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.poll-sheet--wide { width: min(100%, 44rem); }

.poll-sheet-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(180deg, #faf5ff 0%, #fff 100%);
}
.poll-sheet-head h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 800;
    color: #1e293b;
}
.poll-sheet-head p {
    margin: 0.25rem 0 0;
    font-size: 0.7rem;
    color: #64748b;
    line-height: 1.45;
    max-width: 28rem;
}
.poll-sheet-close {
    border: none;
    background: #f1f5f9;
    color: #64748b;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    cursor: pointer;
    flex-shrink: 0;
}
.poll-sheet-close:hover { background: #fee2e2; color: #dc2626; }

.poll-sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.poll-sheet-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    padding: 0.85rem 1.15rem;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
}

.poll-form-row { display: grid; gap: 0.65rem; }
.poll-form-row--2 { grid-template-columns: 1fr; }
@media (min-width: 540px) {
    .poll-form-row--2 { grid-template-columns: 1fr 1fr; }
    .poll-form-field--full { grid-column: 1 / -1; }
}
.poll-form-field label {
    display: block;
    font-size: 0.625rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.3rem;
}
.poll-optional { font-weight: 600; text-transform: none; letter-spacing: 0; color: #94a3b8; }
.poll-form-field input,
.poll-form-field select,
.poll-form-field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.55rem 0.7rem;
    font-size: 0.78rem;
    color: #1e293b;
    background: #f8fafc;
}
.poll-form-field input:focus,
.poll-form-field select:focus,
.poll-form-field textarea:focus {
    outline: none;
    border-color: #a78bfa;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
    background: #fff;
}

.poll-questions-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.poll-questions-head strong {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    color: #334155;
}
.poll-questions-head span {
    display: block;
    font-size: 0.65rem;
    color: #94a3b8;
    font-weight: 600;
    margin-top: 0.1rem;
}
.poll-mini-btn {
    border: 1px solid #ddd6fe;
    background: #f5f3ff;
    color: #6d28d9;
    border-radius: 0.6rem;
    padding: 0.4rem 0.65rem;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
}
.poll-mini-btn:hover { background: #ede9fe; }

.poll-questions-list { display: flex; flex-direction: column; gap: 0.55rem; }

.poll-q-block {
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 0.7rem 0.75rem;
    background: #fff;
}
.poll-q-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}
.poll-q-block-head strong {
    font-size: 0.68rem;
    font-weight: 800;
    color: #7c3aed;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.poll-q-del {
    border: none;
    background: transparent;
    color: #f87171;
    font-size: 0.72rem;
    cursor: pointer;
    padding: 0.2rem 0.35rem;
}
.poll-q-text {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    border-radius: 0.6rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.78rem;
    margin-bottom: 0.45rem;
    background: #f8fafc;
}
.poll-opt-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.3rem;
}
.poll-opt-row input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.4rem 0.55rem;
    font-size: 0.72rem;
    background: #fff;
}
.poll-opt-del {
    border: none;
    background: #fef2f2;
    color: #ef4444;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 0.4rem;
    cursor: pointer;
    flex-shrink: 0;
}
.poll-add-opt {
    margin-top: 0.35rem;
    border: none;
    background: transparent;
    color: #6366f1;
    font-size: 0.65rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0.15rem 0;
}

.poll-grades-picker.hidden { display: none !important; }
.poll-grades-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
    padding: 0.55rem 0.65rem;
    background: #f8fafc;
    border-radius: 0.65rem;
    border: 1px solid #e2e8f0;
}
.poll-grades-picker label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.poll-foot-btn {
    border: none;
    border-radius: 0.75rem;
    padding: 0.55rem 1rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}
.poll-foot-btn--ghost {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #64748b;
}
.poll-foot-btn--primary {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    box-shadow: 0 4px 14px rgba(109, 40, 217, 0.25);
}
.poll-foot-btn--primary:hover { filter: brightness(1.05); }

.poll-google-soon {
    padding: 0.35rem 0.5rem;
    border-radius: 0.5rem;
    background: #f8fafc;
    border: 1px dashed #e2e8f0;
}

/* Liste */
.polls-grid {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.polls-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 600;
    background: #f8fafc;
    border: 1px dashed #e2e8f0;
    border-radius: 0.85rem;
}

.poll-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 0.75rem 0.875rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.poll-card:hover {
    border-color: #c4b5fd;
    box-shadow: 0 2px 8px rgba(109, 40, 217, 0.08);
}
.poll-card-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
    background: #f5f3ff;
    color: #7c3aed;
}
.poll-card-body { flex: 1; min-width: 0; }
.poll-card-title {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.3;
}
.poll-card-meta {
    margin: 0.15rem 0 0;
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 600;
}
.poll-card-badge {
    font-size: 0.58rem;
    font-weight: 800;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    flex-shrink: 0;
}
.poll-card-badge--active { background: #d1fae5; color: #047857; }
.poll-card-badge--closed { background: #f1f5f9; color: #64748b; }
.poll-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    flex-shrink: 0;
}
.poll-card-actions button {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    border-radius: 0.55rem;
    padding: 0.35rem 0.6rem;
    font-size: 0.66rem;
    font-weight: 700;
    cursor: pointer;
}
.poll-card-actions button.is-primary {
    background: #f5f3ff;
    border-color: #ddd6fe;
    color: #6d28d9;
}

/* Sonuçlar */
.poll-result-q { margin-bottom: 0.85rem; }
.poll-result-q h4 {
    margin: 0 0 0.45rem;
    font-size: 0.8rem;
    font-weight: 800;
    color: #1e293b;
}
.poll-result-bar-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.3rem;
    font-size: 0.7rem;
}
.poll-result-bar-row span:first-child { flex: 1; min-width: 0; color: #475569; }
.poll-result-bar {
    flex: 0 0 5rem;
    height: 0.45rem;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}
.poll-result-bar i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #c4b5fd, #8b5cf6);
    border-radius: 999px;
}
.poll-result-pct {
    font-weight: 800;
    color: #6d28d9;
    min-width: 2.5rem;
    text-align: right;
}

@media (max-width: 640px) {
    .poll-card { flex-wrap: wrap; }
    .poll-card-actions { width: 100%; }
}
