/* Laptop Survey Card Styles at the end */

body {
  font-family: sans-serif;
  padding: 5px;
  max-width: 100vw;
  box-sizing: border-box;
}
input {
  margin: 5px 0;
  padding: 5px;
}
button {
  padding: 5px;
  margin-right: 5px;
}

/*summaryView START*/
.summary-view {
	display: flex;
	gap: 40px;
	justify-content: start;
	flex-wrap: wrap;
	padding-top: 90px;
}
.summary-column {
	flex: 1;
	min-width: 200px;
}
.summary-column h3 {
	margin-bottom: 8px;
    }
.summary-column ul {
	list-style: none;
	padding: 0;
}
.summary-column li {
	cursor: pointer;
	padding: 4px;
	border-bottom: 1px solid #ccc;
}
.summary-column li:hover {
	background: #f0f0f0;
}
/*summaryView END*/


.back-button {
	top: 8px;
	padding: 8px 14px;
	background-color: #007bff;
	color: white;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-size: 11px;
	font-weight: bold;
	text-decoration: none;
	display: inline-block;
	box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.back-button:hover {
	background-color: #005bb5;
}
.hidden {
	display: none;
}


.casuals-table-wrapper {
  overflow-x: auto;
  width: 100%;
}

.contact {
  margin: 5px 0;
}
.error {
  color: red;
  font-weight: bold;
  margin-top: 10px;
}


#loginBox {
  max-width: 400px;
  margin: 20px auto;
  padding: 10px;
  border-radius: 12px;
  background-color: #f9f9f9;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid #ddd;
}

#loginForm label {
  display: block;
  font-weight: 600;
  font-size: 0.8em;
}

#loginForm input {
  width: 100%;
  padding: 8px;
  box-sizing: border-box;
  margin-top: 4px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

#loginForm button {
  width: 50%;
  display: block;
  margin: auto;
  padding: 10px;
  /*margin-top: 2px;*/
  background-color: #007bff;
  font-size: 1.0em;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

#loginForm button:hover {
  background-color: #005bb5;
}

#loginBoxNote {
  margin-top: 5px;
  font-size: 0.5em;
  width: 100%;
  text-align: center;
}

@media (max-width: 500px) {
  #loginBox {
    margin: 20px;
    padding: 15px;
  }
}

#signatureCanvas {
  max-width: 100%;
  height: auto;
  touch-action: none;
}


/*signon-buttons  START*/
.signon-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  align-items: center;
}

.signon-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.signon-row button {
  padding: 10px 0;
  font-size: 16px;
  font-weight: bold;
  width: 120px; /* fixed equal width */
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #007bff;
  /*background-color: #2d92ff;*/
  color: white;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
}

.signon-row button:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

#confirmSignOnBtn {
  background-color: #28a745; /* Bootstrap's "success" green */
}
#confirmSignOnBtn:hover {
  background-color: #218838; /* darker green on hover */
}

#absentBtn {
  background-color: #ffc107; /* Bootstrap warning yellow */
}
#absentBtn:hover {
  background-color: #e0a800; /* darker yellow on hover */
}

#cancelSignOnBtn {
  background-color: #d9534f; /* red */
}
#cancelSignOnBtn:hover {
  background-color: #c9302c; /* darker red on hover */
}

.signon-row button:hover {
  background-color: #005bb5;
}
/*signon-buttons  END*/

/* Progress indicator styling */
.missed-date-progress {
    margin: 10px 0 15px 0;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9em;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.progress-bar-outer {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.current-date-highlight {
    text-align: center;
    color: #007bff;
    font-weight: 500;
}

.progress-percentage {
    color: #6c757d;
}

.today-instruction {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
    color: #333;
}

/* signON messaage STARTS*/
#signOnMsg {
  position: absolute;
  top: 40px; /* just below the Logout button */
  right: 18px;
  font-size: 0.8em;
  font-weight: bold;
  text-align: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 1s ease-out;
  pointer-events: none;
}

.signon-success {
  color: green;
}

.signon-error {
  color: red;
}
/* signON messaage ENDS*/

/*logout header box button  START*/
.logout-header {
  position: fixed;
  top: 5px;
  left: 0;
  width: 100%;
  background-color: #fff;
  padding: 4px 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  z-index: 9998;
  box-sizing: border-box;
}

#heading {
  font-size: 1.3em;       /* Approximate <h2> size */
  font-weight: bold;
  margin: 0;
  padding: 0;
  line-height: 1.2;
  text-align: left;
}

