:root {
  --bg-color: #ffffff;
  --text-color: #000000;
  --border-color: #057fd0;
  --cancelled-bg: #CECECE;
  --cancelled-text: grey;
  --input-bg: #ffffff;
  --input-text: #000000;
  --input-border: #cccccc;
  --input-focus-border: #057fd0;
  --radio-bg: #ffffff;
  --radio-checked: #057fd0;
}

[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --text-color: #e1e1e1;
  --border-color: #4a9eda;
  --cancelled-bg: #2a2a2a;
  --cancelled-text: #a0a0a0;
  --input-bg: #2d2d2d;
  --input-text: #e1e1e1;
  --input-border: #404040;
  --input-focus-border: #4a9eda;
  --radio-bg: #2d2d2d;
  --radio-checked: #4a9eda;
}

html {
  background: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
  font-family: Calibri;
}


#contact_form {
  margin: auto;
  width: 90%;
  border: 3px solid green;
  padding: 10px;
  max-width: 700px;
}

#cancelled_history {
  color: var(--cancelled-text);
  background-color: var(--cancelled-bg);
}

#active_history h3 {
  margin-bottom: 3px;
  margin-top: 25px;
}

#cancelled_history h3 {
  margin-bottom: 3px;
}

#balances {
  margin: auto;
  width: 90%;
  border: 3px solid var(--border-color);
  padding: 10px;
  max-width: 700px;
}

#history {
  margin: auto;
  width: 90%;
  border: 3px solid var(--border-color);
  padding: 10px;
  max-width: 700px;
}

h1 {
  font-family: Calibri;
  text-align: center;
}

p {
  font-family: Calibri;
}

h2 {
  font-family: Calibri;
}

h3 {
  font-family: Calibri;
}

tr {
  font-family: Calibri;
}

td {
  font-family: Calibri;
}

