/* shared/settings — öğretmen ayarlar paneli v2 */

.tset-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 320;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}
.tset-overlay.is-open { opacity: 1; pointer-events: auto; }

.tset-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    height: 100dvh;
    width: min(22rem, 78vw);
    max-width: 22rem;
    box-sizing: border-box;
    padding-top: var(--mp-safe-top, env(safe-area-inset-top, 0px));
    background: #f1f5f9;
    z-index: 321;
    box-shadow: -16px 0 48px rgba(15, 23, 42, 0.2);
    transform: translateX(105%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Poppins', 'Segoe UI', sans-serif;
}
.tset-panel.is-open { transform: translateX(0); }

@media (max-width: 640px) {
    .tset-panel {
        width: min(18.5rem, 72vw);
        max-width: 18.5rem;
    }
}

/* —— Hero —— */
.tset-hero {
    position: relative;
    padding: 1.1rem 1.15rem 1rem;
    background: linear-gradient(145deg, #0f766e 0%, #0d9488 45%, #14b8a6 100%);
    color: #fff;
    flex-shrink: 0;
}
.tset-hero-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.25;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.35) 0 1px, transparent 1px),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.2) 0 1px, transparent 1px);
    background-size: 14px 14px, 18px 18px;
    pointer-events: none;
}
.tset-hero-row {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}
.tset-kicker {
    margin: 0 0 0.15rem;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.85;
}
.tset-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.tset-sub {
    margin: 0.2rem 0 0;
    font-size: 0.68rem;
    opacity: 0.9;
    line-height: 1.4;
}
.tset-close {
    width: 2.15rem;
    height: 2.15rem;
    border: none;
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}
.tset-close:hover { background: rgba(255, 255, 255, 0.28); }

/* —— Body —— */
.tset-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem 0.85rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    -webkit-overflow-scrolling: touch;
}

.tset-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 0.85rem 0.9rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.tset-card-head {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}
.tset-card-head h3 {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 800;
    color: #0f172a;
}
.tset-card-head p {
    margin: 0.12rem 0 0;
    font-size: 0.62rem;
    color: #64748b;
    line-height: 1.35;
}

