/* plan ekranlarına özel stiller: ortak görüntüleyici (js/plan/planview.js) ve üç kat planı ekranı */

/* ---------- görüntüleyici (PlanDrawer + SubViewportContainer) ---------- */
.plan-view { position: relative; flex: 1 1 0; min-width: 0; min-height: 0; overflow: hidden; outline: none; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.plan-view.is-drawing, .plan-view.is-placing { cursor: crosshair; }
.plan-view.is-panning { cursor: grabbing; }
.plan-view.is-moving { cursor: move; }
.plan-image { position: absolute; left: 0; top: 0; max-width: none; max-height: none; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.plan-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.plan-devices { position: absolute; inset: 0; pointer-events: none; }
.plan-tools { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 4px; cursor: default; }
.plan-tools .btn { background: var(--bg); }
.plan-tools .btn:hover:not(:disabled) { background: var(--card); }

/* ---------- cihaz işareti (placedDevice.tscn + PlacedDevice.cs) ---------- */
.plan-device { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.plan-device-badge { position: absolute; left: -16px; top: -16px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: 1px solid #d1d6db; border-radius: 8px; background: var(--plan-badge, #24292b); pointer-events: auto; cursor: pointer; }
.plan-device-badge img { width: 24px; height: auto; max-height: 28px; pointer-events: none; }
.plan-device-label { position: absolute; left: 0; top: 18px; transform: translateX(-50%); min-width: 120px; text-align: center; line-height: 22px; font-size: 14px; white-space: nowrap; color: var(--text); pointer-events: none; }
/* 0,6 sn boşta, 0,6 sn uyarı rengi (PlacedDevice.BlinkPeriod) */
.plan-device.is-alarm .plan-device-badge { animation: plan-blink-alarm 1.2s steps(1, end) infinite; }
.plan-device.is-fault .plan-device-badge { animation: plan-blink-fault 1.2s steps(1, end) infinite; }
@keyframes plan-blink-alarm { 0% { background: var(--plan-badge, #24292b); } 50% { background: #c73838; } 100% { background: #c73838; } }
@keyframes plan-blink-fault { 0% { background: var(--plan-badge, #24292b); } 50% { background: #d99e2e; } 100% { background: #d99e2e; } }

/* ---------- ekranlar (addFloorPlan / selectArea / devicePlacement) ---------- */
.plan-screen { gap: 0; }
.plan-bar { flex: none; display: flex; align-items: center; gap: 4px; min-height: 40px; min-width: 0; border-bottom: 1px solid var(--border); }
.plan-bar .field { min-height: 32px; }
.plan-bar select.field { flex: none; max-width: 100%; }
.plan-bar .plan-name { width: 320px; flex: 0 1 320px; }
.plan-bar .spacer { min-width: 0; }
.plan-layout { flex: 1 1 0; display: flex; min-width: 0; min-height: 0; }
.plan-side { flex: none; width: 260px; min-height: 0; overflow-x: hidden; overflow-y: auto; border-right: 1px solid var(--border); padding: 4px 8px 8px 16px; }
.plan-side-list { display: flex; flex-direction: column; gap: 4px; }
.plan-side .acc-children { gap: 4px; }
.plan-dev-btn { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 32px; padding: 4px 8px; text-align: left; font-family: var(--font-mono); font-size: 12px; color: #d97373; background: transparent; border: 1px solid var(--field-border); border-radius: 6px; cursor: pointer; }
.plan-dev-btn.is-placed { color: #73d98c; }
.plan-dev-btn:hover { background: rgba(255, 255, 255, 0.05); border-color: var(--field-border-hover); }
.plan-dev-btn.is-pending { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.plan-dev-btn img { flex: none; width: 24px; height: auto; pointer-events: none; }
.plan-dev-btn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 900px) {
  .plan-bar { flex-wrap: wrap; padding: 4px 0; }
  .plan-side { width: 200px; }
}
