:root{
  --primary: #CFD2CD;
  --secondary: #50514F;
  --tiertiary: #731a00;
  --tiertiary_hover: #962302;
  --sign_in_background: #f2f2f2;
  --background: #ffffff;
  --backgroundRed: #EF9A9A;
  --red: #B71C1C;
  --backgroundGreen: #A5D6A7;
  --green: #1B5E20
}

html, body{
  height: 100%;
  margin: 0;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

header {
  background: var(--primary);
  color: black;
  text-align: center;
  width: 100%;
  display: none;
  z-index: 2;
}

footer {
  background: var(--secondary);
  color: #333;
  text-align: center;
  padding: 1rem;
  display: none;
  width: 100%;
  z-index: 2;
}

#footer_text{
  padding: 20px;
}

#main_box{
  width: 100%;
  flex: 1;
  overflow-y: auto;
  justify-content: center;
  display: flex;
}

main{
  width: 100%;
}

#shadow{
  position: fixed;
  width: 100%;
  height: 100%;
  background-color: var(--sign_in_background);
  z-index: 3;
  display: block;
}

/* Navigation Bar */
nav {
  background: var(--primary);
  color: black;
  padding-bottom: 10px;
}

.menu {
  width: 100%;
  list-style: none;
  display: flex;
  justify-content: center;
  margin: 0;
}

.menu li {
  margin: 0 1rem;
}

.menu a {
  display: inline-block; /* Ensures block-like behavior while allowing inline flow */
  text-decoration: none;
  border-radius: 24px;
  color: black;  
  font-weight: bold;
  padding: 10px 12px; /* Ensures enough horizontal padding for multiline */
  text-align: center;
  white-space: normal; /* Allows wrapping if needed */
  line-height: 1.4; /* Improves vertical spacing on wrap */
}

.menu a:hover {
  transition: 0.2s;
  background-color: var(--tiertiary);
  border-radius: 24px;
  color: white;
  background-color: var(--tiertiary);
}

.menu a.active {
  background-color: var(--tiertiary);
  color: white;
}

footer {
  background: #f4f4f4;
  color: #333;
  text-align: center;
  padding: 1rem;
}

.custom-selector{
  padding: 13px;
  border-radius: 6px;
  /* this is necesarry for safari */
  line-height: 18px;
  -webkit-appearance: initial;
}

/* Sign In box */
#signin-container {
  margin-top: 100px;
  width: 100%;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

#signin-form-div {
  background-color: white;
  padding: 2rem;
  border-radius: 24px;
  width: 50%;
  z-index: 5;
  box-shadow: 0px 0px 10px var(--primary);
}

h2 {
  text-align: center;
  margin-bottom: 1.5rem;
}

h3{
  text-align: center;
}

.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

input {
  width: 100%;
  padding: 0.8rem 0rem 0.8rem 0rem;
  margin-top: 0.2rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}

button {
  width: 100%;
  padding: 0.8rem;
  background-color: var(--tiertiary);
  color: white;
  border: none;
  border-radius: 24px;
  font-size: 1rem;
  cursor: pointer;
}

button:hover {
  background-color: var(--tiertiary_hover);
  transition: 0.2s;
  box-shadow: 0px 0px 2px #3b3b3b;
}

#sign_in_error{
  color: red;
  padding: 5px;
  font-weight: bold;
}

#organization-dialog-container{
  margin-top: 100px;
  width: 100%;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

#organization-dialog{
  background-color: white;
  padding: 2rem;
  border-radius: 24px;
  width: 50%;
  z-index: 5;
  box-shadow: 0px 0px 10px var(--primary);
}

/* User Management */
.checkbox-container {
  display: flex;
  align-items: center; /* Center vertically */
  margin-top: 0.5rem; /* Optional: Add some space above */
}

#admin-access{
  width: 20px;
  padding: 20px;
}

.custom-checkbox {
  display: flex;
  align-items: flex-start; /* Top-align for multiline text */
  cursor: pointer;
  width: 100%;
}

.check-box-description{
  color: #333;
  font-size: 1rem;
  font-weight: normal;
  margin-top: -5px;
}

.custom-checkbox input {
  display: none;
}