.tset-card-icon {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}
.tset-card-icon.is-teal { background: #ccfbf1; color: #0f766e; }
.tset-card-icon.is-violet { background: #ede9fe; color: #6d28d9; }
.tset-card-icon.is-sky { background: #e0f2fe; color: #0369a1; }
.tset-card-icon.is-amber { background: #fef3c7; color: #b45309; }
.tset-card-icon.is-rose { background: #ffe4e6; color: #be123c; }

.tset-field {
    margin-bottom: 0.65rem;
}
.tset-field:last-child { margin-bottom: 0; }
.tset-field > label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: #334155;
}
.tset-field > label output {
    font-size: 0.62rem;
    font-weight: 800;
    color: #0d9488;
}

.tset-input,
.tset-textarea {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    background: #f8fafc;
    font-size: 0.72rem;
    color: #0f172a;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.tset-input:focus,
.tset-textarea:focus {
    outline: none;
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}
.tset-textarea { resize: vertical; min-height: 5rem; }

.tset-hint {
    margin: 0.35rem 0 0;
    font-size: 0.58rem;
    line-height: 1.45;
    color: #94a3b8;
}

/* Segmented control */
.tset-seg {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.3rem;
    padding: 0.25rem;
    background: #f1f5f9;
    border-radius: 0.7rem;
    border: 1px solid #e2e8f0;
}
.tset-seg--4 {
    grid-template-columns: repeat(2, 1fr);
}
.tset-seg--4 .tset-seg-btn {
    font-size: 0.56rem;
    padding: 0.4rem 0.25rem;
}
.tset-seg-btn {
    padding: 0.45rem 0.35rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    font-size: 0.62rem;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.tset-seg-btn.is-active {
    background: #fff;
    color: #0f766e;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.tset-range {
    width: 100%;
    accent-color: #0d9488;
    margin: 0.15rem 0;
}
.tset-range-hints {
    display: flex;
    justify-content: space-between;
    font-size: 0.55rem;
    color: #94a3b8;
    font-weight: 600;
}

/* Toggle */
.tset-toggle {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.5rem;
    cursor: pointer;
    font-size: 0.68rem;
    color: #475569;
    font-weight: 600;
    line-height: 1.35;
}
.tset-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.tset-toggle-ui {
    width: 2.1rem;
    height: 1.2rem;
    border-radius: 999px;
    background: #cbd5e1;
    flex-shrink: 0;
    position: relative;
    transition: background 0.2s;
}
.tset-toggle-ui::after {
    content: '';
    position: absolute;
    top: 0.15rem;
    left: 0.15rem;
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: transform 0.2s;
}
.tset-toggle input:checked + .tset-toggle-ui {
    background: #14b8a6;
}
.tset-toggle input:checked + .tset-toggle-ui::after {
    transform: translateX(0.9rem);
}

/* Buttons */
.tset-btn {
    display: block;
    width: 100%;
    margin-top: 0.45rem;
    padding: 0.58rem 0.75rem;
    border: none;
    border-radius: 0.65rem;
    font-size: 0.7rem;
    font-weight: 800;
    cursor: pointer;
    transition: filter 0.15s, transform 0.1s;
}
.tset-btn:active { transform: scale(0.99); }
.tset-btn.is-primary {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: #fff;
    box-shadow: 0 3px 10px rgba(13, 148, 136, 0.3);
}
.tset-btn.is-dark {
    background: linear-gradient(135deg, #334155, #1e293b);
    color: #fff;
}
.tset-btn.is-outline {
    background: #fff;
    color: #0f766e;
    border: 1px solid #99f6e4;
}
.tset-btn.is-ghost {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

/* Quick actions */
.tset-quick-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.4rem;
}
.tset-quick {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    background: #f8fafc;
    font-size: 0.68rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
}
.tset-quick:hover {
    background: #f0fdfa;
    border-color: #99f6e4;
}
.tset-quick i {
    width: 1.35rem;
    text-align: center;
    color: #0d9488;
}

.tset-support-composer {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px dashed #e2e8f0;
}
.tset-support-composer.hidden { display: none !important; }
.tset-support-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    margin-top: 0.45rem;
}

.tset-foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0 0.25rem;
    font-size: 0.58rem;
    color: #94a3b8;
    text-align: center;
}
.tset-link {
    border: none;
    background: none;
    color: #64748b;
    font-size: 0.58rem;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

body.teacher-settings-open { overflow: hidden; }

/* —— Uygulanan görünüm tercihleri (öğretmen paneli) —— */
html.mp-teacher-ui-scaled {
    font-size: calc(16px * var(--mp-ui-scale, 1));
}
#teacher-panel.tset-ui-compact {
    --mp-ui-gap: 0.88;
}
#teacher-panel.tset-ui-phone {
    --mp-ui-gap: 1.08;
}
#teacher-panel.tset-ui-overview {
    --mp-ui-gap: 0.82;
}
#teacher-panel.tset-ui-compact .tdash-nav-item,
#teacher-panel.tset-ui-compact .tdash-card,
#teacher-panel.tset-ui-compact .tdash-stat-card,
#teacher-panel.tset-ui-phone .tdash-nav-item,
#teacher-panel.tset-ui-phone .tdash-card,
#teacher-panel.tset-ui-phone .tdash-stat-card,
#teacher-panel.tset-ui-overview .tdash-nav-item,
#teacher-panel.tset-ui-overview .tdash-card,
#teacher-panel.tset-ui-overview .tdash-stat-card {
    padding-block: calc(0.55rem * var(--mp-ui-gap, 1));
}

/* Büyük yazıda kutular taşmasın */
html.mp-teacher-ui-scaled #teacher-panel .tdash-card,
html.mp-teacher-ui-scaled #teacher-panel .tdash-stat-card,
html.mp-teacher-ui-scaled #teacher-panel .tdash-nav-item,
html.mp-teacher-ui-scaled #teacher-panel .tdash-island-stat,
html.mp-teacher-ui-scaled #teacher-panel .tdash-island-cal,
html.mp-teacher-ui-scaled #teacher-panel button,
html.mp-teacher-ui-scaled #teacher-panel .notif-hub-kpi {
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
    min-height: 0;
}
html.mp-teacher-ui-scaled #teacher-panel.tset-font-large .tdash-card,
html.mp-teacher-ui-scaled #teacher-panel.tset-font-large .tdash-stat-card {
    padding: calc(0.75rem * var(--mp-ui-gap, 1));
}
html.mp-teacher-ui-scaled #teacher-panel .tdash-stat-card strong,
html.mp-teacher-ui-scaled #teacher-panel .tdash-card h3,
html.mp-teacher-ui-scaled #teacher-panel .tdash-nav-item {
    white-space: normal;
    text-overflow: unset;
    overflow: visible;
}

