/* 
// "." is for class, styling a group of elements
// "#" is for id, styling a unique element
*/

/* 
//-----------------------------
// Shared Across All Pages
// -----------------------------
*/

#user-info 
{
  white-space: pre-wrap;
}

html, body
{
  height: 100%;
}

body 
{
  font-family: Arial, sans-serif;
  margin: 0;
}

/* ⭐ Hide page until MSAL finishes */
body.not-ready {
  visibility: hidden;
}

/* ⭐ Prevent scrolling when overlay is active */
body.overlay-active {
  overflow: hidden;
}

#default-contain 
{
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  width: 100%;
}

/* Side Bar */
.sidebar 
{
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 10%;
  padding: 10px;
  color: white;
  background: rgb(139,69,19);
}

.sidebar h2 
{
  margin-top: 0;
}

.sidebar ul 
{
  list-style: none;
  padding: 0;
}

.sidebar ul li 
{
  margin: 15px 0;
}

.sidebar ul li a 
{
  color: white;
  text-decoration: none;
}

.sidebar ul li a.active 
{
  font-weight: bold;
  text-decoration: underline;
}

.main-verti-contain
{
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 87%;
}

#header-contain 
{
  display: flex;
  flex-direction: row;
  min-height: 10px;
  width: 100%;
  padding: 10px;
  justify-content: space-between;
  color: white;
  background: rgb(46,139,87);
}

#header-contain h2
{
  font-size: 2rem;
}

.horiz-contain
{
  display: flex;
  flex-direction: row;
  min-height: 10px;
  width: 100%;
  padding: 10px;
}

.verti-contain
{
  display: flex;
  flex-direction: column;
  min-height: 10px;
  width: 50%;
  padding: 10px;
}

/* ⭐ Blurred + dimmed sign-in overlay */
#sign-in-overlay 
{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4); /* dim */
  backdrop-filter: blur(12px); /* blur background */
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#sign-in-overlay button 
{
  padding: 15px 25px;
  font-size: 18px;
  cursor: pointer;
}

#sign-out-button 
{
  width: 150px;
  height: 25px;
  font-size: 12px;
  background: rgb(64,224,208);
  color: #fff;
  border: none;
  border-radius: 4px;
  align-self: flex-end;
  cursor: pointer;
  gap: 0px;
}

#sign-out-button:hover 
{
  background-color: rgb(0,0,255);
}

.site-footer
{
  display: flex;
  flex-direction: row;
  min-height: 10px;
  width: 100%;
  padding: 10px;
  justify-content: space-between;
  color: white;
  background: rgb(64,224,208);
  margin-top: auto;
}

/* 
//-----------------------------
// Dashboard
// -----------------------------
*/

.grid-forecast 
{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.card-hourly, .card-daily 
{
  background: #f8f9fa;
  padding: 8px;
  border-radius: 6px;
  font-size: 0.85em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 120px;
}

.icon-forecast 
{ 
  width: 32px; 
  height: 32px; 
  font-size: 28px;
  align-items: center;
  justify-content: center;
  margin-right: 6px; 
}

/* Base card style */
.card 
{
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 10px;
  margin: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Header styling */
.card h2 
{
  font-size: 1.4rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 8px;
}

/* Card value */
.card-value 
{
  font-size: 3rem;
  font-weight: bold;
  color: rgb(64,224,208);
  text-align: center;
}

/* Small info text */
.small-info 
{
  font-size: 0.7rem;
  color: #666;
  text-align: left;
}

/* Chart card container */
.chart-card 
{
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 10px;
  margin: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  max-height: 300px;
}

.chart-header 
{
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chart-header h2 
{
  font-size: 1.4rem;
  font-weight: 600;
  color: #333;
  margin: 0;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 8px;
}

.range-row 
{
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.range-row label 
{
  font-size: 0.9rem;
  color: #666;
}

.range-row select
{
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 0.9rem;
  background-color: #f9f9f9;
  transition: border-color 0.2s ease;
}

.range-row select:focus 
{
  outline: none;
  border-color: #0078d7;
}

#temperatureChart 
{
  width: 100%;
  max-height: 300px;
}

/* 
//-----------------------------
// Shared Across All Sub Data Management Pages
// -----------------------------
*/

.big-link 
{
  font-size: 16px;
  margin: 15px;
}

.add-edit-contain
{
  display: flex;
  flex-direction: column;
  min-height: 10px;
  width: 30%;
  padding: 10px;
}

#add-edit-form 
{
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  padding: 10px;
  margin-bottom: 20px;
}

#add-edit-form label 
{
  text-align: right;
  font-weight: bold;
  font-size: 13px;
}

#add-edit-form select
{
  height: 25px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#add-edit-form input[type="text"],
#add-edit-form input[type="number"],
#add-edit-form input[type="email"] 
{
  height: 25px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#add-edit-form input[type="checkbox"] 
{
  transform: scale(1.5);
  width: 50%;
}

.gray-box 
{
  background-color: rgb(128, 128, 128);
  color:white;
}

#add-edit-form button 
{
  grid-column: 2;
  padding: 8px 12px;
  background: rgb(64,224,208);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#add-edit-form button:hover 
{
  background: rgb(0,0,255);
}

#cancel-edit-button 
{
  margin-top: 10px;
  padding: 6px 12px;
  background: #6c757d;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#cancel-edit-button:hover 
{
  background: rgb(0,0,255);
}

.rec-list-contain
{
  display: flex;
  flex-direction: column;
  min-height: 10px;
  width: 70%;
  overflow-x: auto;
  padding: 10px;
}

#rec-list-table 
{
  padding: 10px;
  border-collapse: separate;
  min-width: 1200px;
}

#rec-list-table  th,
#rec-list-table  td
{
  border: 1px solid rgb(0,0,0);
  padding: 8px;
  text-align: left;
  white-space: nowrap;
}

#rec-list-table  th
{
  background-color: rgb(64,224,208);
  color: #fff;
}

#rec-list-table  tr.highlight 
{
  background-color: #fff3cd;
  border-left: 4px solid #ffc107;
}

#rec-list-table  tr.inactive-row 
{
  background-color: rgb(211,211,211) !important;
}

#rec-list-table  button 
{
  margin-right: 5px;
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#rec-list-table  button:hover 
{
  background: rgb(0,0,255);
}

#rec-list-table  button.edit 
{
  background-color: #ffc107;
  color: #000;
}

#rec-list-table  button.delete 
{
  background-color: #e74c3c;
  color: #fff;
}

/* Structure to freeze certain columns and allow sorting */
.sticky-actions, td.sticky-actions {
  position: sticky;
  left: 0;
  width: 120px;
  background: #f9f9f9;
  z-index: 30;
  border-right: 1px solid #000;
  text-align: center;
  white-space: nowrap;
}

#rec-list-table  th.sortable {
  cursor: pointer;
  position: relative;
  padding-right: 20px;
}

#rec-list-table  th.asc::after {
  content: "▲";
  position: absolute;
  right: 5px;
  color: #000;
  font-size: 12px;
}

#rec-list-table  th.desc::after {
  content: "▼";
  position: absolute;
  right: 5px;
  color: #000;
  font-size: 12px;
}

/* Hide overlay when authenticated */
#sign-in-overlay.hidden {
  display: none !important;
}