.checkmark {
  flex-shrink: 0;
  width: 22px;
  height: 22px; /* Make height equal to width for a perfect square */
  border: 2px solid var(--tiertiary);
  border-radius: 6px;
  margin-right: 10px;
  display: inline-block;
  position: relative;
  box-sizing: border-box;
}

.custom-checkbox input:checked + .checkmark {
  background-color: var(--tiertiary);
}

.custom-checkbox input:checked + .checkmark:after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Make the label text wrap and take remaining space */
.custom-checkbox .checkmark + span,
.custom-checkbox .checkmark + * {
  flex: 1;
  min-width: 0;
  word-break: break-word;
  white-space: normal;
}

#user_container{
  width: 100%;
  display: flex;
  flex-wrap: wrap;
}

.timesheet-list-item {
  padding: 10px;
  margin: 5px;
  margin-right: -20px;
  border: 1px solid var(--tiertiary);
  border-radius: 6px;
  cursor: pointer;
  list-style-type: none;
  transition: background-color 0.2s;
}

.timesheet-list-item:hover {
  background-color: #f4f4f4;
  box-shadow: 0px 0px 2px #3b3b3b;
}

ul{
  margin: 0px;
  padding: 0px;
  padding-inline-start: 0px;;
}

#user-list{
  margin-top: 30px;
  padding-bottom: 100px;
}

.update_success_box{
  visibility: hidden;
  margin-top: 30px;
  width: 100%;
  background-color: lightgreen;
  border-radius: 6px;
}

.message{
  color: green;
  padding: 10px;
}

#empty_user_list{
  margin: 10px;
  color: var(--secondary);
  display: none;
}

.content-container{
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  width: 95%;
  padding-bottom: 100px;
}

.secondary_btn{
  margin-top: 20px;
  width: 100%;
  padding: 0.8rem;
  background-color: white;
  color: red;
  border: none;
  border-radius: 24px;
  font-size: 1rem;
  cursor: pointer;
  border: solid red;
}

.secondary_btn:hover{
  background-color: var(--background);
}

#delete-user-btn:hover{
  background-color: white;
}

/* Organization Details */

#payperiod-value{
  width: 5em;
}

#org-div, #rates-div {
  width: 100%;
  padding-bottom: 100px;
}

#org-form{
  width: 100%;
}

#rates_container{
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.user_box,
.rates_box{
  width: 45%;
}

.dialog-container {
  position: fixed;
  display: flex;
  flex-wrap: wrap;
  z-index: 5;
}

.close-row{
  width: 100%;
  display: flex;
  justify-content: end;
  align-items: center;
  padding-right: 20px;
  padding-top: 20px;
}

.close-btn{
  background-color: transparent;
  width: 30px;
  height: 30px;
  padding: 0px;
  color: var(--tiertiary);
  border: var(--tiertiary) solid 2px;
  border-radius: 20px;
  font-size: 1.5rem;
  cursor: pointer;
}

.close-btn:hover{
  transition: 0.2s;
  color: white;
  border: var(--tiertiary_hover) solid 2px;
}

#edit_user_box{
  margin-left: auto;
  margin-right: auto;
  width: 500px;
  max-height: 70vh;
  padding-left: 30px;
  padding-right: 30px;
  padding-bottom: 30px;
  background-color: white;
  z-index: 5;
  border-radius: 24px;
  display: none;
  box-shadow: 0px 0px 100px var(--secondary);
  overflow-y: auto;
}

#edit_rate_dialog, #confirm_submission_dialog{
  margin-left: auto;
  margin-right: auto;
  width: 300px;
  padding-top: 10px;
  padding-right: 30px;
  padding-left: 30px;
  padding-bottom: 30px;
  background-color: white;
  z-index: 5;
  display: none;
  border-radius: 24px;
  box-shadow: 0px 0px 100px var(--secondary);
  position: relative; /* Ensure positioning context for absolute children */
}

#no-rates-p, #no-accountants-p{
  text-align: center;
}

/* Employee Hours */

