@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
  /* Hệ màu sáng (Light Mode Theme) */
  --bg-primary: #f8fafc; /* Slate 50 nhạt */
  --bg-secondary: #ffffff; /* Trắng tinh cho các card chính */
  --bg-tertiary: #f1f5f9; /* Slate 100 cho các input */
  --border-color: #e2e8f0; /* Slate 200 viền mỏng sạch sẽ */
  --border-hover: #cbd5e1;
  
  --text-primary: #0f172a; /* Slate 900 cho tiêu đề */
  --text-secondary: #475569; /* Slate 600 cho mô tả */
  --text-muted: #64748b; /* Slate 500 */
  
  --color-emergency: #ef4444; /* Đỏ khẩn cấp */
  --color-emergency-glow: rgba(239, 68, 68, 0.15);
  --color-high: #f97316;
  --color-medium: #eab308;
  --color-low: #3b82f6;
  --color-success: #10b981;
  
  --font-family: 'Plus Jakarta Sans', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.02) 0%, transparent 40%);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Container chính của học sinh */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 70px 16px; /* Bổ sung padding bottom để tránh bị che bởi bottom nav */
  width: 100%;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--bg-primary);
  min-height: 100vh;
}

/* Container của giáo viên (Dashboard rộng) */
.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
  width: 100%;
  flex-grow: 1;
}

/* ==================== TAB MANAGEMENT ==================== */
.tab-content {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tab-content.active {
  display: block;
  opacity: 1;
}

/* ==================== HOME HEADER ==================== */
.home-header {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  margin-bottom: 20px;
}

.welcome-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.main-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.35;
  margin-top: 2px;
  position: relative;
}

.highlight-blue {
  color: #2563eb;
  position: relative;
  display: inline-block;
}

.hand-drawn-elements {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
}

.hand-drawn-underline {
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 6px;
}

.hand-drawn-heart-icon {
  position: absolute;
  right: -16px;
  top: -24px;
  width: 14px;
  height: 14px;
  animation: beat-heart 1.5s infinite;
}

@keyframes beat-heart {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.sub-title {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-top: 8px;
}

.header-illustration-container {
  display: flex;
  justify-content: flex-end;
}

.header-illustration {
  max-height: 110px;
  object-fit: contain;
}

/* ==================== HERO GRID (Khối hành động chính) ==================== */
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 12px;
  margin-bottom: 20px;
}

.hero-card {
  border-radius: 20px;
  padding: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 135px;
  cursor: pointer;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.hero-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Card Báo Cáo (Xanh dương) */
.report-card {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
}

.report-card:hover {
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
}

/* Card Tin Tức (Xanh ngọc) */
.news-card {
  background: linear-gradient(135deg, #e6fcf5 0%, #cbfae2 100%);
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.12);
}

.news-card:hover {
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.15);
}

.card-info h2 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 4px;
}

.card-info p {
  font-size: 11px;
  opacity: 0.85;
  line-height: 1.35;
}

/* Icons trang trí nổi ở góc dưới card */
.card-icon-wrapper {
  position: absolute;
  bottom: -5px;
  right: -5px;
  opacity: 0.08;
  width: 70px;
  height: 70px;
  pointer-events: none;
}

.card-icon-wrapper svg {
  width: 100%;
  height: 100%;
}

.btn-action-white {
  background: #ffffff;
  color: #2563eb;
  border: none;
  border-radius: 30px;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  width: fit-content;
  margin-top: 10px;
  transition: var(--transition);
}

.btn-action-white:hover {
  background: #f8fafc;
  transform: scale(1.03);
}

.btn-circle-arrow {
  background: #ffffff;
  color: #059669;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  margin-top: 10px;
  transition: var(--transition);
}

.btn-circle-arrow:hover {
  transform: scale(1.1);
}

/* ==================== KHỐI CONTAINER CHUNG ==================== */
.section-container {
  margin-bottom: 20px;
}

.section-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.title-badge-blue {
  font-size: 15px;
}

