/* Variables */
:root {
  --bg-color: #1e1b4b;
  --text-color: white;
  --tg-theme-button-color: rgba(255, 255, 255, 0.1);
  --tg-theme-button-text-color: white;
  --transparent-bg: rgba(255, 255, 255, 0.05);
  --transparent-bg-border: rgba(255, 255, 255, 0.1);
  --light-linear-gradient: linear-gradient(135deg, #0700c7cf 0%, #ad2e02 100%);
  --linear-gradient: linear-gradient(135deg, #11006e 0%, #5a1a04 100%);
  --linear-gradient-45deg: linear-gradient(45deg, #11006e 0%, #5a1a04 100%);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: linear-gradient(135deg, #11006e 0%, #5a1a04 100%);
  background-attachment: fixed;
  color: var(--text-color);
  width: 500px;
  margin: 10px auto;
  padding: 20px 15px 70px 15px;
  font-family: sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

/* Interactive Elements */
button,
select,
input {
  border: 0;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-color);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  width: 100%;
  font-size: 16px;
  padding: 12px 16px;
}

button:hover,
select:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  background-color: rgba(255, 255, 255, 0.15);
}

/* Tooltip styles */
.form-group {
  position: relative;
}

.form-group label {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
}

.form-group label i {
  margin-right: 5px;
  cursor: pointer;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.form-group label i:hover {
  color: white;
}

.form-group .tooltip {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  z-index: 100;
  width: 100%;
  margin-top: -5px;
  margin-bottom: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.hidden {
  display: none;
}

.info {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 5px;
}

/* Select Styles */
select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.4-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px auto;
  padding: 12px 40px 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(255, 255, 255, 0.05);
}

select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.3);
  background-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

select option {
  background-color: var(--bg-color);
  color: var(--text-color);
  padding: 12px;
  font-size: 16px;
}

/* Form Elements */
fieldset {
  border: none;
  position: relative;
  margin-top: 20px;
}

.header{
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 7px 0 25px 0;
  width: 100%;
}
.dropdown-btn {
  color: var(--text-color);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: none;
  font-size: 20px;
  font-weight: 200;
  margin: 0;
  background: var(--transparent-bg-border);
  border-radius: 50%;
  padding: 5px 11px;
}

.dropdown-content {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 5px;
  background: linear-gradient(135deg, #11006e 0%, #5a1a04 100%);
  min-width: 230px;
  border-radius: 6px;
  box-shadow: 47px 48px 147px 20px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  z-index: 3000;
  overflow: hidden;
}

.user-info {
  padding: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--transparent-bg);
}

.user-info .name {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 5px;
}

.user-info .balance {
  font-size: 16px;
  opacity: 0.8;
  color: #4ade80;
}

.dropdown-content .separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 5px 0;
}

.dropdown-content a {
  color: var(--text-color);
  padding: 10px 16px;
  text-decoration: none;
  display: block;
  transition: background-color 0.3s ease;
}

.dropdown-content a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.dropdown-content a.active {
  background-color: rgba(255, 255, 255, 0.15);
}

/* Tab Navigation */
.tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.1);
  padding: 0;
  border-radius: 40px;
  position: relative;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  margin-right: 15px;
}

.tab-button {
  flex: 1;
  background: none;
  border: none;
  padding: 14px 20px;
  margin: 0;
  width: auto;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  border-radius: 40px;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background-color: transparent;
}

.tab-button:hover {
  color: var(--text-color);
  background: none;
  transform: none;
  box-shadow: none;
}

.tab-button.active {
  color: var(--text-color);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.show {
  display: block;
}

/* Content Area */
#content {
  padding: 15px 0;
  display: flex;
  flex-flow: column;
  gap: 20px;
}

/* Error Messages */
#showerror {
  padding: 10px 35px 10px 10px;
  font-size: 16px;
  color: tomato;
  display: none;
  text-align: center;
  background: rgba(255, 0, 0, 0.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  border-radius: 5px;
  position: relative;
}

#showerror .close-error {
  position: absolute;
  right: 0;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: tomato;
  cursor: pointer;
  padding: 5px;
  font-size: 18px;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
  width: fit-content;
  box-shadow: none;
}

#showerror .error-message {
  margin-right: 20px;
}

#info {
  color: dimgrey;
  padding-top: 23px;
  padding-left: 10px;
}


/* Bank Search Styles */
.bank-search-container {
  position: relative;
  margin: 6px 0;
}

