/* Reset default styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: #f4f6f9;
  color: #333;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 20px;
}

.container {
  background: #fff;
  padding: 25px 30px;
  border-radius: 12px;
  max-width: 700px;
  width: 100%;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

h1 {
  text-align: center;
  margin-bottom: 25px;
  font-size: 28px;
  color: #007bff;
}

/* Input Groups */
.input-group {
  margin-bottom: 15px;
}

.input-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 6px;
}

.input-group input {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  transition: 0.3s;
}

.input-group input:focus {
  border-color: #007bff;
  outline: none;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.4);
}

/* Buttons */
button {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.3s;
  font-weight: bold;
  margin-bottom: 10px;
}

#purchase-btn {
  background: #28a745;
  color: #fff;
}

#purchase-btn:hover {
  background: #218838;
}

.reset-btn {
  background: #dc3545;
  color: #fff;
}

.reset-btn:hover {
  background: #b02a37;
}

/* Change Display */
#change-box {
  margin-top: 20px;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #f8f9fa;
}

#change-box h2 {
  margin-bottom: 10px;
  font-size: 20px;
}

#change-due {
  font-size: 16px;
  font-weight: bold;
}

/* Transaction History */
#history-box {
  margin-top: 25px;
}

#history-box h2 {
  margin-bottom: 10px;
  font-size: 20px;
}

#history-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  display: block;
  overflow-x: auto; /* Make table scrollable on small screens */
  white-space: nowrap;
}

#history-table th,
#history-table td {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: center;
  font-size: 14px;
}

#history-table th {
  background: #007bff;
  color: #fff;
}

#history-table tr:nth-child(even) {
  background: #f9f9f9;
}

/* ✅ RESPONSIVE DESIGN */
@media (max-width: 768px) {
  .container {
    padding: 20px;
  }

  h1 {
    font-size: 22px;
  }

  .input-group input {
    font-size: 14px;
    padding: 8px;
  }

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

  #change-box h2,
  #history-box h2 {
    font-size: 18px;
  }

  #change-due {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }

  .container {
    padding: 15px;
  }

  h1 {
    font-size: 20px;
  }

  .input-group label {
    font-size: 14px;
  }

  .input-group input {
    font-size: 13px;
    padding: 7px;
  }

  button {
    font-size: 13px;
    padding: 8px;
  }

  #history-table th,
  #history-table td {
    font-size: 12px;
    padding: 6px;
  }
}