/* ==================== KHỐI PHƯƠNG THỨC BÁO CÁO ==================== */
.method-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.method-card {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 12px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.01);
}

.method-card:hover {
  transform: translateY(-2px);
  border-color: #3b82f6;
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.06);
}

.method-icon-bg {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mask-blue {
  background: #eff6ff;
  color: #2563eb;
}

.user-green {
  background: #ecfdf5;
  color: #059669;
}

.method-details {
  flex-grow: 1;
  margin-left: 12px;
}

.method-details h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.method-details p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.badge-optional {
  font-size: 9.5px;
  font-weight: 400;
  color: var(--text-muted);
  font-style: italic;
}

.chevron-right {
  color: #cbd5e1;
}

/* ==================== KHỐI ĐÍNH KÈM MINH CHỨNG ==================== */
.attachment-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.attachment-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex-grow: 1;
}

.attach-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 12px 10px;
  cursor: pointer;
  transition: var(--transition);
}

.attach-item:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.attach-item span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 6px;
}

.attach-icon-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blue-light { background: #eff6ff; color: #2563eb; }
.cyan-light { background: #ecfeff; color: #0891b2; }
.green-light { background: #ecfdf5; color: #059669; }
.orange-light { background: #fff7ed; color: #ea580c; }

.attachment-mockup-wrapper {
  width: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.attachment-mockup-img {
  max-height: 95px;
  object-fit: contain;
}

/* ==================== EMERGENCY BANNER ==================== */
.emergency-banner {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 18px;
  padding: 12px;
  margin-top: 16px;
  cursor: pointer;
  transition: var(--transition);
}

.emergency-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.1);
}

.banner-icon-side {
  margin-right: 12px;
  flex-shrink: 0;
}

.banner-hand-heart {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.banner-text-side {
  flex-grow: 1;
}

.banner-text-side h4 {
  font-size: 13.5px;
  font-weight: 800;
  color: #1e3a8a;
}

.banner-text-side p {
  font-size: 10px;
  color: #1e40af;
  line-height: 1.35;
  margin-top: 1px;
}

.btn-banner-link {
  background: #ffffff;
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 30px;
  padding: 5px 10px;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
}

.btn-banner-link:hover {
  background: #f8fafc;
  transform: scale(1.03);
}

.footer-privacy-text {
  font-size: 10.5px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 20px;
  margin-bottom: 20px;
}

/* ==================== TAB TIN TỨC (News View) ==================== */
.news-header {
  margin-top: 10px;
  margin-bottom: 20px;
  text-align: center;
}

.news-header h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.news-header .sub-header {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-item-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
}

.news-item-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.news-badge {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 30px;
  width: fit-content;
  margin-bottom: 8px;
}

.news-badge.color-blue { background: #eff6ff; color: #2563eb; }
.news-badge.color-green { background: #ecfdf5; color: #059669; }
.news-badge.color-cyan { background: #ecfeff; color: #0891b2; }

.news-item-card h3 {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.35;
}

.news-summary {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-top: 6px;
}

.news-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
  color: #2563eb;
  font-size: 11px;
  font-weight: 700;
}

/* ==================== MÀN HÌNH FORM BÁO CÁO SOS TRƯỢT ==================== */
.sos-form-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.03) 0%, transparent 40%);
  z-index: 999;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.sos-form-screen.active {
  transform: translateY(0);
}

.form-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.btn-back {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: var(--transition);
}

.btn-back:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.form-screen-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.form-scrollable-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 16px;
}

/* ==================== CHÂN TRANG ĐIỀU HƯỚNG (Bottom Navigation) ==================== */
.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  z-index: 888;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.02);
}

.bottom-nav-bar .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #94a3b8;
  cursor: pointer;
  transition: var(--transition);
  background: transparent;
  border: none;
  font-family: var(--font-family);
  width: 60px;
}

.bottom-nav-bar .nav-item span {
  font-size: 9.5px;
  font-weight: 700;
  margin-top: 3px;
}

.bottom-nav-bar .nav-item.active {
  color: #2563eb;
}

