/* ========================================================
   三年級數學備課平台 - 特教教師實務專業工具箱樣式庫
   (冷靜通道、親師聯絡小單、5位同學代幣存摺、60秒備課卡)
   ======================================================== */

/* 5 位同學代幣存摺頂部橫霸 (5-Student Star Bank Bar) */
.student-bank-container {
  background: var(--bg-card);
  border-bottom: 2px solid var(--border-color);
  padding: 8px 24px;
}
.student-bank-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.student-bank-label {
  font-size: 0.95rem;
  font-weight: 800;
  color: #4338ca;
  display: flex;
  align-items: center;
  gap: 6px;
}
.student-bank-grid {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.student-bank-card {
  background: var(--bg-subtle);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.student-bank-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.st-avatar-box {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}
.st-info {
  display: flex;
  flex-direction: column;
}
.st-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main);
  cursor: pointer;
}
.st-stars {
  font-size: 0.85rem;
  font-weight: 800;
  color: #d97706;
}
.st-actions {
  display: flex;
  gap: 4px;
}
.btn-star-mini {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  font-weight: 900;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-star-mini:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}
.btn-star-sub {
  color: var(--danger);
}

/* ==================== 模態框共用結構 (Modal Overlays) ==================== */
.teacher-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.teacher-modal-content {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: modalPopIn 0.25s ease-out;
}
@keyframes modalPopIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.teacher-modal-header {
  padding: 16px 24px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-close-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #ffffff;
  font-size: 1.3rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.modal-close-btn:hover {
  background: rgba(255,255,255,0.4);
}

.teacher-modal-footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==================== 🧘 冷靜通道專用樣式 (Calm Corner) ==================== */
.calm-tabs-nav {
  display: flex;
  background: #f0fdfa;
  border-bottom: 2px solid #ccfbf1;
  padding: 8px 16px;
  gap: 8px;
  overflow-x: auto;
}
.calm-tab-btn {
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f766e;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.calm-tab-btn.active {
  background: #0f766e;
  color: #ffffff;
}
.calm-tab-btn.rain-btn {
  margin-left: auto;
  background: #e0f2fe;
  color: #0369a1;
}
.calm-tab-btn.rain-btn.active {
  background: #0284c7;
  color: #ffffff;
}

.calm-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* 4-7-8 呼吸光環動畫 */
.breathing-arena {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  gap: 20px;
}
.breathing-bubble-container {
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.breathing-bubble {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2dd4bf, #0f766e);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 30px rgba(15, 118, 110, 0.4);
  transition: transform ease-in-out;
}

.breathing-bubble.inhale {
  transform: scale(1.6);
  transition-duration: 4s;
}
.breathing-bubble.hold {
  transform: scale(1.6);
  box-shadow: 0 0 50px rgba(245, 158, 11, 0.6);
}
.breathing-bubble.exhale {
  transform: scale(0.9);
  transition-duration: 8s;
}

.breathing-main-text {
  font-size: 1.6rem;
  font-weight: 900;
  color: #0f766e;
  text-align: center;
}
.breathing-sub-text {
  font-size: 1.05rem;
  color: #115e59;
  text-align: center;
  margin-top: 4px;
}
.breathing-cycle-pill {
  display: inline-block;
  background: #ccfbf1;
  color: #0f766e;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 4px 12px;
  border-radius: 20px;
  margin-top: 10px;
}

.calm-tip-bar {
  background: #fef3c7;
  border-left: 5px solid #d97706;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 0.95rem;
  color: #78350f;
  margin-top: 20px;
}

/* 視覺沙漏計時器 */
.sensory-timer-card {
  text-align: center;
  padding: 20px;
}
.timer-duration-pills {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}
.timer-pill {
  background: var(--bg-subtle);
  border: 2px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
}
.timer-pill.active {
  background: #0f766e;
  border-color: #0f766e;
  color: #ffffff;
}
.timer-display-huge {
  font-size: 4.8rem;
  font-weight: 900;
  font-family: monospace;
  color: #0f766e;
  line-height: 1;
  margin-bottom: 20px;
}
.sensory-progress-track {
  width: 100%;
  max-width: 440px;
  height: 14px;
  background: #e2e8f0;
  border-radius: 10px;
  margin: 0 auto;
  overflow: hidden;
}
.sensory-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2dd4bf, #0f766e);
  transition: width 1s linear;
}

/* 5-4-3-2-1 五感著陸列表 */
.grounding-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.grounding-item-box {
  background: #f0fdfa;
  border: 2px solid #99f6e4;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.grounding-item-box:hover {
  background: #ccfbf1;
}
.grounding-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #0f766e;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 900;
  color: #ffffff;
  flex-shrink: 0;
}
.grounding-check.checked {
  background: #0f766e;
}

/* ==================== 📝 親師聯絡單 & 4合1小單 (Communication Modal) ==================== */
.comm-modal-body {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  padding: 24px;
  overflow-y: auto;
  max-height: 70vh;
}
@media (max-width: 860px) {
  .comm-modal-body {
    grid-template-columns: 1fr;
  }
}
.comm-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: #3730a3;
}
.comm-textarea {
  width: 100%;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.6;
  resize: vertical;
  background: #f8fafc;
}

/* A4 4合1 實體小單預覽網格 */
.slips-preview-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.comm-slip-card {
  background: #ffffff;
  border: 1.5px dashed #64748b;
  border-radius: 6px;
  padding: 10px;
  font-size: 0.8rem;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.slip-header {
  font-weight: 800;
  color: #1e3a8a;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
  display: flex;
  justify-content: space-between;
}
.slip-body {
  margin: 6px 0;
}
.slip-task {
  background: #fef3c7;
  padding: 4px 6px;
  border-radius: 4px;
  margin: 4px 0;
  color: #78350f;
}
.slip-footer {
  border-top: 1px dashed #cbd5e1;
  padding-top: 4px;
  display: flex;
  justify-content: space-between;
  color: #64748b;
  font-size: 0.75rem;
}

/* ==================== 🖨️ 列印 A4 4合1 小單專用模式 ==================== */
@media print {
  body.printing-slips-only * {
    visibility: hidden;
  }
  body.printing-slips-only #commSlipsGrid,
  body.printing-slips-only #commSlipsGrid * {
    visibility: visible;
  }
  body.printing-slips-only #commSlipsGrid {
    position: absolute;
    left: 0;
    top: 0;
    width: 100vw;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr 1fr !important;
    gap: 20px !important;
    padding: 20px !important;
  }
  body.printing-slips-only .comm-slip-card {
    border: 1.5px dashed #000000 !important;
    padding: 16px !important;
    font-size: 11pt !important;
  }
}