/* Logout button in top right corner of logoutBox */
#logoutBtn {
  position: absolute;
  top: 8px;
  right: 12px;
  background-color: #d9534f;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

/* fix for home page to get login box in same top position */
.home-header .logout-btn {
    margin-top: 5px;
}

#logoutBtn:hover {
  background-color: #c9302c;
}

.logout-header h2 {
  margin: 0;
  font-size: 1.2em;
}
/*logout header box button  END*/


.contentBox {
  width: 100%;
}


/* Toggle Switch Styling */
.toggle-container {
  position: relative;
  width: 130px;
  height: 32px;
  margin-left: auto;
  font-size: 0.8em;
}

.toggle-input {
  display: none;
}

.toggle-label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ddd;
  border-radius: 11px;
  cursor: pointer;
  height: 100%;
  box-sizing: border-box;
  padding: 0;
  overflow: hidden;
  font-weight: bold;
}

.toggle-option {
  flex: 1;
  text-align: center;
  z-index: 2;
  padding: 0 6px;
  transition: color 0.3s;
  line-height: 32px;
}

.toggle-slider {
  position: absolute;
  height: 28px;
  width: 50%;
  top: 2px;
  left: 2px;
  background: #007bff;
  border-radius: 9px;
  transition: 0.5s;
  z-index: 1;
}

/* When checked, slide the blue background right */
.toggle-input:checked + .toggle-label .toggle-slider {
  left: calc(50% + 2px);
}

/* Color logic: white on active side */
.toggle-input:not(:checked) + .toggle-label .left {
  color: #fff;
}
.toggle-input:not(:checked) + .toggle-label .right {
  color: #555;
}
.toggle-input:checked + .toggle-label .right {
  color: #fff;
}
.toggle-input:checked + .toggle-label .left {
  color: #555;
}
/* END toggle switch styling*/

#detailsView {
  padding-top: 90px;
}

#detailsTable {
  max-width: 100%;
  overflow-x: auto;
  box-sizing: border-box;
}

#detailsTableHeader {
  margin-top: 10px;
  margin-bottom: 10px;
  font-size: 1.17em;
  font-weight: 600;
}

.casuals-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  box-sizing: border-box;
  overflow-x: auto;
  table-layout: fixed; /* Enforces consistent column widths */
}

.casuals-table th,
.casuals-table td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: left;
  word-wrap: break-word;
  white-space: normal; /* Allow wrapping instead of forcing horizontal scroll */
  max-width: 100%;
  box-sizing: border-box;
}

.casuals-table thead {
  background-color: #f2f2f2;
  position: sticky;
  top: 0;
  z-index: 1;
}

.casuals-table th {
  cursor: pointer;
  transition: background 0.2s;
}
.casuals-table th:hover {
  background-color: #e6e6e6;
}

.casuals-table th.asc::after {
  content: ' ▲';
}
.casuals-table th.desc::after {
  content: ' ▼';
}

.casuals-table tbody tr:nth-child(odd) {
  background-color: #fafafa;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
}

#searchBox {
  flex: 1;
  max-width: 400px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#clearSearch,
#resetTable,
#reloadBtn, {
  background: #eee;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#clearSearch:hover,
#resetTable:hover,
#reloadBtn:hover {
  background: #ddd;
}

/* Spinner */
.loader {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #007bff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  animation: spin 1s linear infinite;
  display: inline-block;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#progressBarContainer {
  position: fixed;
  top: 0;
  left: 0;
  height: 5px;
  width: 100%;
  background-color: #003366; /* dark blue */
  z-index: 9999;
  overflow: hidden;
}

#progressBar {
  height: 100%;
  /*background-color: #66aaff; /*soft sky blue*/
  background-color: #ffee66; /*yellow hue*/
  transform-origin: left;
  transition: width linear;
}

/* Default: show desktop-only, hide mobile-only */
.desktop-only {
  display: table-row;
}
.mobile-only {
  display: none;
}