#previous-pay-period-container{
  width: 50%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.export-button{
  width: 300px;
  padding: 0.8rem;
  background-color: var(--tiertiary);
  color: white;
  border: none;
  border-radius: 24px;
  font-size: 1rem;
  cursor: pointer;
}

.export-button:hover{
  background-color: var(--tiertiary_hover);
  transition: 0.2s;
  box-shadow: 0px 0px 2px #3b3b3b;
}

.export-button:disabled{
  background-color: var(--secondary);
  color: white;
  cursor: not-allowed;
}

#export_btn_container{
  width: 98%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 50px;
}

.confirm_export_btn{
  width: 75px;
  padding: 0.8rem;
  margin-left: 10px;
  background-color: var(--tiertiary);
  color: white;
  border: none;
  border-radius: 24px;
  font-size: 1rem;
  cursor: pointer;
}

#confirm_submission_buttons{
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  align-items: center;
}

#confirm_submission_message{
  width: 100%;
  text-align: justify;
}

.pay_label{
  width: 100%;
  color: var(--secondary);
  margin: 0px;
  padding: 0px;
}

.pay-period-text{
  width: 100%;
  margin-top: 0px;
  margin-bottom: 0px;
  font-weight: bold;
}

.employee-details {
  margin-top: 8px;
  margin-bottom: 8px;
  width: 95%;
  display: flex;
  flex-wrap: wrap;
  border: 1px solid var(--tiertiary);
  border-radius: 6px;
  cursor: pointer;
  padding-left: 10px;
  padding-right: 10px;
  padding-bottom: 10px;
  transition: background-color 0.2s;
  justify-content: space-between;
}

.employee-details:hover {
  background-color: #f4f4f4;
  box-shadow: 0px 0px 2px #3b3b3b;
}

.name-content-div{
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  width: 100%;
  align-items: center;
}

.employee-name{
  padding: 0px;
  margin: 0px;
  font-size: 25px;
  font-weight: bold;
}

.pto-balance{
  color: var(--tiertiary);
  font-weight: bold;
  font-size: 18px;
  padding: 0px;
  margin: 0px;
}

.employee-time-off {
  margin-top: 10px;
  margin-bottom: 10px;
  border: 1px solid var(--tiertiary);
  border-radius: 6px;
  padding-left: 10px;
  padding-right: 10px;
  padding-bottom: 10px;
}

.approve-button{
  width: 150px;
}

.label-div{
  width: 60%;
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  padding: 0px;
  margin: 0px;
}

.dates-div{
  width: 60%;
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  padding: 0px;
  margin: 0px;
}

.label{
  padding: 0px;
  margin: 0px;
  font-weight: bold;
  font-size: 14px;
  color: var(--tiertiary);
  width: 48%;
  flex-shrink: 0;
}

.employee-hours-label{
  padding: 0px;
  margin: 0px;
  font-weight: bold;
  font-size: 14px;
  width: 100%;
  color: var(--tiertiary);
  flex-shrink: 0;
}