.tset-actions-bar {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: 1.4fr 1fr 0.9fr;
    gap: 0.4rem;
    padding: 0.65rem 0.85rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(241, 245, 249, 0.85) 0%, #f1f5f9 35%, #f1f5f9 100%);
    border-top: 1px solid #e2e8f0;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.tset-actions-bar .tset-btn { margin: 0; width: 100%; }
.tset-actions-defaults { font-size: 0.58rem !important; }
.tset-btn.is-saving {
    opacity: 0.85;
    pointer-events: none;
}
.tset-btn.is-saved {
    background: #059669 !important;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
}
.tset-save-status {
    display: none;
    width: 100%;
    grid-column: 1 / -1;
    text-align: center;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #0f766e;
    padding: 0.15rem 0 0.1rem;
}
.tset-save-status.is-on { display: block; }
.tset-save-status.is-ok { color: #047857; }
.tset-sent-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-height: 11rem;
    overflow-y: auto;
}
.tset-sent-item {
    padding: 0.55rem 0.65rem;
    border-radius: 0.55rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 0.62rem;
    line-height: 1.45;
}
.tset-sent-item strong { display: block; color: #0f766e; font-size: 0.58rem; margin-bottom: 0.15rem; }
.tset-sent-item time { color: #94a3b8; font-size: 0.52rem; }
.tset-sent-empty { font-size: 0.62rem; color: #94a3b8; margin: 0; }
.tset-sent-reply { font-size: 0.58rem; color: #475569; margin: 0.2rem 0 0; font-style: italic; }

/* Karanlık mod — öğretmen paneli */
#teacher-panel.tset-theme-dark {
    color-scheme: dark;
    background: #0f172a;
    color: #e2e8f0;
}
#teacher-panel.tset-theme-dark .tsh-module-panel,
#teacher-panel.tset-theme-dark .tdash-card,
#teacher-panel.tset-theme-dark .tdash-island-ataturk,
#teacher-panel.tset-theme-dark .tdash-island-cal,
#teacher-panel.tset-theme-dark .tdash-quick-announce,
#teacher-panel.tset-theme-dark .s360-students-panel {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}
#teacher-panel.tset-theme-dark .tdash-section-sub,
#teacher-panel.tset-theme-dark .tdash-zone-desc,
#teacher-panel.tset-theme-dark .text-slate-500,
#teacher-panel.tset-theme-dark .text-slate-600 {
    color: #94a3b8 !important;
}
#teacher-panel.tset-theme-dark .tdash-search-input,
#teacher-panel.tset-theme-dark .s360-search-input,
#teacher-panel.tset-theme-dark input,
#teacher-panel.tset-theme-dark textarea,
#teacher-panel.tset-theme-dark select {
    background: #0f172a;
    border-color: #475569;
    color: #f8fafc;
}

.notif-support-status.is-open { color: #f59e0b; }
.notif-support-status.is-in_progress { color: #3b82f6; }
.notif-support-status.is-resolved { color: #10b981; }
.notif-support-reply { font-size: 0.65rem; color: #64748b; margin: 0.25rem 0 0; }

#teacher-panel.tset-reduce-motion *,
#teacher-panel.tset-reduce-motion *::before,
#teacher-panel.tset-reduce-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

/* —— Öğrenci görünüm / ölçek —— */
html.mp-student-ui-scaled {
    font-size: calc(16px * var(--mp-student-ui-scale, var(--mp-ui-scale, 1)));
}
#student-panel.sset-ui-compact { --mp-ui-gap: 0.88; }
#student-panel.sset-ui-phone { --mp-ui-gap: 1.08; }
#student-panel.sset-ui-overview { --mp-ui-gap: 0.82; }
html.mp-student-ui-scaled #student-panel .s-bento-card,
html.mp-student-ui-scaled #student-panel .s-dock-btn,
html.mp-student-ui-scaled #student-panel .s-profile-btn,
html.mp-student-ui-scaled #student-panel button {
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
}
#student-panel.sset-reduce-motion *,
#student-panel.sset-reduce-motion *::before,
#student-panel.sset-reduce-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

/* Eski sınıf adları (geriye dönük) */
.tdash-settings-overlay { /* alias */ }
.tdash-settings-panel { /* alias */ }