/* Column-specific */
.col-plain { color: black; }
.col-date { text-align: center; font-weight: bold; }
.col-class { color: darkblue; }
.col-room { color: darkblue; }
.col-period { color: darkgreen; }
.col-absent-teacher { font-style: italic; }
.col-faculty { font-style: italic; }
.col-cover-teacher { font-weight: bold; }
.col-uncovered {
  background-color: #f8d7da; /* pastel red */
  color: #333;               /* black text */
  font-style: italic;
}




/* --------------------------- */
/* Mobile card style for table */
/* --------------------------- */
@media (max-width: 600px) {
/* Mobile: show hide mobile-only,  desktop-only*/
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: block !important;
  }

  .casuals-table,
  .casuals-table thead,
  .casuals-table tbody,
  .casuals-table th,
  .casuals-table td,
  .casuals-table tr {
    display: block;
    max-width: 100%;
    box-sizing: border-box;
  }

.casuals-table td.col-class,
.casuals-table td.col-absent-teacher,
.casuals-table td.col-faculty {
  display: inline-block;
  width: calc(33.3% - 5px);
  box-sizing: border-box;
}

  .casuals-table thead {
    display: none;
  }

  .casuals-table tr {
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 5px;
    background: #fff;
  }

  .casuals-table td {
    display: inline-block;
    text-align: left;
    padding: 2px 4px;
    border: none;
    border-bottom: 1px solid #eee;
    position: relative;
    width: calc(33.3% - 5px);
    box-sizing: border-box;
    vertical-align: top;
  }

/* fields that are two per row*/
.casuals-table td.half-width {
  display: inline-block;
  width: calc(50% - 5px);
  box-sizing: border-box;
}

/* Fields that should take full row */
.casuals-table td.full-width {
  display: block;
  width: 100%;
  border-bottom: none;
  margin-top: 4px;
}

  .casuals-table td::before {
    content: attr(data-label);
    font-weight: bold;
    display: block;
    margin-bottom: 3px;
    color: #333;
  }

  .casuals-table td:last-child {
    border-bottom: none;
  }

 .toolbar {
    flex-wrap: wrap;
  	gap: 8px;
  	justify-content: space-between;
  }

  .toolbar input,
  .toolbar button {
  flex: 1 1 calc(50% - 10px);
  max-width: calc(50% - 10px);
  }



}



/*===========================*/
/* Laptop Survey Card Styles */
/*===========================*/
.survey-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin: 20px auto;
    max-width: 800px; /* Increased from 600px */
    border-left: 6px solid #007bff; /* Made slightly thicker */
}

.survey-card.hidden {
    display: none;
}

.survey-title {
    font-size: 1.5em; /* Slightly larger */
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.survey-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.survey-description a {
    color: #007bff;
    text-decoration: none;
}

.survey-description a:hover {
    text-decoration: underline;
}

.survey-question {
    margin-bottom: 20px;
}

.survey-question label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
}

.survey-options {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.survey-option {
    flex: 1;
}

.survey-option input[type="radio"] {
    display: none;
}

.survey-option label {
    display: block;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0;
    font-weight: 500;
}

.survey-option input[type="radio"]:checked + label {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.survey-option label:hover {
    border-color: #007bff;
    background-color: #f0f7ff;
}

.survey-option input[type="radio"]:checked + label:hover {
    background-color: #0056b3;
}

.laptop-type-section {
    display: none;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 6px;
    margin-top: 15px;
    border: 1px solid #e0e0e0;
}

.laptop-type-section.show {
    display: block;
}

.survey-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

.survey-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

.survey-btn-submit {
    background-color: #28a745;
    color: white;
}

.survey-btn-submit:hover:not(:disabled) {
    background-color: #218838;
}

.survey-btn-submit:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.survey-btn-cancel {
    background-color: #6c757d;
    color: white;
}

.survey-btn-cancel:hover {
    background-color: #5a6268;
}

.survey-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.survey-message {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 6px;
    font-weight: 500;
}

.survey-message .signon-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 10px;
    border-radius: 4px;
}

.survey-message .signon-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: 4px;
}

.survey-message .signon-processing {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    padding: 10px;
    border-radius: 4px;
}

@media (max-width: 600px) {
    .survey-card {
        margin: 15px 10px;
        padding: 15px;
        max-width: 100%;
    }

    .survey-options {
        flex-direction: column;
    }

    .survey-buttons {
        flex-direction: column;
    }

    .survey-btn {
        width: 100%;
    }
}