/* ==================== FORM INPUTS & ELEMENTS ==================== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 12px;
  padding: 10px 14px;
  font-family: var(--font-family);
  font-size: 13.5px;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

select.form-control option {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.reporter-input-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 8px;
}

.reporter-note-text {
  font-size: 10px;
  color: var(--color-success);
  font-weight: 500;
  margin-top: 6px;
}

/* Audio Recording Panel */
.audio-recorder-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px 10px;
  height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.audio-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.audio-btn:hover {
  border-color: var(--color-emergency);
  color: var(--color-emergency);
}

.audio-btn.recording {
  background: var(--color-emergency);
  color: white;
  border-color: var(--color-emergency);
  animation: pulse-recording 1.5s infinite;
}

@keyframes pulse-recording {
  0% { transform: scale(1); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.audio-wave {
  display: flex;
  align-items: center;
  gap: 2.5px;
  height: 18px;
}

.audio-wave-bar {
  width: 2.5px;
  height: 3px;
  background-color: var(--color-emergency);
  border-radius: 2px;
}

.audio-wave.active .audio-wave-bar {
  animation: soundWave 1.2s infinite ease-in-out alternate;
}

.audio-wave.active .audio-wave-bar:nth-child(1) { animation-delay: 0.1s; }
.audio-wave.active .audio-wave-bar:nth-child(2) { animation-delay: 0.3s; }
.audio-wave.active .audio-wave-bar:nth-child(3) { animation-delay: 0.5s; }

@keyframes soundWave {
  0% { height: 3px; }
  100% { height: 16px; }
}

.audio-timer {
  font-family: monospace;
  font-size: 12px;
  color: var(--text-secondary);
}

/* File Attachment Dropzone */
.media-attachment-zone {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--bg-secondary);
  transition: var(--transition);
  padding: 6px;
  gap: 3px;
}

.media-attachment-zone:hover {
  border-color: #3b82f6;
}

.media-attachment-zone p {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 500;
}

.file-input {
  display: none;
}

.media-preview-container {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.media-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.media-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-preview-remove {
  position: absolute;
  top: 1px;
  right: 1px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Submit Action Button */
.btn-submit {
  width: 100%;
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.2);
}

.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.3);
}

.btn-submit:disabled {
  background: var(--border-color);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* GPS Status Indicator */
.gps-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.gps-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

.gps-status.active .gps-dot {
  background-color: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
}

.gps-status.error .gps-dot {
  background-color: var(--color-emergency);
  box-shadow: 0 0 8px var(--color-emergency);
}

/* ==================== POPUP HOTLINE DETAIL ==================== */
.hotline-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.hotline-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  font-size: 13px;
}

.hotline-item span {
  font-weight: 500;
  color: var(--text-secondary);
}

.hotline-item a {
  color: #2563eb;
  font-weight: 700;
  text-decoration: none;
}

/* ==================== OVERLAY MODAL (Status / Loading) ==================== */
.status-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.25s ease-out;
}

.status-modal-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 28px;
  width: 100%;
  max-width: 380px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Radar Animation Loader */
.radar-loader {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-circle {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--color-emergency);
  opacity: 0;
  animation: pulse-radar 2s infinite ease-out;
}

@keyframes pulse-radar {
  0% { transform: scale(0.2); opacity: 0.8; }
  100% { transform: scale(1.3); opacity: 0; }
}

/* Animated Success Checkmark */
.success-checkmark {
  width: 80px;
  height: 80px;
  margin: 0 auto;
}

.success-checkmark .check-icon {
  width: 80px;
  height: 80px;
  position: relative;
  border-radius: 50%;
  box-sizing: content-box;
  border: 4px solid var(--color-success);
}

.success-checkmark .check-icon::before {
  top: 3px;
  left: -2px;
  width: 30px;
  transform-origin: 100% 50%;
  border-radius: 100px 0 0 100px;
}

.success-checkmark .check-icon::after {
  top: 0;
  left: 30px;
  width: 60px;
  transform-origin: 0 50%;
  border-radius: 0 100px 100px 0;
  animation: rotatePlaceholder 4.25s ease-in;
}

