* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #0a0a0a;
  color: #ffffff;
  height: 100vh;
  overflow: hidden;
  transition: all 0.3s ease;
}

/*Header Section*/
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  position: relative;
}

.header h1 {
  font-size: 2rem;
  color: #00ffff;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.theme-toggle {
  margin-left: auto;
}

.theme-btn {
  background-color: rgba(255, 255, 255, 0.1);
  color: #00ffff;
  border: 2px solid #00ffff;
  padding: 0.6rem;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-btn:hover {
  background-color: rgba(0, 255, 255, 0.2);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
  transform: rotate(180deg);
}

/*Layout*/
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem 1rem;
  height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
}

.main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  height: 100%;
  min-height: 0;
}

/*Expense Form*/
.expense-form {
  background-color: #1a1a1a;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.expense-form h3 {
  color: #00ffff;
  font-size: 1.2rem;
  margin-bottom: 1.2rem;
  text-align: center;
  border-bottom: 2px solid rgba(0, 255, 255, 0.3);
  padding-bottom: 0.8rem;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.form-actions {
  margin-top: auto;
  padding-top: 1rem;
}

label {
  display: block;
  margin-bottom: 0.4rem;
  color: #00ffff;
  font-weight: 500;
  font-size: 0.9rem;
}

input[type="number"],
input[type="text"],
input[type="date"],
select {
  width: 100%;
  padding: 0.6rem;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: #00ffff;
  box-shadow: 0 0 0 3px rgba(0, 255, 255, 0.1);
}

select option {
  background-color: #1a1a1a;
  color: #ffffff;
}

button[type="submit"] {
  background-color: rgba(255, 255, 255, 0.1);
  color: #00ffff;
  border: 2px solid #00ffff;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  width: 100%;
}

button[type="submit"]:hover {
  background-color: rgba(0, 255, 255, 0.2);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
}

button[type="submit"]:active {
  background-color: rgba(0, 255, 255, 0.4);
  transform: translateY(1px);
}

/*Expenses Section*/
.expenses-section {
  background-color: #1a1a1a;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.expenses-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.expenses-header h2 {
  color: #00ffff;
  font-size: 1.2rem;
}

.total-display {
  background-color: rgba(0, 0, 0, 0.8);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: #00ffff;
  border: 2px solid #00ffff;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

/*Filters*/
.filters-section {
  display: flex;
  flex-shrink: 0;
  gap: 1rem;
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-group {
  flex: 1;
}

#filter-category,
#search-input {
  width: 100%;
  padding: 0.6rem;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

#search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/*Expense List & Items*/
.expenses-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.expense-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.expense-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(0, 255, 255, 0.3);
}

.expense-details {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.expense-amount {
  font-size: 1.1rem;
  font-weight: 700;
  color: #00ffff;
  min-width: 100px;
}

.expense-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.expense-description {
  font-size: 0.9rem;
  font-weight: 500;
  color: #ffffff;
}

.expense-category {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.7);
  background-color: rgba(0, 255, 255, 0.2);
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  display: inline-block;
  width: fit-content;
}

.expense-date {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
}

.expenses-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.expenses-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  overflow-y: auto;
  padding-right: 0.5rem;
  margin-right: -0.5rem;
}

.expenses-count {
    text-align: center;
    margin-bottom: 0.8rem;
    padding: 0.6rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    flex-shrink: 0;
}


.expenses-list::-webkit-scrollbar {
  width: 6px;
}

.expenses-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.expenses-list::-webkit-scrollbar-thumb {
  background: #00ffff;
  border-radius: 3px;
}

.expense-item.fade-in {
  animation: fadeInUp 0.5s ease-out forwards;
}

.no-expenses {
  text-align: center;
  padding: 2rem 1rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1rem;
  font-style: italic;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.load-more-container {
  display: flex;
  justify-content: center;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.load-more-btn {
  background-color: rgba(255, 255, 255, 0.1);
  color: #00ffff;
  border: 2px solid #00ffff;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/*Expense Actions*/
.expense-actions {
  display: flex;
  gap: 0.4rem;
}

.edit-btn,
.delete-btn {
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

/*Edit Button */
.edit-btn {
  background-color: rgba(255, 255, 255, 0.1);
  color: #00ffff;
  border: 1px solid #00ffff;
}

.edit-btn:hover {
  background-color: rgba(0, 255, 255, 0.2);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

/* Delete Button */
.delete-btn {
  background-color: rgba(255, 0, 128, 0.1);
  color: #ff0080;
  border: 1px solid #ff0080;
}

.delete-btn:hover {
  background-color: rgba(255, 0, 128, 0.2);
  box-shadow: 0 0 10px rgba(255, 0, 128, 0.3);
}

/* Light Theme Styles */
body.light-theme {
  background-color: #f5f7fa;
  color: #1f2937;
}

body.light-theme .header h1 {
  color: #6366f1;
  text-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

body.light-theme .expense-form,
body.light-theme .expenses-section {
  background-color: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

body.light-theme .expense-form h3{
  color: #6366f1;
}

body.light-theme label {
  color: #6366f1;
}

body.light-theme input[type="number"],
body.light-theme input[type="text"],
body.light-theme input[type="date"],
body.light-theme select,
body.light-theme #filter-category,
body.light-theme #search-input {
  border: 2px solid rgba(99, 102, 241, 0.1);
  background-color: rgba(99, 102, 241, 0.05);
  color: #1f2937;
}

body.light-theme input:focus,
body.light-theme select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

body.light-theme button[type="submit"] {
  background-color: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  border: 2px solid #6366f1;
}

body.light-theme button[type="submit"]:hover {
  background-color: rgba(99, 102, 241, 0.2);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

body.light-theme .expenses-header {
  border-bottom: 2px solid rgba(99, 102, 241, 0.1);
}

body.light-theme .expenses-header h2 {
  color: #6366f1;
}

body.light-theme .total-display {
  background-color: rgba(255, 255, 255, 0.9);
  color: #6366f1;
  border: 2px solid #6366f1;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

body.light-theme .expense-item {
  background-color: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.1);
}

body.light-theme .expense-amount {
  color: #6366f1;
}


body.light-theme .expense-description {
  color: #1f2937;
}

body.light-theme .theme-btn {
  background-color: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  border: 2px solid #6366f1;
}

body.light-theme #search-input::placeholder {
  color: rgba(100, 116, 139, 0.7); 
}

body.light-theme .no-expenses {
  color: rgba(100, 116, 139, 0.7); /* Adjust the color as needed */
}

/* Responsive Design */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .header h1 {
    position: static;
    transform: none;
    font-size: 1.8rem;
  }

  .theme-toggle {
    margin-left: 0;
  }

  .container {
    height: calc(100vh - 120px);
    padding: 0 0.5rem 0.5rem;
  }

  .main-content {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 1rem;
  }

  .expense-form {
    height: auto;
    max-height: 40vh;
  }

  .expenses-section {
    height: auto;
    min-height: 60vh;
  }

  .expense-details {
    gap: 1rem;
  }

  .expense-amount {
    min-width: 80px;
    font-size: 1rem;
  }
}