/* =====================
   Base Reset & Body
===================== */
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: rgb(193, 157, 241);
  transition: background 1s ease;
}

h1 {
  text-align: center;
  color: #333;
}

/* =====================
   Footer
===================== */
footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  background-color: rgba(51, 51, 51, 0.6);
  color: white;
  height: 2em;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.85em;
  z-index: 10;
}

/* =====================
   Layout Containers
===================== */
#main-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 900px;
  gap: 10px;
}

#summary-container {
  display: flex;
  justify-content: center;
  width: 100%;
}

#summary-table {
  width: 60%;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  background-color: rgba(172, 170, 179, 0.64);
}

#content-container {    
  display: flex;
  justify-content: center;
  gap: 50px;
  width: 100%;
  max-width: 800px;
}

#expense-table,
#expense-form {
  flex: 1;
  background-color: rgba(172, 170, 179, 0.64);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* =====================
   Table Styling
===================== */
table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th, td {
  text-align: center;
  padding: 10px;
  overflow: hidden;
  white-space: nowrap;
}

th {
  background-color: #256cb8;
  color: white;
}

.table-headers th:first-of-type {
  border-top-left-radius: 5px;
  border-bottom-left-radius: 5px;
}

.table-headers th:last-of-type {
  border-top-right-radius: 5px;
  border-bottom-right-radius: 5px;
}

tr:hover {
  background-color: rgba(172, 170, 179, 0.64);
}

/* =====================
   Scrollable Table Body
===================== */
#expense-table td {
  padding: 5px;
  line-height: 1;
}

#scrollable-tbody {
  overflow-y: auto;
  max-height: 160px;
}

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

/* Scrollbar Styling */
#scrollable-tbody::-webkit-scrollbar {
  width: 7px;
}
#scrollable-tbody::-webkit-scrollbar-thumb {
  background-color: #256cb8;
  border-radius: 5px;
}
#scrollable-tbody::-webkit-scrollbar-track {
  background: transparent;
}

/* =====================
   Form Styling
===================== */
form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

input {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

input:focus, button:focus {
  outline: 2px solid #256cb8;
  outline-offset: 2px;
}

/* Submit Button */
#sub-button {
  background-color: #23923d;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.3s;
}

#sub-button:hover {
  background-color: #328d45;
}

/* Radio Button Group */
#radio-button {
  display: flex;
  justify-content: center;
  gap: 5px;
}

/* Delete Button */
.delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
}

/* =====================
   Theme Button
===================== */
#change-theme {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 20;
  background: rgba(194, 232, 249, 0.95);
  color: #333;
  padding: 8px 12px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
}

#change-theme:hover {
  background: rgba(147, 175, 189, 0.95);
}

/* Theme Window */
#theme-window {
  display: none;
  position: fixed;
  top: 45px;
  right: 10px;
  background: rgba(194, 232, 249, 0.95);
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  z-index: 15;
}

body.theme-buttons-visible #theme-window {
  display: flex;
}

.theme-button {
  margin: 0 5px;
  padding: 8px 12px;
  border: none;
  background: #fff;
  color: #333;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
}
.theme-button:hover {
  background: rgba(247, 217, 162, 0.95);
}

/* =====================
   Themes
===================== */
body.theme-neon {
  background: radial-gradient(circle at center, #0f0c29, #441a1c, #24243e);
  position: relative;
}
.neon-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.neon-bg::before,
.neon-bg::after {
  content: "";
  position: absolute;
  width: 300px; height: 300px;
  background: rgba(0, 255, 255, 0.15);
  border-radius: 50%;
  animation: float 10s linear infinite;
}
.neon-bg::after {
  width: 200px; height: 200px;
  left: 70%; top: 30%;
  animation-delay: 2s;
}

body.theme-waves {
  background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

/* =====================
   Keyframes
===================== */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes float {
  0% { transform: translate(0, 0); }
  50% { transform: translate(50px, 100px); }
  100% { transform: translate(0, 0); }
}

/* =====================
   Responsive Layout
===================== */
@media (max-width: 1024px) {
  #content-container {
    gap: 30px;
    padding: 0 15px;
  }
  h1 {
    font-size: 1.8rem;
  }
}

@media (max-width: 768px) {
  #content-container {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }
  #expense-table, #expense-form, #summary-table {
    width: 100%;
  }
  h1 {
    font-size: 1.5rem;
  }
}

@media (max-width: 500px) {
  #change-theme {
    top: auto;
    right: 10px;
    bottom: 10px;
    font-size: 0.9rem;
    padding: 6px 10px;
  }
  table th, table td {
    font-size: 0.85rem;
    padding: 6px;
  }
}

