/* 날짜 입력 필드 */
input[type="date"] {
  box-sizing: border-box;
  height: 30px;
  border-width: 1px;
  border-style: solid;
  padding: 0 10px;
  max-width: 100%;
  font-size: 12px;
  line-height: 1.2;
  color: #333;
  background: #fdf7ec !important;
  border-color: #e9a53f;
  border-radius: 5px;
}

input[type="number"],
input[type="text"],
select {
  box-sizing: border-box;
  height: 30px;
  border-width: 1px;
  border-style: solid;
  padding: 0 10px;
  font-size: 12px;
  line-height: 1.2;
  color: #333;
  background: #fdf7ec;
  border-color: #e9a53f;
  border-radius: 5px;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  border-color: #f27d69;
}

input[type="file"] {
  height: auto !important;
}

input[readonly] {
  opacity: 0.6;
  background-color: #f8f4e4;
}

.board-category {
  margin-bottom: 50px !important;
}
/**
* 파일 업로드
*/
#stampImage {
  display: none;
}

.custom-file-label {
  display: inline-block;
  padding: 10px 20px;
  background-color: #f27d69;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-size: 14px;
}

.custom-file-label:hover {
  background-color: #ff5451;
}
.file-name {
  margin-right: 5px;
  font-size: 14px;
  color: #555;
}
/**
* 버튼
*/
.btn_confirm {
  text-align: center;
  display: flex;
  gap: 5px;
}
.btn_confirm button,
.btn_confirm a {
  padding: 6px 15px;
  border: 0px;
  line-height: normal !important;
}
.btn_confirm button:hover,
.btn_confirm a:hover {
  background-color: #ff5451;
}

/* 버튼 스타일 */
.btn_confirm {
  text-align: center;
  margin-top: 20px;
}

.btn_submit,
.btn_cancel {
  padding: 10px 20px;
  font-size: 14px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn_submit {
  background-color: #f27d69;
  color: #fff;
}

.btn_submit:hover {
  background-color: #ff5451;
}

.btn_cancel {
  background-color: #ddd;
  color: #555;
}

.btn_cancel:hover {
  background-color: #bbb;
}

#stamp_list img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 2px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

#stamp_list img.selected {
  border-color: #f3b962;
  transform: scale(1.1);
}

#stamp_list p {
  font-size: 12px;
  color: #333;
}

/** 글쓰기 */
/* 테이블 스타일 */
table.calendar-form {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

table.calendar-form th,
table.calendar-form td {
  padding: 10px;
  border-bottom: 1px solid #e9a53f;
  text-align: left;
  vertical-align: middle;
}

table.calendar-form th {
  background-color: #e9a53f;
  color: #fff;
  font-weight: bold;
  width: 150px;
}

table.calendar-form tr:first-child th,
table.calendar-form tr:first-child td {
  border-top: 1px solid #e9a53f;
}

/**
* 스탬프 캘린더
*/
/* 헤더 스타일 */
.calendar-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
  gap: 10px;
  flex-direction: column;
}
.calendar-header h1 {
  font-size: 50px;
  color: #333;
  margin: 0;
}
.calendar-header p {
  font-size: 20px;
  color: #999;
}
/* 캘린더 컨테이너 */
.calendar {
  width: 100%;
  max-width: 1000px;
  margin: 20px auto;
  border-collapse: collapse;
}

.calendar table {
  background-color: rgba(255, 255, 255, 0.7);
  border: 1px solid #f3b962;
}
/* 테이블 헤더 스타일 */
.calendar thead {
  color: #333;
}

.calendar thead th {
  padding: 10px;
  text-align: center;
  font-weight: bold;
}

/* 날짜 셀 기본 스타일 */
.calendar td {
  width: 14.28%; /* 7열 기준으로 균등 분할 */
  height: 150px !important;
  vertical-align: top;
  text-align: center;
  padding: 5px;
  border-top: 1px dashed #f3b962;
  border-right: 1px dashed #f3b962;
  position: relative;
  transition: background-color 0.3s ease;
  color: #333;
}

/* 마지막 셀 오른쪽 테두리 제거 */
.calendar td:last-child {
  border-right: none;
}

.calendar td.today {
  background-color: rgba(247, 235, 217, 0.8);
  border: 2px solid #f27d69;
}

/* 날짜 숫자 스타일 */
.calendar .date {
  font-weight: bold;
  font-size: 16px;
  color: #555;
}

/**
* 이벤트 이미지 묶음
*/
.stamp-wrapper {
  position: relative;
}

/* 이벤트 이미지 기본 스타일 */
.event-image {
  width: 100px;
  height: 100px;
  object-fit: cover;
  cursor: pointer;
  margin: 10px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0.3;
}

.event-image[data-clicked="true"] {
  opacity: 1;
  filter: none;
}
/* 도장 클릭 시 애니메이션 */
.event-image:hover {
  transform: scale(1.1) rotate(40deg);
}

