/* Default style for dashboard */
body { font-family: Arial, sans-serif; background: #f9f9f9; color: #222; }
#dashboard-root .container { max-width: 700px; margin: 30px auto; background: #fff; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.06); padding: 24px; }
#dashboard-root h2 { text-align: center; }
#dashboard-root .webcam-audio-card { margin-bottom: 20px; }
#dashboard-root canvas { width: 100% !important; height: 200px !important; }
#dashboard-root #alert {
  background: #ffdddd;
  color: #a00;
  padding: 8px;
  border-radius: 6px;
  text-align: center;
  margin-bottom: 10px;
  font-size: 1.2em;
  font-weight: bold;
  display: none;
}
#dashboard-root #alert.active {
  display: block;
}

#camera_segmented_btn_group .camera-segment-btn {
    flex: 1 1 0;
    padding: 8px 0;
    border: 1px solid #222;
    border-radius: 0;
    background: #f5f5f5;
    color: #222;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    outline: none;
}
#camera_segmented_btn_group .camera-segment-btn:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}
#camera_segmented_btn_group .camera-segment-btn:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}
#camera_segmented_btn_group .camera-segment-btn.active {
    background: #222;
    color: #fff;
}


/* Responsive full-width for mobile */
@media (max-width: 700px) {
  #dashboard-root .container {
    max-width: 100vw;
    width: 100vw;
    margin: 0;
    border-radius: 0;
    padding: 8px;
    box-shadow: none;
  }
  #dashboard-root .webcam-audio-card > div:first-child {
    max-width: 100vw !important;
    width: 100vw !important;
    margin: 0 0 10px 0 !important;
  }
  #dashboard-root #webcam_stream {
    width: 100vw !important;
    height: auto !important;
    border-radius: 0 !important;
  }
  #dashboard-root section, #dashboard-root .chart-card, #dashboard-root .alerts-card, #dashboard-root .info-row, #dashboard-root .controls-card {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
}

/* Setup page container */
.container {
  max-width: 700px;
  margin: 30px auto 0 auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  padding: 24px;
}
.polygon-source-row {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
  gap: 10px;
}
.canvas-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto 10px auto;
  display: flex;
  justify-content: center;
  position: relative;
}
.polygon-btns {
  margin-top: 18px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}
#polygon_table_container {
  margin-top: 10px;
}
#polygon_table {
  width: 100%;
  border-collapse: collapse;
  max-width: 480px;
  margin: 0 auto;
}
#polygon_table th, #polygon_table td {
  padding: 6px;
  border-bottom: 1px solid #ccc;
  text-align: left;
}
#polygon_table th {
  font-weight: 600;
  background: #fafafa;
}
#polygon_table tr:last-child td {
  border-bottom: none;
}
#polygon_status {
  margin-top: 16px;
  text-align: center;
  color: #222;
  font-size: 1.05em;
}

/* Toggle ON/OFF Mode Button Row */
.toggle-btn-row {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 36px 0 20px 0;
}
#toggle_mode_btn {
    padding: 6px 28px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 18px;
    color: #fff;
    background: #1976d2; /* blue by default */
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    cursor: pointer;
    transition: background 0.2s;
    min-width: 60px;
    text-transform: uppercase;
}
#toggle_mode_btn.off {
    background: #d32f2f; /* red when off */
}
#toggle_mode_btn:active {
    filter: brightness(0.95);
}