/* Modern Button Base Styles */
.blue_button,
.history_button,
.add_user_button,
.settings_button,
.sml_grn_btn,
.sml_red_btn {
  position: relative;
  display: inline-block;
  padding: 12px 24px;
  font-family: Calibri, sans-serif;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Button Sizes */
.blue_button,
.history_button,
.settings_button {
  font-size: 30px;
  height: 75px;
  width: 100%;
}

.add_user_button {
  font-size: 30px;
  width: 100%;
  margin-right: 30px;
}

.sml_grn_btn,
.sml_red_btn {
  font-size: 15px;
  height: 25px;
  width: auto;
  padding: 4px 12px;
}

/* Button Colors */
.blue_button {
  background: linear-gradient(135deg, #33bdef 0%, #019ad2 100%);
  color: #ffffff;
  text-shadow: 0px -1px 0px #5b6178;
}

.history_button {
  background: linear-gradient(135deg, #4BB757 0%, #3C9D43 100%);
  color: #ffffff;
  text-shadow: 0px -1px 0px #5b6178;
  float: right;
  width: 50%;
  margin-top: 1px;
}

.add_user_button {
  background: linear-gradient(135deg, #4BB757 0%, #3C9D43 100%);
  color: #ffffff;
  text-shadow: 0px -1px 0px #5b6178;
}

.settings_button {
  background: linear-gradient(135deg, #bb3d3d 0%, #9d0e0e 100%);
  color: #ffffff;
  text-shadow: 0px -1px 0px #5b6178;
  width: 50%;
  margin-top: 1px;
}

.sml_grn_btn {
  background: linear-gradient(135deg, #4BB757 0%, #3C9D43 100%);
  color: #ffffff;
  text-shadow: 0px -1px 0px #5b6178;
}

.sml_red_btn {
  background: linear-gradient(135deg, #bb3d3d 0%, #9d0e0e 100%);
  color: #ffffff;
  text-shadow: 0px -1px 0px #5b6178;
}

/* Button Hover Effects */
.blue_button:hover,
.history_button:hover,
.add_user_button:hover,
.settings_button:hover,
.sml_grn_btn:hover,
.sml_red_btn:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Button Active Effects */
.blue_button:active,
.history_button:active,
.add_user_button:active,
.settings_button:active,
.sml_grn_btn:active,
.sml_red_btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Ripple Effect */
.blue_button::before,
.history_button::before,
.add_user_button::before,
.settings_button::before,
.sml_grn_btn::before,
.sml_red_btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.blue_button:active::before,
.history_button:active::before,
.add_user_button:active::before,
.settings_button:active::before,
.sml_grn_btn:active::before,
.sml_red_btn:active::before {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }

  100% {
    transform: scale(20, 20);
    opacity: 0;
  }
}

/* Disabled state */
.blue_button:disabled,
.history_button:disabled,
.add_user_button:disabled,
.settings_button:disabled,
.sml_grn_btn:disabled,
.sml_red_btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

input[type="text"] {
  width: 100%;
  height: 50px;
  font-size: 22px;
  padding: 10px;
  background-color: var(--input-bg);
  color: var(--input-text);
  border: 1px solid var(--input-border);
  border-radius: 4px;
  transition: all 0.3s ease;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 2px rgba(74, 158, 218, 0.2);
}

input[type="number"] {
  width: 100%;
  height: 50px;
  font-size: 22px;
  padding: 10px;
  background-color: var(--input-bg);
  color: var(--input-text);
  border: 1px solid var(--input-border);
  border-radius: 4px;
  transition: all 0.3s ease;
}

input[type="number"]:focus {
  outline: none;
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 2px rgba(74, 158, 218, 0.2);
}

/* RADIO */
.container {
  display: inline-block;
  position: relative;
  padding-left: 35px;
  margin-bottom: 12px;
  cursor: pointer;
  font-size: 22px;
  width: 30%;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  color: var(--text-color);
}

/* Hide the browser's default radio button and checkbox */
.container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

/* Create a custom radio button */
.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 25px;
  width: 25px;
  background-color: var(--radio-bg);
  border: 2px solid var(--input-border);
  border-radius: 50%;
  transition: all 0.3s ease;
}

/* Create a custom checkbox */
.container input[type="checkbox"]~.checkmark {
  border-radius: 4px;
  /* Square corners for checkboxes */
}

/* On mouse-over, add a darker border */
.container:hover input~.checkmark {
  border-color: var(--input-focus-border);
}

/* When the radio button is checked, add the checked background */
.container input:checked~.checkmark {
  background-color: var(--radio-checked);
  border-color: var(--radio-checked);
}

/* Create the indicator (the dot/circle - hidden when not checked) */
.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

/* Show the indicator (dot/circle) when checked */
.container input:checked~.checkmark:after {
  display: block;
}

/* Style the indicator (dot/circle) for radio buttons */
.container input[type="radio"]~.checkmark:after {
  top: 7px;
  left: 7px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--input-bg);
}

/* Style the indicator (checkmark) for checkboxes */
.container input[type="checkbox"]~.checkmark:after {
  left: 8px;
  top: 4px;
  width: 5px;
  height: 10px;
  border: solid var(--input-bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Disabled state */
input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Add user textbox specific styles */
.add_user_textbox {
  width: 100% !important;
  height: 50px !important;
  font-size: 22px !important;
  padding: 10px !important;
  text-align: center;
  background-color: var(--input-bg) !important;
  color: var(--input-text) !important;
  border: 1px solid var(--input-border) !important;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.add_user_textbox:focus {
  outline: none;
  border-color: var(--input-focus-border) !important;
  box-shadow: 0 0 0 2px rgba(74, 158, 218, 0.2);
}

/* User container text color */
.user_container {
  color: var(--text-color);
}

/* Ensure all text elements use the theme color */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-color);
}

.customamount {
  width: 100px !important;
  position: inherit !important;
  margin-right: 10px;
}

.dark-mode-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  background: var(--bg-color);
  border: 2px solid var(--border-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  font-size: 20px;
  transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
  transform: scale(1.1);
}

/* User visibility slider switch */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 24px;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: #2196F3;
}

input:checked+.slider:before {
  transform: translateX(16px);
}

/* Ripple effect container */
.ripple {
  position: relative;
  overflow: hidden;
  transform: translate3d(0, 0, 0);
}

/* Ripple effect */
.ripple:after {
  content: "";
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10, 10);
  opacity: 0;
  transition: transform .5s, opacity 1s;
}

.ripple:active:after {
  transform: scale(0, 0);
  opacity: .3;
  transition: 0s;
}

/* Update button classes to include ripple */
.blue_button,
.history_button,
.add_user_button,
.settings_button,
.sml_grn_btn,
.sml_red_btn {
  position: relative;
  overflow: hidden;
  transform: translate3d(0, 0, 0);
}

.blue_button:after,
.history_button:after,
.add_user_button:after,
.settings_button:after,
.sml_grn_btn:after,
.sml_red_btn:after {
  content: "";
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.3) 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10, 10);
  opacity: 0;
  transition: transform .5s, opacity 1s;
}

.blue_button:active:after,
.history_button:active:after,
.add_user_button:active:after,
.settings_button:active:after,
.sml_grn_btn:active:after,
.sml_red_btn:active:after {
  transform: scale(0, 0);
  opacity: .3;
  transition: 0s;
}

/* Table Styles */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

th,
td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: var(--border-color);
  color: #ffffff;
  font-weight: bold;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Table container */
.table-container {
  width: 100%;
  overflow-x: auto;
  margin: 1rem 0;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive table */
@media screen and (max-width: 600px) {
  table {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tbody {
    display: block;
    width: 100%;
  }

  tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
  }

  td {
    display: block;
    text-align: right;
    padding: 12px 15px;
    position: relative;
    padding-left: 50%;
  }

  td::before {
    content: attr(data-label);
    position: absolute;
    left: 15px;
    width: 45%;
    text-align: left;
    font-weight: bold;
  }
}