/* «قيّم معلمك» — the floating button and its dialog.
 *
 * Namespaced `sr-`, structurally a copy of bug-report.css's `br-` dialog (see
 * that file's own note on why it isn't built on `.modal`). The FAB sits at
 * bottom-RIGHT rather than bug-report.js's bottom-left on this same page --
 * mirroring the corner ai-chat.js's widget occupies for the teacher.
 *
 * Logical, not physical: `right` collided with bug-report.css's `.br-fab`
 * (inset-inline-end) the moment a student's dashboard_language flips `dir`
 * to `ltr` -- both then resolved to the physical right edge. inset-inline-start
 * still lands on the physical right in the default `rtl`, so nothing moves
 * for the common case; in `ltr` it correctly moves to the opposite side from
 * `.br-fab`.
 */

.sr-fab {
    position: fixed;
    inset-inline-start: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 9500;

    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    border: none;
    border-radius: 999px;
    cursor: pointer;

    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #f5b731, #d97706);
    box-shadow: 0 6px 18px rgba(217, 119, 6, 0.35);
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.sr-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(217, 119, 6, 0.45);
}

.sr-fab:active { transform: translateY(0); }

.sr-fab i { font-size: 1rem; }

@media (max-width: 520px) {
    .sr-fab { padding: 12px; }
    .sr-fab .sr-fab-label { display: none; }
}

@media print {
    .sr-fab, .sr-overlay { display: none !important; }
}

/* ---------- dialog ---------- */

.sr-overlay {
    position: fixed;
    inset: 0;
    z-index: 9600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;

    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, visibility .18s ease;
}

.sr-overlay.sr-open {
    opacity: 1;
    visibility: visible;
}

.sr-dialog {
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 16px;
    background: var(--white, #fff);
    color: var(--text-primary, #333);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);

    transform: translateY(18px) scale(.98);
    transition: transform .2s ease;
}

.sr-overlay.sr-open .sr-dialog { transform: none; }

.sr-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color, #ddd);
}

.sr-head h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary, #333);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sr-head h3 i { color: #d97706; }

.sr-close {
    border: none;
    background: transparent;
    color: var(--text-secondary, #666);
    font-size: 1.2rem;
    line-height: 1;
    padding: 6px;
    cursor: pointer;
    border-radius: 8px;
}

.sr-close:hover { background: var(--hover-bg, rgba(0, 0, 0, .05)); }

.sr-body { padding: 18px; }

.sr-field { margin-bottom: 16px; }

.sr-field label {
    display: block;
    margin-bottom: 6px;
    font-size: .88rem;
    font-weight: 700;
    color: var(--text-primary, #333);
}

.sr-required { color: #c0392b; }

.sr-field .sr-hint {
    display: block;
    margin-top: 5px;
    font-size: .76rem;
    font-weight: 400;
    color: var(--text-secondary, #666);
}

.sr-field input[type="text"],
.sr-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 12px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 10px;
    background: var(--input-bg, #fff);
    color: var(--text-primary, #333);
    font-family: inherit;
    font-size: .92rem;
}

.sr-field textarea { min-height: 110px; resize: vertical; }

.sr-field input:focus,
.sr-field textarea:focus {
    outline: none;
    border-color: var(--accent-color, #137980);
    box-shadow: 0 0 0 3px rgba(19, 121, 128, .15);
}

/* ---------- star rating ---------- */

.sr-stars {
    display: flex;
    gap: 8px;
    font-size: 1.6rem;
    color: #d1d5db;
}

.sr-stars i {
    cursor: pointer;
    transition: color .15s ease, transform .1s ease;
}

.sr-stars i:hover { transform: scale(1.1); }

.sr-stars i.filled { color: #f59e0b; }

.sr-msg {
    display: none;
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: .85rem;
    font-weight: 600;
}

.sr-msg.sr-error { display: block; background: rgba(220, 53, 69, .12); color: #c0392b; }
.sr-msg.sr-ok { display: block; background: rgba(40, 167, 69, .12); color: #1e8449; }

.sr-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 0 18px 18px;
}

.sr-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
}

.sr-btn-cancel {
    background: var(--light-gray, #f0f0f0);
    color: var(--text-primary, #333);
}

.sr-btn-send {
    background: linear-gradient(135deg, #f5b731, #d97706);
    color: #fff;
}

.sr-btn:disabled { opacity: .6; cursor: not-allowed; }