.no-reward {
  width: 90px;
  height: 90px;
}

/* 보상 텍스트 */
.reward {
  color: #fff !important;
  font-weight: normal;
}

.reward .reward-amount {
  font-size: 14px;
  position: absolute;
  bottom: 0px;
  left: 0%;
  font-weight: bold;
}

.reward-box {
  width: 100%;
  background-color: rgba(233, 165, 63, 0.6);
  display: flex;
  gap: 2px;
  justify-content: center;
  pointer-events: none;
  position: absolute;
  bottom: 0;
}

/* 빈 셀 스타일 */
.calendar td.empty {
  background-color: #f9f9f9;
  border: none;
}

/* 주말 스타일 */
.calendar th:nth-child(1),
.calendar th:nth-child(7) {
  color: #f27d69; /* 빨간색 */
  font-weight: bold;
}
.calendar td:nth-child(1), /* 일요일 */
.calendar td:nth-child(7) /* 토요일 */ {
  color: #f27d69; /* 빨간색 */
  font-weight: bold;
}

/* 모바일 반응형 */
@media (max-width: 1200px) {
  .event-image {
    height: auto;
  }
  .reward-box {
    gap: 1px;
    flex-direction: column;
  }
}
@media (max-width: 600px) {
  .calendar td {
    height: 80px !important;
    font-size: 12px;
    padding: 3px;
    box-sizing: border-box;
  }

  .calendar .date {
    font-size: 12px;
  }
  .event-image {
    max-width: 100%;
    height: auto;
  }
  .reward .reward-amount {
    font-size: 9px;
  }
  .reward-box span {
    font-size: 10px;
  }
  .no-reward {
    width: 50px;
    height: 50px;
  }
  .reward {
    font-size: 10px;
  }
}

