/* GENERIC */
body {
  width: 100%;
  height: 100vh;
  max-height: 100%;
  max-width: 100%;
  margin: 0;
  background-image: url("resources/bg_f1_homepage.svg");
  display: flex;
  overflow-x: hidden;
  position: relative;
}

.error-message {
  display: none;
  position: absolute;
  top: 15px;
  left: 50%;
  min-width: 250px;
  height: 40px;
  margin-left: -125px;
  background-color: rgba(255, 0, 0, 0.4);
  border: 1px solid red;
  z-index: 1;
  border-radius: 5px;
  padding: 5px;
  justify-content: center;
  align-items: center;
}

.error-message.show {
  display: flex;
}

#errorMessageText {
  font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande",
    "Lucida Sans", Arial, sans-serif;
  font-size: 12px;
  text-align: center;
  overflow-wrap: break-word;
  color: white;
}

/* LOGIN SCREEN */
#loginContent {
  width: 100%;
  height: 100vh;
  display: grid;
  grid-template-columns: 40% 60%;
}

#leftPanel,
#rightPanel {
  margin: 0;
  height: 90vh;
}

/* LOGIN SCREEN: LEFT SIDE */
#lCard {
  background-color: rgba(10, 82, 57, 0.5);
  height: auto;
  width: auto;
  align-items: center;
  margin-left: 10vh;
  border-radius: 0px 0px 40px 40px;
  padding-top: 10%;
  padding-bottom: 15%;
  display: block;
}

#lCard > h1 {
  color: white;
  width: 80%;
  margin: 0;
  font-size: 3.2vw;
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
  font-weight: 700;
  line-height: 1.1;
  justify-self: center;
}

#cardHighlight {
  color: #2cd47c;
  font-style: italic;
  margin: 0;
}

.card {
  height: 250px;
  width: 400px;
  margin-top: 10%;
  justify-self: center;
  perspective: 1000px;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s ease;
  background-color: #022119;
  border-radius: 25px 25px 25px 25px;
  transform-style: preserve-3d;
}

#ccstrip {
  background-color: black;
  height: 50px;
  width: 100%;
}

#cctop {
  height: 30px;
  width: 100%;
  margin-top: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.8vw;
  color: white;
  opacity: 0.7;
}

#cccvv {
  height: 30px;
  width: 60%;
  margin-left: 25px;
  margin-top: 25px;
  display: flex;
  font-weight: bold;
  font-style: italic;
  font-size: 12px;
  justify-content: right;
  align-items: center;
  letter-spacing: 2px;
  background-color: #2cd47d9a;
  text-align: right;
  color: white;
}

#cclogo {
  height: 40px;
  width: auto;
  position: absolute;
  right: 10px;
  bottom: 15px;
}

.card-inner.flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  box-sizing: border-box;
  backface-visibility: hidden;
}

.card-front {
  height: 250px;
  width: 400px;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
}

.card-back {
  height: 250px;
  width: 400px;
  transform: rotateY(180deg);
}

/* CREDIT CARD GRID STYLES */
#cctl,
#cctr,
#ccbr,
#ccbl {
  position: relative;
}

/* CC: VIRTUAL **/
#cctl > span {
  color: white;
  top: 0;
  left: 0;
  position: absolute;
  padding: 10px;
  margin: 25px 0 0 25px;
  display: flex;
  border: 1px solid grey;
  border-radius: 10px;
  font-size: 0.7vw;
  font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande",
    "Lucida Sans", Arial, sans-serif;
}

/* CC: CHIP STYLE */
#cctlChip {
  display: grid;
  position: absolute;
  bottom: 0;
  left: 0;
  width: auto;
  margin: 0 0 5px 25px;
  grid-template-columns: auto auto auto;
  grid-template-rows: auto auto auto;
  gap: 2px;
}

.chipItem:first-child {
  grid-column: 1;
  grid-row: 1 / 4;
  height: 100%;
  border-radius: 6px 3px 3px 6px;
}

.chipItem {
  background-color: #2cd47c;
  opacity: 0.3;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 3px 3px 3px 3px;
  width: 12px;
  height: 12px;
}

.chipItem:nth-child(2) {
  grid-column: 2;
  grid-row: 1/3;
  height: 100%;
}