.date{
  padding: 0px;
  margin: 0px;
  width: 48%;
  flex-shrink: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.request-item{
  display: flex;
  flex-wrap: wrap;
  padding-top: 5px;
  padding-bottom: 5px;
  align-items: center;
  justify-content: space-between;
}

.request-time-off{
  padding: 5px;
  margin: 0px;
}

.request-date-approved{
  padding: 5px;
  margin: 0px;
}

.approve-button{
  margin-top: 0px;
  margin-bottom: 0px;
  margin-right: 5px;
  margin-left: 5px;
  padding: 5px;
  background-color: var(--backgroundGreen);
  color: var(--green);
  width: 100px;
}

.approve-button:hover{
  background-color: var(--green);
  color: white;
}

.deny-button{
  margin-top: 0px;
  margin-bottom: 0px;
  margin-right: 5px;
  margin-left: 5px;
  padding: 5px;
  background-color: var(--backgroundRed);
  color: var(--red);
  width: 100px;
}

.deny-button:hover{
  background-color: var(--red);
  color: white;
}

.denied-date{
  color: var(--red);
  font-weight: bold;
}

.approved-date{
  color: var(--green);
  font-weight: bold;
}

/* Base icon button style */
.icon-button {
  background-color: var(--primary);
  border: 2px solid var(--primary);
  cursor: pointer;
  padding: 4px;
  margin-left: 8px;
  margin-right: 8px;
  width: 40px;
}

.icon-button:hover {
  background-color: var(--primary);
  border: 2px solid var(--primary);
}

.icon {
  width: 20px;
  height: 20px;
}

/* Confirm icon style */
.confirm_icon-button:hover{
  background-color: var(--backgroundGreen);
  border: 2px solid var(--backgroundGreen);
}

.confirm_icon-button_selected {
  background-color: var(--backgroundGreen);
  border: 2px solid var(--green);
}

.confirm_icon-button_selected:hover {
  background-color: var(--backgroundGreen);
  border: 2px solid var(--green);
}

/* Deny and delete icon button styles */
.deny_icon-button:hover{
  background-color: var(--backgroundRed);
  border: 2px solid var(--backgroundRed);
}

.deny_icon-button_selected {
  background-color: var(--backgroundRed);
  border: 2px solid var(--red);
}

.deny_icon-button_selected:hover {
  background-color: var(--backgroundRed);
  border: 2px solid var(--red);
}


.divider {
  width: 100%;
  height: 1px;
  background-color: var(--tiertiary);
  margin: 10px 0;
}

.hours-worked{
  width: 30%;
}

.status-cards {
  margin: 8px;
  display: flex;
  flex-wrap: wrap;
  width: 20%;
  justify-content: flex-end;
  align-items: center;
}

.status-card {
  margin: 8px;
}

.pay_period_conf_state{
  margin: 10px;
  font-size: 14px;
}

.confirmation-status{
  width: 25%;
}

.confirmation-status-card {
  width: 100%;
  border-radius: 24px;
  text-align: center;
  padding-top: 10px;
  padding-bottom: 10px;
  margin-top: 10px;
  font-weight: bold;
  font-size: 14px;
}

.submitted {
  color: var(--green);
  background-color: var(--backgroundGreen);
}

.unsubmitted {
  color: var(--red);
  background-color: var(--backgroundRed);
}

.closed {
  color: #3b3b3b;
  background-color: #9c9c9c;
}

.null_sheet {
  color: transparent;
  background-color: transparent;
}

/* Legacy styles for backward compatibility */
.confirmed {
  color: var(--green);
  width: 100%;
  background-color: var(--backgroundGreen);
  border-radius: 24px;
  text-align: center;
  padding-top: 10px;
  padding-bottom: 10px;
}

.unconfirmed {
  color: var(--red);
  width: 100%;
  background-color: var(--backgroundRed);
  border-radius: 24px;
  text-align: center;
  padding-top: 10px;
  padding-bottom: 10px;
}

/* Media Queries */

/* Extra small devices (phones, 600px and down) */
@media only screen and (max-width: 600px) {
  main,
  .dialog-container{
    width: 95%;
  }
  .rates_box,
  .user_box{
    width: 100%;
  }
}

/* Small devices (portrait tablets and large phones, 600px and up) */
@media only screen and (min-width: 600px) {
  main,
  .dialog-container{
    width: 95%;
  }
  .rates_box,
  .user_box{
    width: 100%;
  }
}

/* Medium devices (landscape tablets, 768px and up) */
@media only screen and (min-width: 768px) {
  main,
  .dialog-container{
    width: 80%;
  }
  .rates_box,
  .user_box{
    width: 45%;
  }
}

/* Large devices (laptops/desktops, 992px and up) */
@media only screen and (min-width: 992px) {
  main,
  .dialog-container{
    width: 70%;
  }
  .rates_box,
  .user_box{
    width: 45%;
  }
}

/* Extra large devices (large laptops and desktops, 1200px and up) */
@media only screen and (min-width: 1200px) {
  main,
  .dialog-container{
    width: 60%;
  }
  .rates_box,
  .user_box{
    width: 45%;
  }
}

/* Employee Hour Report Styles */

.employee-report-header {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 0 20px;
  text-align: center;
}

.employee-report-header h2 {
  margin: 0;
  font-size: 28px;
  font-weight: bold;
  color: var(--secondary);
  padding: 16px 0;
  border-bottom: 2px solid var(--primary);
}

.timesheets-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.timesheet-card {
  background: white;
  border: 1px solid var(--tiertiary);
  border-radius: 8px;
  margin-bottom: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.timesheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--background);
  cursor: pointer;
  transition: background-color 0.2s;
}