/**
* 스탬프 캘린더 관리자
*/
.calendar-controls {
  text-align: center;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.calendar-controls form {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.calendar-controls label {
  font-size: 14px;
  color: #333;
}
.calendar-controls select,
.calendar-controls button {
  padding: 5px 10px;
  font-size: 14px;
}
.calendar-controls button {
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.calendar-controls a {
  margin: 0 10px;
  height: 28px !important;
  text-decoration: none;
  color: #d9534f;
  border-radius: 4px;
  padding: 5px 10px !important;
  line-height: 18px !important;
}
.admin_box {
  display: flex;
  gap: 3px;
}

.btn-sub-reward {
  flex: 1;
  margin: 5px auto;
  padding: 2px !important;
  height: auto !important;
  line-height: 1 !important;
  box-sizing: border-box;
  font-size: 12px;
  background-color: #f3b962;
  color: #fff;
  text-align: center;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.3s ease;
}
.btn-sub-reward:hover {
  background-color: #e9a53f;
}
.admin_box label {
  flex: 1;
  padding: 5px;
  font-size: 14px;
  color: #333;
}
/* 미디어 쿼리 */
@media (max-width: 728px) {
  .calendar-controls form {
    gap: 3px;
  }
  .calendar-controls a {
    margin: 0 5px;
  }
  .calendar-controls a,
  .calendar-controls select,
  .calendar-controls button {
    font-size: 11px;
  }
}

/**
* 팝업 스타일
*/
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup-content {
  background: #fff;
  padding: 20px;
  width: 85vw;
  max-width: 358px;
  max-height: 60%;
  overflow-y: auto;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.popup-content h2,
.popup-content p {
  margin-bottom: 20px;
  color: #333;
}
.popup-content h3 {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #ccc;
  color: #333;
}

.popup-content label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
}

.popup-content input,
.popup-content select {
  width: 100%;
  margin-bottom: 15px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.btn-popup,
.btn-submit,
.btn-close {
  background: #f3b962;
  color: #fff;
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn-popup:hover,
.btn-submit:hover,
.btn-close:hover {
  background: #e9a53f;
}
.stamp-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-height: 300px;
  margin-top: 10px;
  overflow-y: auto;
  /*스크롤바*/
  scrollbar-width: none;
}

.stamp-list img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 1px solid #ddd;
  border-radius: 5px;
}

.stamp-item {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  flex-direction: column;
  gap: 3px;
}

.stamp-image {
  width: 100px;
  height: auto;
  border: 1px solid #ddd;
  border-radius: 5px;
}

.delete-btn {
  background-color: #f27d69;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 5px 10px !important;
  height: auto !important;
  cursor: pointer;
}

.delete-btn:hover {
  background-color: #ff5451;
}

/**
* 스탬프 선택
*/
.selectable-stamp {
  cursor: pointer;
  border: 3px solid transparent;
  margin: 5px;
  width: 60px;
  height: 60px;
  box-sizing: border-box;
}

.selectable-stamp.selected {
  border-color: #f3b962;
}

/* 모바일 반응형 */
@media (max-width: 600px) {
  .btn-sub-reward {
    border-radius: 0;
  }
  .btn-popup {
    font-size: 12px !important;
  }
}

/* 세팅 모달 */
.settings-item {
  margin-bottom: 10px;
}
.settings-item th,
.settings-item td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
  color: #333;
  text-align: left;
  position: relative;
}

/* 슬라이드 체크박스 */
.switch {
  position: relative;
  width: 50px;
  height: 24px;
  left: 0;
  margin-bottom: 0 !important;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0%;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #e9a53f;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* 아바타 */
.avatar-wrap {
  position: fixed;
  bottom: 0;
  right: calc((100vw - 1000px) / 8);
  transform: translateY(60%);
  z-index: 999;
  max-width: 250px;
}
.avatar-wrap:hover {
  transform: translateY(25%);
}

.avatar-wrap:hover .avatar-speech {
  opacity: 1;
}
.avatar-img {
  width: 100%;
  object-fit: cover;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.3s ease;
  filter: drop-shadow(-4px -2px 1px rgba(0, 0, 0, 0.5));
}
.avatar-speech {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, 0);
  background: rgba(0, 0, 0, 0.5);
  min-width: 250px;
  min-height: 80px;
  color: #fff;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  opacity: 0;
  transition: all 0.3s ease-in-out;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}
/* 말풍선 모양 꼬리 */
.avatar-speech::before {
  content: "";
  position: absolute;
  bottom: 0;
  right: 20px;
  transform: translateY(100%);
  border: 10px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.5);
}

.avatar-wrap:hover .avatar-speech {
  opacity: 1;
  transform: translate(-50%, -100%);
}

.avatar-wrap .no-avatar {
  width: 100%;
  height: 250px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.3s ease;
  background-color: #000;
  color: #fff;
  padding: 20px;
  margin-top: 20px;
  box-sizing: border-box;
}

/* 아바타 애니메이션 효과 */
@keyframes avatarJump {
  0% {
    transform: translateY(60%);
  }
  25% {
    transform: translateY(25%);
  }
  75% {
    transform: translateY(25%);
  }
  100% {
    transform: translateY(60%);
  }
}

/* 아바타 반응형 */
@media (max-width: 1200px) {
  .avatar-wrap {
    left: 50%;
    transform: translate(-50%, 80%);
  }
  .avatar-wrap:hover {
    transform: translate(-50%, 25%);
  }

  @keyframes avatarJump {
    0% {
      transform: translate(-50%, 80%);
    }
    20% {
      transform: translate(-50%, 25%);
    }

    80% {
      transform: translate(-50%, 25%);
    }
    100% {
      transform: translate(-50%, 80%);
    }
  }
}

@media (max-width: 900px) {
  .avatar-wrap {
    max-width: 150px;
  }
}
@keyframes opacityChange {
  0% {
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0.5;
  }
}

.avatar-wrap.jumped {
  animation: avatarJump 2s ease-in-out;
}
.avatar-speech.jumped {
  animation: opacityChange 2s ease-in-out;
  transform: translate(-50%, -100%);
}

/*****************************************
* 아바타 설정
*****************************************/
/* 아바타 설정 섹션 스타일 */
#avatarSettings {
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-top: 20px;
}

#avatarSettings h3 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: #333;
}

/* 아바타 이미지 업로드 */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.form-group input[type="file"] {
  padding: 8px;
  border-radius: 4px;
  width: 100%;
  margin-bottom: 10px !important;
}

#avatarPreview {
  margin-top: 10px;
}

#avatarPreview img {
  max-width: 100px;
  max-height: 100px;
  margin-top: 10px;
}
.previewBox {
  margin-bottom: 10px;
}
/* 현재 아바타 보기 */
#currentAvatarWrapper {
  margin-top: 30px;
  text-align: center;
}

#currentAvatarWrapper img {
  max-width: 150px;
  max-height: 150px;
  border-radius: 50%;
  margin-bottom: 10px;
}

#currentAvatarWrapper p {
  font-size: 1rem;
  color: #555;
}

#deleteAvatar {
  background-color: #e74c3c;
  color: white;
  padding: 10px 20px;
  font-size: 1rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
  margin-top: 10px;
}

#deleteAvatar:hover {
  background-color: #c0392b;
}

#deleteAvatar:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}


/*메인화면용 불러오기용 설정*/
@media (max-width: 300px) {
.calendar {
  margin: 0;
}
.calendar-header {
  display: none;
}
.calendar thead tr {
  display: none;
}
.calendar tbody td {
  height: 40px !important;
}
.calendar .date {
  display: none;
}
.calendar-controls {
  display: none;
}
.ui-btn {
  display: none !important;
}
.event-image {
  margin: 0;
}
}