.bank-search-container input {
  width: 100%;
  margin: 0;
  background: var(--transparent-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.bank-search-container::after,
.age-fieldset::after,
.provider-dropdown::after {
  content: attr(data-label);
  position: absolute;
  top: -9px;
  left: 7px;
  background-color: #410e4a;
  padding: 0 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none;
  border-radius: 20px;
  line-height: 1.4;
}

.bank-search-container input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
}

.bank-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: rgba(30, 27, 75, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.bank-option {
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 15px;
}

.bank-option:hover {
  background: var(--transparent-bg-border);
}

.bank-option.active {
  background: var(--transparent-bg-border);
}

.bank-option .highlight {
  color: #818cf8;
  font-weight: 500;
}

.bank-option:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Custom scrollbar for the dropdown */
.bank-dropdown::-webkit-scrollbar {
  width: 8px;
}

.bank-dropdown::-webkit-scrollbar-track {
  background: var(--transparent-bg);
  border-radius: 4px;
}

.bank-dropdown::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.bank-dropdown::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}


/* State Container Styles */
.state-container {
  display: flex;
  flex-flow: column;
  background: var(--transparent-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
.state-container h2 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-color);
  background: var(--transparent-bg);
  padding: 5px 10px;
  border-radius: 10px 10px 0 0;
}

.state-flag {
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 80px;
  height: 80px;
  background-color: white;
  border: 2px solid rgba(255, 255, 255, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.state-flag img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.state-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
}

.state-info p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.4;
}

.lead-input-container {
  display: flex;
  gap: 10px;
}

#lead-input {
  padding: 6px 8px;
  border-bottom: 2px solid green;
  border-radius: 0;
}

.add-button {
  flex-shrink: 0;
  padding: 7px 20px;
  background: #008a3e;
  color: white;
  border: none;
  border-radius: 3px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;
  width: fit-content;
}

.add-button:hover {
  background-color: #00662d;
}

#orderSummary {
  position: fixed;
  top: 100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #11006e 0%, #5a1a04 100%);
  transition: top 0.3s ease-in-out;
  padding: 15px;
  box-sizing: border-box;
  overflow-y: auto;
  z-index: 1000;
}

#orderSummary h2 {
  color: var(--text-color);
  text-align: center;
  margin-bottom: 25px;
  font-size: 24px;
}

#orderSummary .state-container {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  gap: 15px;
  position: relative;
  padding: 10px;
  background: var(--transparent-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  margin-bottom: 15px;
}

#orderSummary .state-img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: contain;
  background-color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#orderSummary .delete-order {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 5px;
  font-size: 18px;
  width: fit-content;
  box-shadow: none;
  text-shadow: 1px 1px 3px rgb(198 33 33);
}

#orderSummary .confirm-order {
  display: block;
  width: 100%;
  padding: 15px;
  background: #008a3e;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  margin-top: 20px;
  cursor: pointer;
  transition: background-color 0.2s;
}

#orderSummary .confirm-order:hover {
  background: #22c55e;
}

#orderSummary .go-back {
  display: block;
  width: 100%;
  padding: 15px;
  background: transparent;
  color: var(--text-color);
  border: 1px solid currentColor;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  margin-top: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

#orderSummary .go-back:hover {
  background: rgba(255, 255, 255, 0.1);
}

#orderSummary p {
  font-size: 12px;
}

#processing-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

#processing-dialog .content {
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  max-width: 80%;
}

#processing-dialog h3 {
  color: var(--text-color);
  margin: 15px 0;
}

#processing-dialog .spinner {
  margin: 0 auto;
}

.order-totals {
  margin: 20px 0;
  padding: 15px;
  background: var(--transparent-bg);
  border-radius: 8px;
}

.discount {
  color: #28a745;
}

.final-total{
  font-size: 15px !important;
  font-weight: 700;
}

.insufficient-funds {
  color: #dc3545;
  font-weight: 500;
}

button.confirm-order:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
  opacity: 0.65;
}

/* Action Buttons */
#showOrderBtn {
  background: linear-gradient(135deg, #0700c7cf 0%, #ad2e02 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  font-weight: 600;
  margin-top: 20px;
  font-size: 17px;
  border: none;
  color: #ffffffc2;
}

/* Loader */
#loader {
  display: none;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  flex-direction: column;
}

.lds-roller {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
}

.lds-roller div {
  animation: lds-roller 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  transform-origin: 40px 40px;
}

.lds-roller div:after {
  content: " ";
  display: block;
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  margin: -4px 0 0 -4px;
}

.lds-roller div:nth-child(1) {
  animation-delay: -0.036s;
}

.lds-roller div:nth-child(1):after {
  top: 63px;
  left: 63px;
}

@keyframes lds-roller {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@media screen and (max-width: 600px) {
  body {
    width: 100%;
    margin: 0;
    padding: 15px 15px 70px 15px;
    font-size: 15px;
  }

  button,
  select,
  input {
    width: 100%;
    margin: 6px 0;
    font-size: 16px;
    padding: 12px 16px;
  }

  .tab-button {
    padding: 12px 16px;
    font-size: 15px;
  }

  #showOrderBtn {
    padding: 12px 20px;
    font-size: 16px;
    width: 100%;
    z-index: 100;
    position: fixed;
    left: 0;
    bottom: 0px;
    border-radius: 0;
    margin: 0;
    border: 1px solid rgb(255 255 255 / 40%);
  }

  #loader {
    background-color: rgba(0, 0, 0, 0.7);
  }

  .lds-roller {
    transform: scale(0.8);
  }
  .bank-dropdown {
    max-height: 300px;
  }

  .bank-option {
    padding: 10px 15px;
    font-size: 16px;
  }
}

@media screen and (max-width: 360px) {
  body {
    font-size: 14px;
  }

  button,
  select,
  input {
    font-size: 15px;
    padding: 12px 14px;
  }

  .tab-button {
    padding: 10px 14px;
    font-size: 14px;
  }
}