.success-checkmark .check-icon .icon-circle {
  top: -4px;
  left: -4px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  box-sizing: content-box;
  border: 4px solid rgba(16, 185, 129, 0.15);
  position: absolute;
  z-index: 1;
}

.success-checkmark .check-icon .icon-fix {
  top: 8px;
  left: 28px;
  width: 5px;
  height: 54px;
  position: absolute;
  z-index: 1;
}

.success-checkmark .check-icon .icon-line {
  height: 5px;
  background-color: var(--color-success);
  display: block;
  border-radius: 2px;
  position: absolute;
  z-index: 10;
}

.success-checkmark .check-icon .icon-line.line-tip {
  top: 46px;
  left: 19px;
  width: 25px;
  transform: rotate(45deg);
  animation: writeCheckTip 0.25s;
}

.success-checkmark .check-icon .icon-line.line-long {
  top: 38px;
  right: 12px;
  width: 47px;
  transform: rotate(-45deg);
  animation: writeCheckLong 0.75s;
}

@keyframes writeCheckTip {
  0% { width: 0; left: 6px; top: 19px; }
  54% { width: 0; left: 6px; top: 19px; }
  70% { width: 50px; left: -8px; top: 37px; }
  84% { width: 17px; left: 21px; top: 48px; }
  100% { width: 25px; left: 19px; top: 46px; }
}

@keyframes writeCheckLong {
  0% { width: 0; right: 46px; top: 54px; }
  65% { width: 0; right: 46px; top: 54px; }
  84% { width: 55px; right: 0px; top: 35px; }
  100% { width: 47px; right: 12px; top: 38px; }
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 74px; /* Tránh đè lên bottom nav bar */
  left: 16px;
  right: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-success { border-left: 4px solid var(--color-success); }
.toast-error { border-left: 4px solid var(--color-emergency); }

/* ==================== MÀN HÌNH LỚN & ĐỒNG BỘ GIÁO VIÊN ==================== */

/* Cải tiến giao diện của Giáo viên sang Light Mode đẹp mắt */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.dashboard-title h1 {
  text-align: left;
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #1e293b 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 18px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.01);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.stat-label {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 600;
}

.stat-val {
  font-size: 26px;
  font-weight: 800;
  margin-top: 4px;
  color: var(--text-primary);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.incident-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,0.01);
  margin-bottom: 12px;
}

.incident-card:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.incident-card.active {
  border-color: var(--color-low);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.08);
}

