/* General Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body Styles */
body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

/* Container Styles */
.container {
  background: rgba(255, 255, 255, 0.95);
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 1200px;
  text-align: center;
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Heading Styles */
h1 {
  color: #2c3e50;
  font-size: 1.8em;
  margin-bottom: 20px;
}

/* Current Date and Time */
#currentDateTime {
  font-size: 1rem;
  color: #666;
  display: block;
  margin-top: 10px;
}

/* Form Container */
.form-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.form-container label {
  font-size: 1em;
  font-weight: 600;
  color: #555;
}

.form-container select,
.form-container input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  box-sizing: border-box;
}

/* Add Deposit Button */
#addButton {
  background: linear-gradient(90deg, #6a11cb, #2575fc);
  color: white;
  border: none;
  padding: 12px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 25px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#addButton:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(106, 17, 203, 0.4);
}

/* Table Container */
.table-container {
  overflow-x: auto;
  margin-top: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  background: linear-gradient(135deg, #6a11cb, #2575fc);
  color: white;
  font-weight: 600;
}

td {
  color: #555;
}

/* Delete Row Button */
.deleteRow {
  padding: 8px 12px;
  background: #ff416c;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.deleteRow:hover {
  background: #ff4b2b;
}

/* Actions Container */
.actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

#deleteButton,
#resetButton {
  background: linear-gradient(90deg, #ff416c, #ff4b2b);
  color: white;
  border: none;
  padding: 12px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 25px;
  flex: 1;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#deleteButton:hover,
#resetButton:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(255, 65, 108, 0.4);
}

/* Input Group */
.input-group {
  text-align: left;
  margin: 15px 0;
}

.input-group label {
  font-size: 1em;
  font-weight: 600;
  color: #555;
}

.input-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  box-sizing: border-box;
}

/* Button Group */
.button-group {
  display: flex;
  flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
  gap: 10px;
  margin-top: 20px;
}

.button-group .modern-btn {
  flex: 1 1 100%; /* Make buttons take full width on small screens */
  min-width: 120px;
  text-align: center;
}

/* Modern Button Styles */
.modern-btn {
  background: linear-gradient(90deg, #6a11cb, #2575fc);
  color: white;
  border: none;
  padding: 12px 20px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 25px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.modern-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(106, 17, 203, 0.4);
}

.modern-btn.reset {
  background: linear-gradient(90deg, #ff416c, #ff4b2b);
}

.modern-btn.payment-button {
  background: linear-gradient(90deg, #8e2de2, #4a00e0);
}

/* Result, Details, and Distribution Sections */
.result, .details, .distribution {
  margin-top: 20px;
  font-size: 1.1em;
  color: #333;
  animation: slideIn 0.5s ease-in-out;
}

.result h3, .distribution h3 {
  color: #2c3e50;
  margin-bottom: 10px;
}

.result p, .distribution p {
  background: #ecf0f1;
  padding: 10px;
  border-radius: 8px;
  color: #333;
  margin: 5px 0;
  animation: fadeIn 0.5s ease-in-out;
}

/* Popup Styles */
.popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.popup-content {
  background: white;
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  text-align: center;
  width: 90%;
  max-width: 600px;
  position: relative;
  animation: slideIn 0.3s ease-in-out;
}

@keyframes slideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 1.5em;
  cursor: pointer;
  color: #333;
  transition: color 0.3s ease;
}

.close:hover {
  color: #ff416c;
}

.close-popup-btn {
  margin-top: 20px;
  background: linear-gradient(90deg, #6a11cb, #2575fc);
  color: white;
  border: none;
  padding: 12px 20px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 25px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.close-popup-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(106, 17, 203, 0.4);
}

.add-amount-btn {
  margin-top: 20px;
  background: linear-gradient(90deg, #00b09b, #96c93d);
  color: white;
  border: none;
  padding: 12px 20px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 25px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.add-amount-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 176, 155, 0.4);
}

.add-amount-btn:disabled {
  background: #95a5a6;
  cursor: not-allowed;
}

/* Till Date Table Styles */
.till-date-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.till-date-table th,
.till-date-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.till-date-table th {
  background: linear-gradient(135deg, #6a11cb, #2575fc);
  color: white;
  font-weight: 600;
}

.till-date-table td {
  color: #555;
}

.till-date-table tbody tr {
  transition: background 0.3s ease;
}

.till-date-table tbody tr:hover {
  background: #f8f9fa;
}

.till-date-table .total-row {
  background: #f8f9fa;
  font-weight: 600;
}

.till-date-table .total-row td {
  color: #333;
}

/* Media Query for Mobile Devices */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  .button-group {
    flex-direction: column; /* Stack buttons vertically on small screens */
  }

  .button-group .modern-btn {
    width: 100%; /* Ensure buttons take full width */
    margin-bottom: 10px; /* Add spacing between stacked buttons */
  }

  .popup-content {
    width: 95%; /* Make popup content fit better on small screens */
    padding: 15px;
  }

  .till-date-table th,
  .till-date-table td {
    padding: 10px;
    font-size: 14px; /* Adjust font size for better readability */
  }
}