/* File: ui-cards.css
   Description: Card layout/styles for offer and giveaway cards. Button visuals live in buttons.css.
*/

.offer-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
}

.offer-card {
  position: relative;
  flex: 1 1 calc(33.33% - 16px);
  max-width: calc(33.33% - 16px);
  height: 400px;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background-color: #f1f1f1;
  border: 1px solid #ddd;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  overflow: hidden;
}

.offer-card-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s;
}

.offer-card-front,
.offer-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 16px;
  box-sizing: border-box;
}

.offer-card-front {
  background-color: #fff;
  z-index: 2;
}

.offer-card-back {
  background-color: #fff;
  transform: rotateY(180deg);
  z-index: 1;
}

.offer-card.flipped .offer-card-inner {
  transform: rotateY(180deg);
}

.offer-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.confirmation-message {
  color: red;
  font-weight: bold;
  line-height: 1.3;
}

.offer-card h3,
.offer-card p,
.offer-card button {
  margin: 12px 0;
  font-size: 1em;
  text-align: center;
}

/* Layout only - no button visuals here */
.offer-card button,
.optin-button,
.giveaway-view-details {
  display: block;
  width: 100%;
}

.offer-card-back h3 {
  margin-bottom: 16px;
  text-align: center;
}

.offer-card-back .giveaway-details,
.offer-card-back p {
  text-align: left;
  margin-bottom: 16px;
  line-height: 1.6;
  font-size: 14px;
}

.offer-card-back p strong {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
}

.close-card {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 50%;
  font-size: 16px;
  font-weight: bold;
  color: #000;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s, color 0.3s;
}

.close-card:hover {
  background: #f0f0f0;
  color: #333;
}