/* ============ BASE RESET & TYPOGRAPHY ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #006837;
  --primary-dark: #004d29;
  --primary-light: #00a651;
  --accent: #f7941d;
  --danger: #ed1c24;
  --warning: #f5c518;
  --bg: #f0f2f5;
  --card-bg: #ffffff;
  --card-border: #e0e4e8;
  --text: #1a1a2e;
  --text-muted: #5a6577;
  --header-height: 80px;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  /* Force portrait feel */
  max-width: 1080px;
  margin: 0 auto;
}

/* ============ HEADER ============ */
#header-bar {
  height: var(--header-height);
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  position: relative;
  z-index: 10;
  color: #fff;
}

#header-bar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--primary-light), var(--accent));
}

.header-left {
  display: flex;
  flex-direction: column;
}

#company-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.header-subtitle {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.85;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.header-right {
  text-align: right;
}

#current-time {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1px;
}

#current-date {
  font-size: 11px;
  opacity: 0.85;
}

/* ============ SCREEN CONTAINER ============ */
#screen-container {
  height: calc(100vh - var(--header-height) - 36px);
  position: relative;
  overflow: hidden;
}

.screen {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  padding: 16px 20px;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.screen.active {
  opacity: 1;
  transform: translateX(0);
}

.screen.exit-left {
  opacity: 0;
  transform: translateX(-100%);
}

/* ============ SCREEN TITLE BAR ============ */
.screen-title-bar {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.screen-icon {
  font-size: 26px;
}

/* ============ VIDEO SCREEN ============ */
.video-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.no-content {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
}

.no-content-icon {
  font-size: 60px;
  margin-bottom: 15px;
}

/* ============ ENV PARAMETERS ============ */
.env-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
  scroll-behavior: smooth;
  /* Hide scrollbar for clean kiosk look */
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.env-grid::-webkit-scrollbar {
  display: none;
}

.env-section {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 14px 16px;
}

.env-section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.env-section-icon { font-size: 22px; }

.env-table-wrap { width: 100%; overflow-x: auto; }

.env-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.env-table th {
  text-align: left;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  padding: 8px 12px;
  white-space: nowrap;
}

.env-table th:first-child { border-top-left-radius: 6px; }
.env-table th:last-child { border-top-right-radius: 6px; }

.env-table td {
  padding: 7px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  color: var(--text);
}

.env-table tbody tr:nth-child(even) { background: rgba(0,104,55,0.04); }
.env-table tbody tr:last-child td { border-bottom: none; }

/* ============ ERT MEMBERS ============ */
.ert-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
}

.ert-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 16px 10px;
  text-align: center;
}

.ert-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
  margin: 0 auto 10px;
  display: block;
  background: var(--bg);
}

.ert-photo-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  background: var(--bg);
}

.ert-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
  line-height: 1.2;
}

.ert-designation {
  font-size: 11px;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 4px;
}

.ert-contact {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

/* ============ SAFETY TREE ============ */
.safety-tree-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 0;
}

.tree-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.tree-ym {
  display: flex;
  border: 2px solid #1f5fa8;
  border-radius: 6px;
  overflow: hidden;
}

.tree-ym .ym-cell {
  padding: 6px 24px;
  font-size: 20px;
  font-weight: 700;
  color: #1f5fa8;
  border-right: 2px solid #1f5fa8;
  min-width: 70px;
  text-align: center;
}

.tree-ym .ym-cell:last-child { border-right: none; }
.tree-ym .ym-cell.label { background: #eef4fb; }

.tree-streak-line {
  font-size: 20px;
  font-weight: 700;
  color: #1f5fa8;
}

.tree-streak-line strong {
  font-size: 24px;
  color: #006837;
}

.safety-tree {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.safety-tree-svg {
  height: 100%;
  max-height: 56vh;
  width: auto;
}

.tree-legend {
  display: flex;
  gap: 36px;
  font-size: 20px;
  font-weight: 600;
  flex-shrink: 0;
  background: var(--card-bg);
  padding: 10px 28px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.tree-legend span {
  display: flex;
  align-items: center;
  gap: 10px;
}

.leaf-dot {
  display: inline-block;
  width: 18px;
  height: 22px;
  border-radius: 0 70% 0 70%;
  transform: rotate(45deg);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.leaf-dot.green { background: #1f7a33; }
.leaf-dot.yellow { background: #f5a623; }
.leaf-dot.red { background: #e23b2e; }

.safety-details {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  padding: 12px 28px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.safety-details .sd-title {
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-right: 18px;
  border-right: 2px solid rgba(255,255,255,0.35);
}

.safety-details .sd-item {
  font-size: 20px;
  font-weight: 600;
}

.safety-details .sd-item strong {
  font-size: 26px;
  font-weight: 800;
  color: #ffe066;
  margin-left: 4px;
}

/* ============ SCREEN INDICATORS ============ */
#screen-indicators {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 20;
}

.indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(0,0,0,0.15);
  cursor: pointer;
  transition: all 0.3s;
}

.indicator.active {
  background: var(--primary-light);
  box-shadow: 0 0 8px var(--primary-light);
  width: 26px;
  border-radius: 5px;
}

/* ============ PROGRESS BAR ============ */
#progress-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(0,0,0,0.08);
  z-index: 20;
}

#progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--accent));
  width: 0%;
  transition: width 0.1s linear;
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c1c7cf; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: #a0a8b4; }