.chipItem:nth-child(5) {
  grid-column: 3;
  grid-row: 2/4;
  height: 100%;
}

/* CC: EXPENSIFY **/
#cctr > span {
  color: #2cd47c;
  position: absolute;
  top: 0;
  right: 0;
  font-size: 2vw;
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
  font-weight: 600;
  margin: 10% 10% 0 0;
}

/* CC: VISA LOGO */
#ccbr > img {
  width: auto;
  height: 60px;
  position: absolute;
  bottom: 0;
  right: 0;
  padding: 0;
  margin: 0 24px 14px 0;
  fill: white;
}

/* CC: CARD NUMBER AND CARD NAME */
#ccbl > .cardNumber {
  position: absolute;
  bottom: 0;
  left: 0;
  margin: 0 0 50px 25px;
  color: grey;
  display: flex;
}

#ccbl > .cardName {
  position: absolute;
  bottom: 0;
  left: 0;
  margin: 0 0 25px 25px;
  color: white;
  opacity: 0.7;
  display: flex;
}

/* LOGIN SCREEN: RIGHT SIDE */
#rightPanel {
  display: flex;
  align-items: center;
  justify-content: center;
}

#loginForm {
  width: 30vh;
  height: 30vh;
  padding: 5%;
  margin: 0;
  border-radius: 20px 20px 20px 20px;
  background-color: rgba(10, 82, 57, 0.3);
  backdrop-filter: blur(5px);
  display: flex;
  justify-self: center;
  align-items: center;
  justify-content: center;
}

#formRows {
  width: 100%;
}

#formRows > h1 {
  color: white;
  font-size: 1.5vw;
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
  justify-self: center;
  margin: 0;
}

.formRow {
  justify-self: center;
  width: 90%;
  margin-top: 15px;
}

.formRow > input {
  width: 90%;
  padding: 0.8em;
  border-radius: 0.5em;
  border: 2px solid #fff;
  background-color: transparent;
  color: white;
  outline: none;
}

#loginButton {
  width: 90%;
  padding: 0.8em;
  margin-top: 20px;
  border: 0px;
  justify-self: center;
  background-color: #2cd47c;
  color: white;
  border-radius: 10px;
  transition-duration: 0.4s;
  display: block;
}

#loginButton:hover {
  box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.6);
}

#loginButton:disabled {
  background-color: grey;
}

#featureList {
  height: 10vh;
  margin-top: 50px;
  top: 1;
  justify-self: center;
}

#featureList > ul {
  list-style: none;
  color: white;
  opacity: 90%;
  letter-spacing: 1px;
  font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande",
    "Lucida Sans", Arial, sans-serif;
  font-size: 0.7vw;
}

.featureHighlight {
  font-weight: 700;
  font-style: normal;
}

#featureList > ul li:before {
  content: "✓";
  margin-right: 5px;
}

/* FOOTER */
#loginFooter {
  background-color: rgba(10, 82, 57, 0.3);
  width: 100%;
  grid-column: 1/3;
  height: 10vh;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#loginFooter > h1 {
  color: white;
  font-size: 0.9vw;
  font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande",
    "Lucida Sans", Arial, sans-serif;
  font-style: normal;
}

/* TRANSACTIONS SCREEN */
#transactionsPage {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#transactionsFooter {
  position: static;
  flex: 0 0 auto;
  width: 100%;
  padding: 15px;
  background-color: rgba(10, 82, 57, 0.5);
}

#transactionsHeader {
  width: 100%;
  height: auto;
  padding: 15px;
  background-color: rgba(10, 82, 57, 0.5);
  justify-content: center;
  align-items: center;
}

#transactionsHeader > h1 {
  color: white;
  font-size: 1.6vw;
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 0;
}

#search {
  padding: 10px;
  display: flex;
  position: relative;
  backdrop-filter: blur(8px);
  background-color: rgba(10, 82, 57, 0.2);
}

#search > input {
  width: 100%;
  padding: 0.8em;
  border-radius: 0.5em;
  border: 1px solid white;
  background-color: transparent;
  color: white;
  outline: none;
  font-size: 0.8vw;
  left: 0;
  top: 0;
}

