
.envelope {
  position: relative;
  width: 550px; /* Increased from 350px */
  height: 380px; /* Increased from 220px */
  cursor: pointer;
  perspective: 1000px;
  transform-style: preserve-3d;
}

.envelopeBack {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: #f5f5f0;
  border-radius: 5px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.flap {
  position: absolute;
  background-color: #f0f0e8;
  transform-origin: top;
}

.flapTop {
  width: 100%;
  height: 140px;
  top: 0;
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  background-color: #e8e8e0;
  transform-origin: top;
  z-index: 1;
  transform: rotateX(180deg);
  z-index: 1;
}

.flapTopOpen {
  transform: rotateX(180deg);
  z-index: 1;
}

.flapLeft {
  width: 225px; 
  height: 140px;
  left: 0;
  bottom: 0;
  transform: scaleX(-1) rotate(180deg);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  transform-origin: left;
  z-index: 100;
  background-color: #f0f0e8;
}

.flapRight {
  width: 225px; /* Increased from 175px */
  height: 140px; /* Increased from 110px */
  right: 0;
  bottom: 0;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
  transform: scaleX(-1) rotate(180deg);
  transform-origin: right;
  z-index: 100;
  background-color: #f0f0e8;
}

.flapBottom {
  width: 100%;
  height: 140px; /* Increased from 110px */
  bottom: 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: bottom;
  z-index: 7;
  background-color: #f0f0e8;
}

.card {
  position: absolute;
  padding: 15px 15px 15px 15px;
  width: 90%;
  height: 100%; 
  top: 10%;
  left: 2.5%;
  background-color: #c8b6dc;
  border-radius: 3px;
  z-index: 20; /* Higher z-index to be above flaps */
  transform: translateY(-100px); /* Always in the "up" position */
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.cardContent {
  text-align: center;
  height: 80%;
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* This helps distribute content evenly */
}

.title {
  margin: 0;
  font-size: 2rem; /* Increased from 1.5rem */
  color: #333;
  font-weight: 600;
}

.subtitle {
  font-size: 1.1rem; /* Increased from 0.9rem */
  color: #555;
}

.details {
  flex: 1;
  display: flex;
  flex-direction: column;
  font-size: 1rem; /* Increased from 0.8rem */
}

.detailItem {
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon {
  font-size: 1.1rem; /* Increased from 0.9rem */
}

.description {
  font-size: 0.9rem; 
  color: #555;
  line-height: 1.5; 
  max-height: 80px; 
  overflow-y: auto; 
}

.actions {
  display: flex;
  justify-content: space-evenly;
}

.button {
  padding: 10px 18px; 
  border: none;
  border-radius: 5px;
  font-size: 0.9rem; 
  cursor: pointer;
  transition: background-color 0.2s;
  flex: 1;
}

.declineButton {
  background-color: #6c5b7b;
  color: white;
}

.declineButton:hover {
  background-color: #5d4d6d;
}

.acceptButton {
  background-color: #4a3b89;
  color: white;
}

.acceptButton:hover {
  background-color: #3b2c7a;
}

.loadingContainer {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  width: 100%;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #c8abd6;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}


@media (max-width: 720px) { /* Updated from 400px to match new envelope size */
  .envelope {
    width: 350px; /* Updated from 300px */
    height: 220px; /* Updated from 190px */
  }

  .title {
    font-size: 1.5rem; /* Updated from 1.3rem */
  }
  .description {
    font-size: 0.8rem;
  }
  .card{
    width: 85%;
  }
}