/* 추가 스타일 */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.gifticon-card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gifticon-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.gifticon-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

/* 만료 임박 카드 - 빨간색 글로우 */
.gifticon-card.expiring-soon {
  animation: red-glow 2s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
}

@keyframes red-glow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
  }
  50% {
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.8);
  }
}

/* D-day 배지 */
.dday-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: bold;
}

.dday-badge.urgent {
  background: rgba(239, 68, 68, 0.9);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* 사용일자 배지 */
.used-date-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
}

/* 이미지 모달 크기 제한 - 버튼 항상 보이도록 */
#imageModal .max-w-4xl {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

#imageModal img {
  max-height: 70vh;
  object-fit: contain;
  flex-shrink: 0;
}

#usedImageModal .max-w-4xl {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

#usedImageModal img {
  max-height: 60vh;
  object-fit: contain;
  flex-shrink: 0;
}

/* 업로드 로딩 애니메이션 */
.loader {
  width: 60px;
  aspect-ratio: 1;
  background: linear-gradient(#dc1818 0 0) bottom/100% 0% no-repeat #ccc;
  -webkit-mask: 
    radial-gradient(circle at 60% 65%, #000 62%, #0000 65%) top left, 
    radial-gradient(circle at 40% 65%, #000 62%, #0000 65%) top right, 
    linear-gradient(to bottom left, #000 42%,#0000 43%) bottom left, 
    linear-gradient(to bottom right,#000 42%,#0000 43%) bottom right;
  -webkit-mask-size: 50% 50%;
  -webkit-mask-repeat: no-repeat;
  mask: 
    radial-gradient(circle at 60% 65%, #000 62%, #0000 65%) top left, 
    radial-gradient(circle at 40% 65%, #000 62%, #0000 65%) top right, 
    linear-gradient(to bottom left, #000 42%,#0000 43%) bottom left, 
    linear-gradient(to bottom right,#000 42%,#0000 43%) bottom right;
  mask-size: 50% 50%;
  mask-repeat: no-repeat;
  animation: l19 2s infinite linear;
}

@keyframes l19 {
  90%, 100% {
    background-size: 100% 100%;
  }
}

/* 로딩 스피너 (기존) */
.spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3b82f6;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 모바일 버튼 최적화 - 한 줄 표시 */
@media (max-width: 640px) {
  #imageModal button,
  #usedImageModal button {
    padding: 0.5rem 0.5rem !important;
    font-size: 0.7rem !important;
    white-space: nowrap;
  }
  
  #imageModal .flex,
  #usedImageModal .flex {
    gap: 0.5rem;
  }
}

@media (max-width: 360px) {
  #imageModal button,
  #usedImageModal button {
    padding: 0.4rem 0.4rem !important;
    font-size: 0.65rem !important;
  }
  
  #imageModal .flex,
  #usedImageModal .flex {
    gap: 0.25rem;
  }
}
