.pocket-money-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
  padding: 2vw;
  font-family: "Comic Sans MS", "Comic Neue", "Arial Rounded MT Bold", "Arial",
    sans-serif;
  /* font-family: "Helvetica", "Arial", sans-serif; */
}

.investment-title {
  font-size: clamp(2.5rem, 6vw, 6rem);
  color: #fff;
  text-shadow: 4px 4px 0 #ff6f61, 8px 8px 0 #ffd700;
  margin: 0;
  padding: 0;
  text-align: center;
}

.value-display {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-size: clamp(3rem, 15vw, 10rem);
  font-weight: bold;
  color: #fff;
  background: linear-gradient(90deg, #43cea2 0%, #185a9d 100%);
  border-radius: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  padding: 2rem 6vw;
  margin-top: 2rem;
  border: 8px solid #fff;
  line-height: 1;
  flex-wrap: wrap;
  min-width: 300px;
}

.currency-symbol {
  font-size: 0.4em;
  margin-left: 0.2em;
  align-self: flex-end;
  padding-bottom: 0.2em;
}

.investment-history {
  margin-top: 100px;
  display: none;
}

summary {
  cursor: pointer;
  font-weight: bold;
  margin-bottom: 10px;
  outline: none;
  color: #4682b4; /* SteelBlue */
  font-size: 1.2em;
  list-style: none; /* Remove default marker */
  position: relative;
  padding-left: 1.5em;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "▶";
  position: absolute;
  left: 0;
  transition: transform 0.3s ease;
}

details[open] > summary::before {
  transform: rotate(90deg);
}

details .investment-table {
  overflow: hidden;
  transition: max-height 0.5s ease-in-out, opacity 0.3s ease-in-out 0.1s;
  max-height: 0;
  opacity: 0;
}

details[open] .investment-table {
  max-height: 80vh; /* Use viewport height for responsive max height */
  opacity: 1;
  overflow-y: auto; /* Allow vertical scrolling */
  padding-right: 10px;
}

.investment-table {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 2fr;
  gap: 10px;
  width: 100%;
}

.investment-table::-webkit-scrollbar {
  width: 10px;
}

.investment-table::-webkit-scrollbar-track {
  background: #f0e68c;
  border-radius: 10px;
}

.investment-table::-webkit-scrollbar-thumb {
  background-color: #4682b4;
  border-radius: 10px;
  border: 2px solid #f0e68c;
}

.investment-row {
  display: contents;
}

.investment-row span {
  padding: 10px;
  border-bottom: 2px solid #add8e6; /* LightBlue */
  text-align: left;
}

.investment-row.header {
  display: contents; /* Keep header visible on desktop */
}

.investment-row.header span {
  font-weight: bold;
  background-color: #f0e68c; /* Khaki */
  color: #333;
}

/* Mobile-friendly styles */
@media (max-width: 600px) {
  .investment-table {
    display: block;
  }

  .investment-row.header {
    display: none; /* Hide header on mobile */
  }

  .investment-row {
    display: block;
    border: 2px solid #4682b4; /* SteelBlue */
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
    background-color: #ffed85;
  }

  .investment-row span {
    display: block;
    text-align: right;
    border-bottom: 0;
    padding: 5px;
  }

  .investment-row span::before {
    content: attr(data-label);
    float: left;
    font-weight: bold;
    color: #333;
    padding-right: 10px;
  }
}

.diff-positive {
  color: #2e7d32;
}

.diff-negative {
  color: #c62828;
}

form {
  max-width: 500px;
  margin: 0 auto;
  padding: 20px;
  background-color: #525478;
  border-radius: 5px;
}

.field {
  margin-bottom: 10px;
}

label {
  display: block;
  margin-bottom: 5px;
  color: #a7d7c5;
}

input[type="text"],
textarea {
  width: 100%;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background-color: #835e86;
  color: #fff;
  box-sizing: border-box;
  font-size: 1.2em;
}

.actions input[type="submit"] {
  background-color: #a7d7c5;
  color: #3d3d3d;
  margin-top: 10px;
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
  width: 100%;
}

.actions input[type="submit"]:hover {
  background-color: #89b8a9;
}

.link a {
  color: #3e6456;
  text-decoration: none;
  font-size: 1.2em;
}

.center {
  text-align: center;
}

#spinner {
  display: none;
}

.custom-spinner {
  display: inline-block;
  width: 45px;
  height: 45px;
  border: 3px solid #ccc;
  border-top: 3px solid #333;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  vertical-align: middle;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Web Push Notification Controls */
.web-push-controls {
  margin: 40px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  max-width: 500px;
  width: 100%;
}

.web-push-controls h3 {
  color: #fff;
  text-shadow: 2px 2px 0 #ff6f61;
  margin-bottom: 15px;
  font-size: 1.5rem;
}

.notification-status {
  margin-bottom: 20px;
}

.notification-status span {
  color: #fff;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px 15px;
  border-radius: 10px;
  display: inline-block;
}

.notification-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.notification-buttons button {
  background: linear-gradient(135deg, #43cea2 0%, #185a9d 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  min-width: 200px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.notification-buttons button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.notification-buttons button:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

.notification-buttons button#unsubscribe-btn {
  background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
}

.notification-buttons button#test-notification-btn {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #333;
}

/* Mobile responsive */
@media (max-width: 600px) {
  .web-push-controls {
    margin-top: 30px;
    padding: 15px;
  }

  .notification-buttons button {
    min-width: 180px;
    font-size: 0.9rem;
  }
}

/* Settings Button */
.settings-container {
  position: absolute;
  top: 30px;
  right: 30px;
  z-index: 1000;
  opacity: 0.5;
}

.settings-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  /* background: linear-gradient(135deg, #cfd3dc 0%, #777f89 100%); */
  color: white;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 25px;
  font-weight: bold;
  font-size: 1rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.5s ease;
  backdrop-filter: blur(10px);
  font-family: inherit;
}

.settings-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  /* background: linear-gradient(135deg, #a1a6b2 0%, #818897 100%); */
  text-decoration: none;
  color: white;
}

.settings-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.settings-icon {
  font-size: 1.2em;
  animation: rotate-gentle 3s infinite ease-in-out;
}

.settings-text {
  white-space: nowrap;
}

@keyframes rotate-gentle {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(10deg);
  }
}

/* Mobile responsive for settings button */
@media (max-width: 600px) {
  .settings-container {
    top: 20px;
    right: 20px;
  }

  .settings-button {
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  .settings-text {
    display: none;
  }

  .settings-icon {
    font-size: 1.4em;
  }
}

/* Tablet responsive */
@media (max-width: 768px) {
  .settings-button .settings-text {
    font-size: 0.9rem;
  }
}