.badge {
  padding: 3px 8px;
  border-radius: 30px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-pending { background: rgba(239, 68, 68, 0.08); color: var(--color-emergency); border: 1px solid rgba(239, 68, 68, 0.15); }
.badge-investigating { background: rgba(249, 115, 22, 0.08); color: var(--color-high); border: 1px solid rgba(249, 115, 22, 0.15); }
.badge-resolved { background: rgba(16, 185, 129, 0.08); color: var(--color-success); border: 1px solid rgba(16, 185, 129, 0.15); }
.badge-spam { background: rgba(148, 163, 184, 0.08); color: var(--text-muted); border: 1px solid rgba(148, 163, 184, 0.15); }

.badge-emergency { background: #ef4444; color: white; }
.badge-high { background: #f97316; color: white; }
.badge-medium { background: #eab308; color: black; }
.badge-low { background: #3b82f6; color: white; }

.incident-detail-panel {
  position: sticky;
  top: 24px;
}

.custom-audio-player {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 30px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--font-family);
  box-shadow: 0 2px 6px rgba(0,0,0,0.01);
}

.filter-btn:hover {
  border-color: #cbd5e1;
  color: var(--text-primary);
}

.filter-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: white;
}

/* ==================== MEDIA QUERIES (Thiết bị di động) ==================== */
@media (max-width: 480px) {
  .app-container {
    padding: 12px 12px 70px 12px !important;
  }
  
  .home-header {
    margin-bottom: 16px !important;
  }
  
  .main-title {
    font-size: 21px !important;
  }
  
  .sub-title {
    font-size: 11.5px !important;
  }

  .header-illustration {
    max-height: 90px !important;
  }

  .hero-grid {
    gap: 10px !important;
    margin-bottom: 16px !important;
  }

  .hero-card {
    padding: 12px !important;
    min-height: 125px !important;
    border-radius: 16px !important;
  }

  .card-info h2 {
    font-size: 14.5px !important;
  }

  .btn-action-white {
    padding: 6px 10px !important;
    font-size: 10px !important;
  }

  .btn-circle-arrow {
    width: 28px !important;
    height: 28px !important;
  }

  .method-card {
    border-radius: 14px !important;
    padding: 10px !important;
  }

  .method-icon-bg {
    width: 36px !important;
    height: 36px !important;
  }

  .method-details h4 {
    font-size: 12.5px !important;
  }

  .attach-item {
    border-radius: 14px !important;
    padding: 10px 8px !important;
  }

  .attach-item span {
    font-size: 10px !important;
  }

  .attach-icon-circle {
    width: 32px !important;
    height: 32px !important;
  }

  .attachment-mockup-img {
    max-height: 80px !important;
  }

  .emergency-banner {
    border-radius: 14px !important;
    padding: 10px !important;
  }

  .banner-hand-heart {
    width: 32px !important;
    height: 32px !important;
  }

  .banner-text-side h4 {
    font-size: 12.5px !important;
  }

  .banner-text-side p {
    font-size: 9px !important;
  }

  .btn-banner-link {
    padding: 4px 8px !important;
    font-size: 8.5px !important;
  }

  .bottom-nav-bar {
    padding: 6px 0 !important;
  }

  .bottom-nav-bar .nav-item span {
    font-size: 9px !important;
  }
}

/* Tối ưu hóa cực hạn cho thiết bị di động có màn hình siêu nhỏ (dưới 340px) như iPhone SE đời đầu */
@media (max-width: 340px) {
  .app-container {
    padding: 8px 8px 65px 8px !important;
  }
  .main-title {
    font-size: 19px !important;
    line-height: 1.3 !important;
  }
  .sub-title {
    font-size: 11px !important;
  }
  .header-illustration {
    max-height: 75px !important;
  }
  .hero-grid {
    gap: 8px !important;
  }
  .hero-card {
    padding: 10px !important;
    min-height: 110px !important;
  }
  .card-info h2 {
    font-size: 13px !important;
  }
  .card-info p {
    font-size: 10px !important;
  }
  .btn-action-white {
    padding: 4px 8px !important;
    font-size: 9px !important;
  }
  .method-card {
    padding: 8px !important;
  }
  .method-icon-bg {
    width: 32px !important;
    height: 32px !important;
  }
  .method-details h4 {
    font-size: 12px !important;
  }
  .method-details p {
    font-size: 10px !important;
  }
  .attach-item {
    padding: 8px 4px !important;
  }
  .attach-item span {
    font-size: 9.5px !important;
  }
  .attach-icon-circle {
    width: 28px !important;
    height: 28px !important;
  }
  .attachment-mockup-img {
    max-height: 70px !important;
  }
  .emergency-banner {
    padding: 8px !important;
  }
  .banner-hand-heart {
    width: 28px !important;
    height: 28px !important;
  }
  .banner-text-side h4 {
    font-size: 11.5px !important;
  }
  .banner-text-side p {
    font-size: 8.5px !important;
  }
  .btn-banner-link {
    padding: 3px 6px !important;
    font-size: 8px !important;
  }
}

/* ==================== PRINT MEDIA ==================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-family: 'Times New Roman', Times, serif !important;
    font-size: 12pt !important;
  }
  
  .dashboard-header,
  .dashboard-stats,
  .filter-bar,
  .incident-list-panel,
  #action-form,
  #toast,
  .btn-submit,
  .no-print,
  input, select, textarea,
  .bottom-nav-bar,
  .sos-form-screen,
  #help-popup {
    display: none !important;
  }
}
