/* ===== GLOBAL VARIABLES ===== */
:root {
  --font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande',
    'Lucida Sans', Arial, sans-serif;
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --text-color: #2c3e50;
  --light-bg: #ecf0f1;
  --white: #ffffff;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

/* ===== RESET & BASE STYLES ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  font-family: var(--font-family);
  min-height: 100vh;
  padding: 2rem 1rem;
  color: var(--text-color);
}

/* ===== HEADER STYLES ===== */
h1 {
  font-size: clamp(2rem, 5vw, 2.5rem);
  font-weight: bold;
  margin: 1rem 0 2rem;
  text-align: center;
  color: var(--white);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* ===== CHANGE DUE CONTAINER STYLES ===== */
#change-due-container {
  align-items: center;
  background: rgba(0, 0, 0, 0.8);
  border: none;
  border-radius: 15px;
  color: var(--white);
  display: flex;
  flex-direction: column;
  margin: 1rem auto;
  padding: 1.5rem;
  width: min(90%, 500px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(5px);
  gap: 0.5rem;
}

#change-due-title,
#status-title {
  font-size: clamp(1.2rem, 3vw, 1.4rem);
  margin-bottom: 0.5rem;
}

#change-due {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: center;
  font-size: 1.1rem;
}

#status {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--accent-color);
  text-align: center;
}

/* ===== CASH INPUT FORM STYLES ===== */
#cash-input-form {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: min(90%, 500px);
  margin: 2rem auto;
}

#cash-label {
  font-size: clamp(1rem, 2.5vw, 1.1rem);
  color: var(--white);
}

#cash {
  appearance: textfield;
  background-color: var(--white);
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 1.1rem;
  padding: 12px;
  width: min(100%, 300px);
  transition: var(--transition);
  box-shadow: var(--shadow);
}

#cash:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
  outline: none;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ===== BUTTON STYLES ===== */
#purchase-btn {
  background: var(--accent-color);
  border: none;
  border-radius: 8px;
  color: var(--white);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: bold;
  padding: 12px 24px;
  transition: var(--transition);
  width: min(100%, 300px);
  box-shadow: var(--shadow);
}

#purchase-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

#purchase-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ===== REGISTER STYLES ===== */
#register {
  align-items: center;
  background: var(--white);
  border: none;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  margin: 2rem auto;
  padding: 2rem;
  width: min(90%, 500px);
  box-shadow: var(--shadow);
}

#total {
  font-size: clamp(1.5rem, 4vw, 1.8rem);
  margin-bottom: 1.5rem;
  color: var(--primary-color);
}

#change-container {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  text-align: center;
}

#change-in-drawer {
  grid-column: 1 / -1;
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

#change-container p {
  background: var(--light-bg);
  padding: 0.8rem;
  border-radius: 8px;
  transition: var(--transition);
}

#change-container p:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* ===== FOOTER STYLES ===== */
#footer {
  color: var(--white);
  text-align: center;
  margin-top: 2rem;
}

.footer-link {
  color: var(--white);
}

.footer-link:hover {
  color: black;
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 480px) {
  body {
    padding: 1rem 0.5rem;
  }

  #register {
    padding: 1rem;
  }

  #change-container {
    grid-template-columns: 1fr;
  }
}
