/* Sınıf araçları: üst çubukta Öğrenci seç / Kalem, içerik üstünde tahta araçlarıyla çizim, öğrenci seçici penceresi */

/* ——— Üst çubuk (normal ve tam ekran) */
.class-tools{display:flex;gap:8px;align-items:center;margin-left:auto;flex-wrap:nowrap}
#activity-dialog #activity-surface>header>.class-tools,#activity-dialog header>.class-tools{flex:0 0 auto;min-width:auto;overflow:visible;margin-left:auto}
.class-tools[hidden],.class-tool-btn[hidden],#activity-dialog header .class-tool-btn[hidden],#activity-dialog header>.class-tools[hidden]{display:none!important}
#activity-dialog header .class-tool-btn{display:inline-flex!important;align-items:center;gap:8px;white-space:nowrap;background:#f3efff;color:#5b3fc4;border:1px solid #e4dcfb}
#activity-dialog header .class-tool-btn::before{display:none!important}
#activity-dialog header .class-tool-btn:hover{background:#ebe4ff}
.class-tool-btn svg{width:20px;height:20px;flex-shrink:0}
#activity-dialog header .class-tool-btn.active,.class-tool-btn.active{background:linear-gradient(135deg,#7c5cff,#5b3fd9)!important;color:#fff!important;border-color:transparent!important;box-shadow:0 6px 14px #6d4aff40}
#activity-dialog header #print-image{background:#f3efff;color:#5b3fc4;border:1px solid #e4dcfb}
#activity-dialog header #fullscreen-activity{background:#fff;color:#2b3246;border:1px solid #dfe3ec}
#activity-dialog header #fullscreen-activity:hover{background:#f5f6fa}
.board-class-tools{margin:0}
/* Tam ekranda üst çubuk kalır (içerik altında başlar); yalnızca başlık ve araçlar */
#activity-dialog #activity-surface.immersive-player>header{display:flex!important;flex:0 0 auto;align-items:center;min-height:64px;padding:8px max(16px,env(safe-area-inset-right)) 8px max(20px,env(safe-area-inset-left))!important;background:#fff;border-bottom:1px solid #eceef4;position:relative;z-index:9}
#activity-dialog #activity-surface.immersive-player>header small,#activity-dialog #activity-surface.immersive-player #close-activity,#activity-dialog #activity-surface.immersive-player #exit-immersive-player{display:none!important}
#activity-dialog #activity-surface.immersive-player>header h2{font-size:clamp(16px,1.5vw,20px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(min-width:901px){
  #activity-dialog #activity-surface>header .class-tool-btn,#activity-dialog #activity-surface>header #print-image,#activity-dialog #activity-surface>header #fullscreen-activity{width:auto!important;flex:0 0 auto!important;height:46px!important;min-height:46px!important;padding:0 16px!important;font-size:15px!important;font-weight:750;gap:8px;border-radius:14px}
}
@media(max-width:900px){.class-tool-btn span{display:none}#activity-dialog header .class-tool-btn{padding:0 11px!important}}

/* ——— Çizim katmanı ve yazı kutusu */
#activity-surface{position:relative}
.annotate-layer{position:absolute;left:0;width:100%;z-index:5;pointer-events:none;touch-action:none}
.annotate-layer.active{pointer-events:auto;cursor:crosshair}
.annotate-layer.active[data-tool=select],.pdf-ink.active[data-tool=select]{cursor:default}
.annotate-layer.active[data-tool=text],.pdf-ink.active[data-tool=text]{cursor:text}
.ink-text-input{z-index:12}

/* ——— Tahta paleti içerikte (görünüm board.css'teki .board-tools kurallarından gelir) */
.ink-ui{--b-ink:#1f2433;--b-mute:#5b6378;--b-line:#e6e9f0;--b-hover:#eff1f6;--b-accent:#6d4aff;--b-accent2:#5536e0;--b-glass:rgba(255,255,255,.92);font-family:'DM Sans',sans-serif;color:var(--b-ink);user-select:none;-webkit-user-select:none}
.ink-ui button{font:inherit;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;box-shadow:none;margin:0}
.ink-ui svg{width:24px;height:24px;display:block}
.ink-ui[hidden],.ink-ui [hidden]{display:none!important}
.ink-palette{z-index:10}
.ink-ui.board-stamps{z-index:11}
.ink-palette .board-tool{min-height:0;padding:0}
.ink-palette.vertical .board-acts{grid-template-columns:repeat(4,auto);gap:4px}
.ink-palette.vertical .board-acts .board-tool{width:34px;height:36px;border-radius:10px}
.ink-palette.vertical .board-acts .board-tool svg{width:20px;height:20px}

/* ——— Öğrenci seçici penceresi */
.class-widget{position:fixed;z-index:2100;width:200px;max-width:calc(100vw - 24px);background:#fff;border:0;border-radius:22px;box-shadow:0 2px 6px #1f243314,0 16px 40px #1f243326;overflow:hidden;font-family:'DM Sans',sans-serif;color:#1f2433;transition:box-shadow .2s}
.class-widget[hidden]{display:none}
.class-widget.dragging{box-shadow:0 2px 6px #1f243314,0 26px 60px #1f24333d;transition:none}
.class-widget .class-widget-head{display:flex;align-items:center;gap:0;height:auto;min-height:0;padding:12px 10px 0 12px;margin:0;border:0!important;background:transparent;box-shadow:none;cursor:grab;touch-action:none;user-select:none}
.class-widget.dragging .class-widget-head{cursor:grabbing}
.class-widget-grip{display:block;width:36px;height:28px;margin-right:auto;border-radius:9px;background:#f6f7fa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='10' fill='%239aa2b6'%3E%3Ccircle cx='2' cy='2' r='1.8'/%3E%3Ccircle cx='9' cy='2' r='1.8'/%3E%3Ccircle cx='16' cy='2' r='1.8'/%3E%3Ccircle cx='2' cy='8' r='1.8'/%3E%3Ccircle cx='9' cy='8' r='1.8'/%3E%3Ccircle cx='16' cy='8' r='1.8'/%3E%3C/svg%3E") no-repeat center}
.class-widget-title{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.class-widget-btn{width:34px;height:34px;border:0;border-radius:10px;background:transparent;color:#4d5468;display:grid;place-items:center;cursor:pointer;flex-shrink:0;padding:0;margin:0;box-shadow:none}
.class-widget-btn svg{width:20px;height:20px}
.class-widget-btn:hover{background:#f1f2f6;color:#1f2433}
.class-widget-body{padding:6px 16px 18px;display:grid;gap:14px;justify-items:center;text-align:center}
.class-widget.minimized .class-widget-body{display:none}
.class-widget.minimized .class-widget-head{padding-bottom:12px}
.picker-stage{display:grid;justify-items:center;gap:8px}
.picker-avatar{width:136px;height:136px;border-radius:50%;background:#efeafd;display:grid;place-items:center;overflow:hidden;box-shadow:0 0 0 6px #fff}
.picker-avatar img{width:100%;height:100%;object-fit:cover}
.picker-initial{font:800 64px/1 'Manrope',sans-serif;color:#6d4fe0}
.picker-stage.spinning .picker-avatar{animation:pickerSpin .5s linear infinite}
.picker-stage.chosen .picker-avatar{animation:pickerPop .45s ease;box-shadow:0 0 0 4px #ffd43b}
.picker-name{font-size:17px;font-weight:800;line-height:1.25;overflow-wrap:anywhere}
.picker-name:empty{display:none}
@keyframes pickerSpin{from{transform:rotate(0)}to{transform:rotate(360deg)}}
@keyframes pickerPop{0%{transform:scale(.85)}60%{transform:scale(1.08)}100%{transform:scale(1)}}
.class-widget .picker-go{min-height:52px;min-width:100px;margin:2px 0 0;padding:0 26px;border:0;border-radius:14px;background:#6d4fe0;box-shadow:none;color:#fff;font-size:20px;font-weight:800;justify-content:center}
.class-widget .picker-go:hover{background:#5f42d4}
.class-widget .picker-go:disabled{opacity:.75}
.picker-left{margin:0;font-size:16px;color:#4d5468}
.class-widget .picker-go{gap:10px}
.class-widget .picker-go svg{width:22px;height:22px;flex-shrink:0;stroke-width:2.2}
.class-widget .picker-go.spinning svg{animation:pickerSpin .7s linear infinite}
.class-widget .picker-go:disabled{opacity:1}
.picker-empty{margin:0;color:#6b6f86;font-size:13px}

/* ——— PDF sayfa görünümü (öğretmen) — çizimler sayfaya yapışır */
.pdf-view{position:relative;flex:1 1 0;min-height:0;height:0;overflow:auto;background:#eef1f6;background-image:radial-gradient(#d3d9e4 1.1px,transparent 1.3px);background-size:24px 24px;padding:24px 24px 0;box-sizing:border-box;overscroll-behavior:contain}
.pdf-pages{display:flex;flex-direction:column;align-items:center;gap:20px}
.pdf-page{position:relative;background:#fff;border-radius:6px;box-shadow:0 2px 4px #1f243314,0 14px 36px #1f243324;flex:0 0 auto;overflow:hidden}
.pdf-page canvas{position:absolute;inset:0;width:100%;height:100%;display:block}
.pdf-ink{pointer-events:none;touch-action:auto}
.pdf-ink.active{pointer-events:auto;touch-action:none;cursor:crosshair}
.pdf-loading{padding:60px 0;color:#5f6b80;font-size:15px}
.pdf-zoom{position:sticky;bottom:14px;z-index:3;display:flex;width:max-content;margin:18px auto 14px;justify-content:center;align-items:center;gap:4px;padding:6px;border-radius:18px;background:rgba(255,255,255,.92);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);border:1px solid #fff;box-shadow:0 2px 4px #1f243312,0 12px 32px #1f243326}
.pdf-zoom button{min-width:44px;height:44px;border:0;border-radius:12px;background:transparent;color:#253047;font:inherit;font-size:22px;font-weight:700;cursor:pointer;margin:0;padding:0;box-shadow:none}
.pdf-zoom button:hover{background:#eff1f6}
.pdf-zoom .pdf-fit{font-size:15px;padding:0 16px;border-left:1px solid #e6e9f0;border-radius:0 12px 12px 0}
.pdf-zoom-val{min-width:64px;text-align:center;font-weight:800;color:#253047;font-size:16px}
.pdf-zoom-val:empty{display:none}
.pdf-zoom .pdf-fit.active{background:#efeaff;color:#5536e0}

/* ——— Telefon */
@media(max-width:760px){
  #activity-dialog #activity-surface.immersive-player>header{min-height:52px;padding:6px 8px 6px 12px!important}
  .ink-palette{left:8px!important;right:8px;top:auto!important;bottom:calc(8px + env(safe-area-inset-bottom));flex-direction:row!important;flex-wrap:wrap;justify-content:center;gap:4px 8px;padding:6px;border-radius:18px}
  .ink-palette .board-grip{display:none}
  .ink-palette .board-group{display:flex!important;flex-wrap:wrap;justify-content:center;border:0!important;padding:0!important;gap:2px}
  .ink-palette .board-tool{width:40px;height:40px;border-radius:12px}
  .ink-palette .board-tool svg{width:22px;height:22px}
  .ink-palette .board-color{width:24px;height:24px;margin:2px}
  .ink-palette .board-size{width:32px;height:32px}
  .ink-ui.board-stamps{left:8px!important;right:8px;top:auto!important;grid-template-columns:repeat(5,1fr)}
  .ink-ui.board-stamps button{width:100%}
  .pdf-view{padding:12px 8px 0}
  .class-widget{width:180px}
  .picker-avatar{width:110px;height:110px}
}

/* Görsel içerik: alanın ortasında (dikey ve yatay), kalan alanı doldurarak */
#activity-surface>.tracked-image{flex:0 0 auto;min-height:0;margin:auto;max-width:calc(100% - 48px);max-height:calc(100dvh - 150px);object-fit:contain}
#activity-dialog #activity-surface.immersive-player>.tracked-image{max-height:calc(100dvh - 112px)}
#activity-surface>header+#save-status:empty{display:none}
/* PDF: kısa belgeler de dikeyde ortalı */
.pdf-view{display:flex;flex-direction:column}
.pdf-pages{flex:1 0 auto;justify-content:center}