.timesheet-header:hover {
  background: #f4f4f4;
}

.timesheet-header.open {
  background: var(--tiertiary);
  color: white;
}

.timesheet-header.open:hover{
  background: var(--tiertiary_hover);
}

.timesheet-summary {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  align-items: center;
}

.timesheet-dates {
  flex: 1;
}

.timesheet-dates h3 {
  margin: 0;
  font-size: 18px;
  font-weight: bold;
  padding: 0px;
  text-align: left;
}

.current-period-badge {
  background: var(--green);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  margin-left: 8px;
}

.timesheet-totals {
  display: flex;
  flex-wrap: wrap;
  flex: 1;
  text-align: center;
}

.timesheet-totals h3{
  font-weight: bold;
  font-size: 16px;
  width: 100%;
}

#timesheet_confirm_btn{
  margin-bottom: 20px;
  border: var(--tiertiary) solid 1px;
}

.total-hours {
  font-weight: bold;
  font-size: 16px;
}

.rate-breakdown {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.rate-hours {
  padding: 2px;
  border-radius: 4px;
  margin: 2px;
  font-size: 12px;
}

.timesheet-status {
  display: flex;
  flex-direction: column;
  align-items: end;
  flex: 1;
}

.confirmation-status {
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  width: 100px;
}

.confirmation-status.confirmed {
  background: var(--backgroundGreen);
  color: var(--green);
}

.confirmation-status.unconfirmed {
  background: var(--backgroundRed);
  color: var(--red);
}

.confirm-btn {
  background: var(--background);
  color: var(--tiertiary);
  border: none;
  font-weight: bold;
  padding: 7px 12px;
  width: 125px;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.confirm-btn:hover {
  background: var(--primary);
}

.expand-icon {
  font-size: 18px;
  font-weight: bold;
  margin-left: 16px;
}

.timesheet-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.timesheet-content.open {
  max-height: 2000px;
  transition: max-height 0.3s ease-in;
}

.daily-breakdown {
  padding: 20px;
  background: #f9f9f9;
}

.day-entry {
  border-bottom: 1px solid #e0e0e0;
  padding: 12px 0;
}

.day-entry:last-child {
  border-bottom: none;
}

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.day-header h4 {
  margin: 0;
  font-size: 16px;
  color: var(--secondary);
}

.day-total {
  font-weight: bold;
  color: var(--tiertiary);
}

.day-rates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.day-rate {
  background: white;
  border: 1px solid #e0e0e0;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--secondary);
}

/* Pagination Styles */
.pagination-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  justify-content: center;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pagination-btn {
  background: var(--tiertiary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 24px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--tiertiary_hover);
}

.pagination-btn:disabled {
  background: var(--secondary);
  cursor: not-allowed;
}

#page-info {
  font-weight: bold;
  color: var(--secondary);
  width: 200px;
  text-align: center;
}

/* Loading Spinner */
.loading-spinner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  text-align: center;
  z-index: 1000;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--tiertiary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

/* Show spinner when active */
.loading-spinner-small.active {
  display: inline-block;
}

.loading-spinner-small {
  display: none;
  width: 16px;
  height: 16px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--tiertiary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Message Styles */
.error-message,
.success-message {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 6px;
  color: white;
  font-weight: bold;
  z-index: 1001;
  animation: slideIn 0.3s ease-out;
}

.error-message {
  background: var(--red);
}

.success-message {
  background: var(--green);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.no-data {
  text-align: center;
  color: var(--secondary);
  font-style: italic;
  padding: 40px;
}

/* Responsive Design for Employee Hour Report */
@media only screen and (max-width: 768px) {
  .timesheet-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .timesheet-totals {
    align-items: flex-start;
  }
  
  .timesheet-status {
    flex-direction: row;
    align-items: center;
  }
  
  .daily-breakdown {
    padding: 16px;
  }
  
  .day-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}