#transactionForm {
  width: 100%;
  height: auto;
  padding: 15px;
  margin-top: 50px;
  margin-bottom: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  justify-self: center;
}

.transaction-input {
  padding: 10px 15px 10px 15px;
  margin: 0;
  border: 1px solid #2cd47c;
  outline: none;
  color: white;
  background-color: transparent;
}

.custom-date-picker {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  padding-right: 40px;
  color: #fff;
  border: 1px solid #2cd47c;
}

.custom-date-picker::-webkit-calendar-picker-indicator {
  opacity: 0;
  display: block;
  position: absolute;
  right: 10px;
  width: 20px;
  height: 100%;
  cursor: pointer;
}

.custom-date-picker:before {
  content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="white" viewBox="0 0 24 24"><path d="M19 4h-1V2h-2v2H8V2H6v2H5c-1.1 0-1.99.9-1.99 2L3 20c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V10h14v10zM7 12h5v5H7z"/></svg>');
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.transaction-input::placeholder {
  color: white;
  opacity: 0.7;
}

#inputMerchant {
  border-radius: 10px 0px 0px 10px;
  height: 15px;
}

#inputAmount,
#inputDate {
  border-radius: 0px 0px 0px 0px;
  height: 15px;
}

#addTransactionButton {
  border-radius: 0px 10px 10px 0px;
  border: 0px;
  background-color: #2cd47c;
  color: white;
  transition-duration: 0.4s;
  padding: 10px 20px 10px 20px;
  border: 1px solid #2cd47c;
}

#transactionTable {
  width: 100%;
  flex: 1 1 auto;
  margin: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

#transactionTable table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

#transactionTable thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: rgba(10, 82, 57, 0.2);
  backdrop-filter: blur(8px);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  color: white;
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#transactionTable tbody td {
  padding: 10px;
  text-align: left;
  font-size: 0.8vw;
  color: white;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

#transactionTable tbody tr:nth-child(even) {
  background-color: rgba(10, 82, 57, 0.1);
}

#transactionTable tbody tr:hover {
  background-color: rgba(44, 212, 124, 0.2);
}

#transactionTable thead th.sortable {
  cursor: pointer;
  user-select: none;
}

#transactionTable thead th.sortable .sort-indicator {
  margin-left: 6px;
  opacity: 0.8;
  font-size: 0.9em;
}

#transactionTable th:nth-child(1),
#transactionTable td:nth-child(1) {
  width: 40px;
}

#transactionTable th:nth-child(2),
#transactionTable td:nth-child(2) {
  width: 15%;
}

#transactionTable th:nth-child(5),
#transactionTable td:nth-child(5),
#transactionTable th:nth-child(6),
#transactionTable td:nth-child(7) {
  width: 10%;
}

.tx-details {
  display: none;
  width: 100%;
}

.tx-details.is-open {
  display: table-row;
}

.tx-details td {
  padding: 0;
  background-color: rgba(10, 82, 57, 0.1);
  width: 100%;
}

.details-content {
  display: block;
  padding: 15px;
  font-size: 0.8vw;
  width: 100%;
  color: white;
}

.tx-row {
  cursor: pointer;
}

.tx-row:hover {
  background-color: rgba(44, 212, 124, 0.15);
}

.icon::before {
  font-weight: bold;
  margin-left: 6px;
}

.icon.yes::before {
  content: "✓";
  color: #2cd47c;
}

.icon.no::before {
  content: "✕";
  color: #ff6b6b;
}

.expand-col {
  width: 36px;
  text-align: center;
}

.expand-toggle {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  color: white;
}

.tx-row:hover .expand-toggle {
  background-color: rgba(255, 255, 255, 0.1);
}

.details-content {
  animation: expand 0.2s ease-out;
}

@keyframes expand {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
}

#pagination .page-btn {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #2cd47c;
  background: transparent;
  color: white;
  cursor: pointer;
}

#pagination .page-btn.active {
  background: #2cd47c;
  color: white;
}

#transactionsLoading {
  position: absolute;
  inset: 0;
  background: rgba(10, 82, 57, 0.6);
  backdrop-filter: blur(6px);
  z-index: 999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: system-ui, sans-serif;
  pointer-events: all;
}

#transactionsPage.loading {
  pointer-events: none;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #2cd47c;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
