/* 모던 디자인 변수 호환 */
/* common-modern.css의 변수를 사용하여 다크모드 및 테마 호환성 확보 */

/* randbox.css */

/* Bootstrap container는 그대로 사용, 페이지별 스타일만 추가 */
.randbox-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.main-content {
  display: flex;
  width: 100%;
  gap: 30px;
  margin-top: 20px;
}

.left-panel {
  flex: 1;
  max-width: 400px;
}

.right-panel {
  flex: 1;
  max-width: 600px;
}

h1 {
  text-align: center;
  color: #333;
  margin-top: 20px;
  margin-bottom: 20px;
}

/* 기존 form 스타일 - 새로운 컨테이너 구조로 변경됨
form {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

label {
  font-size: 18px;
  margin-right: 10px;
}
*/

.row {
  display: table-row;
  background-color: #fff;
  height: 60px;
}

#items-list {
  margin: 20px auto;
  padding: 10px;
  background-color: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  width: 100%;
}

.table {
  display: table;
  width: 100%;
  border-collapse: collapse;
}

.row:nth-child(even) {
  background-color: #f9f9f9;
}

.item-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.cell {
  display: table-cell;
  padding: 8px;
  vertical-align: middle;
}

.cell:nth-child(2) {
  display: flex;
  justify-content: center;  /* 수평 가운데 정렬 */
  align-items: center;      /* 수직 가운데 정렬 */
  width: 60px;              /* 이미지 셀의 너비를 80px로 설정 */
  height: 60px;            /* 이미지 셀의 높이 설정 */
  padding: 5px;               /* 셀 내부의 패딩 제거 */
  margin: 0;                /* 셀 외부의 마진 제거 */
  box-sizing: border-box;   /* 패딩 포함한 박스 크기 계산 */
}

.cell:last-child {
  width: 100px;
  text-align: right;
}

#items-list .row:last-child .cell {
  border-bottom: none;
}

.item-checkbox {
  margin-left: 10px;
  margin-right: 10px;
}

/* 뽑기 버튼 스타일 */
.draw-container {
  margin-top: 20px;
  text-align: center;
}

.draw-btn {
  background-color: #4CAF50;
  color: white;
  padding: 15px 30px;
  font-size: 18px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s;
  width: 100%;
  max-width: 200px;
}

.draw-btn:hover {
  background-color: #45a049;
}

.draw-btn:active {
  transform: scale(0.98);
}

/* 설정 컨테이너 */
.settings-container {
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.settings-container h3 {
  text-align: center;
  margin-bottom: 15px;
  color: #333;
}

.settings-content {
  display: flex;
  justify-content: center;
}

.settings-content .form-control {
  max-width: 300px;
  width: 100%;
}

/* 뽑기 결과 컨테이너 */
.draw-result-container {
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.draw-result-container h3 {
  text-align: center;
  margin-bottom: 15px;
  color: #333;
}



/* 뽑기 결과 스타일 */
.draw-result {
  background-color: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.result-item img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.result-info {
  text-align: center;
}

.result-name {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
}

.result-probability {
  font-size: 14px;
  color: #666;
  background-color: #f0f0f0;
  padding: 5px 10px;
  border-radius: 15px;
}

/* 플레이스홀더 스타일 */
.result-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.placeholder-text {
  color: #888;
  font-size: 16px;
  text-align: center;
}

/* 오른쪽 패널 송편 컨테이너 */
.songpyeon-container {
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.songpyeon-container h3 {
  text-align: center;
  margin-bottom: 15px;
  color: #333;
}

.click-hint {
  font-size: 12px;
  color: #666;
  font-weight: normal;
}

/* 송편 슬롯 스타일 - 2x2 그리드 */
.songpyeon-slots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}

.songpyeon-slots .slot-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  min-height: 120px;
  justify-content: center;
}

.songpyeon-slots .slot-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.songpyeon-slots .slot-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 5px;
}

.songpyeon-slots .slot-image-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.songpyeon-slots .slot-image {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.songpyeon-slots .slot-info {
  text-align: center;
  margin-top: 5px;
}

.songpyeon-slots .slot-name {
  font-size: 12px;
  font-weight: bold;
}

.songpyeon-slots .slot-bonus {
  font-size: 11px;
  color: #4CAF50;
  font-weight: bold;
}

.songpyeon-info {
  text-align: center;
  padding: 10px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.songpyeon-info div {
  margin: 5px 0;
  font-weight: bold;
}

.songpyeon-info span {
  color: #4CAF50;
}

/* 확률 테이블 컨테이너 */
.probability-table-container {
  width: 100%;
  margin-top: 30px;
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.probability-table-container h3 {
  text-align: center;
  margin-bottom: 20px;
  color: #333;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
    gap: 20px;
  }
  
  .left-panel, .right-panel {
    max-width: none;
  }
  
  .songpyeon-slots {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .songpyeon-slots .slot-item {
    min-height: 80px;
    padding: 10px;
  }
  
  .songpyeon-slots .slot-image {
    width: 40px;
    height: 40px;
  }
  
  .result-item img {
    width: 100px;
    height: 100px;
  }
  
  .result-name {
    font-size: 16px;
  }
}

#footer {
  background-color: #333;
  color: #fff;
  text-align: center;
  padding: 10px 0;
  font-size: 16px;
  width: 100%;
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 1000;
}

.my-3 {
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.form-control {
  width: 350px;
  height: 50px;
  padding: 0px 10px;
  font-size: 14px;
  margin-bottom: 20px;
}

.info {
  text-align: center;
  padding: 10px;
  background-color: #ffffff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  border-radius: 5px;
}


.highlight {
  color: green;
  font-weight: bold;
}

.warning {
  color: red;
  font-weight: bold;
}

.selection-container {
  display: flex;
  flex-direction: column; /* 세로로 배치 */
  gap: 10px; /* 각 아이템 사이의 간격 */
  align-items: flex-start;
}

.boost-item {
  display: flex;
  flex-direction: column;
}

.boost-select {
  width: 200px;
  padding: 5px;
  margin-bottom: 10px;
}

#box-type {
  width: 200px; /* 상자 종류 선택의 너비 설정 */
  margin-bottom: 20px; /* 상자 종류와 부스트 아이템 간 간격 설정 */
}

/* 송편 관련 스타일 */
.songpyeon-container {
  width: 100%;
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.songpyeon-container h3 {
  text-align: center;
  margin-bottom: 20px;
  color: #333;
  font-size: 18px;
}

.songpyeon-slots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

.slot-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.slot-label {
  font-weight: bold;
  margin-bottom: 8px;
  color: #555;
  font-size: 14px;
}

.slot-image-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  border: 3px solid #ddd;
  border-radius: 8px;
  background-color: white;
  transition: all 0.3s ease;
  min-height: 120px;
  width: 100px;
}

.slot-image-container:hover {
  border-color: #007bff;
  box-shadow: 0 4px 8px rgba(0,123,255,0.3);
  transform: translateY(-2px);
}

.slot-image {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin-bottom: 8px;
}

.slot-info {
  text-align: center;
}

.slot-name {
  font-size: 12px;
  color: #333;
  font-weight: bold;
  margin-bottom: 4px;
}

.slot-bonus {
  font-size: 12px;
  color: #28a745;
  font-weight: bold;
}

.songpyeon-info {
  display: flex;
  justify-content: center;
  gap: 30px;
  padding: 15px;
  background-color: white;
  border-radius: 6px;
  border: 1px solid #ddd;
}

.songpyeon-info div {
  font-weight: bold;
  color: #333;
}

.songpyeon-info span {
  color: #28a745;
}

/* 모달 스타일 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 0;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #ddd;
  background-color: #f8f9fa;
  border-radius: 8px 8px 0 0;
}

.modal-header h4 {
  margin: 0;
  color: #333;
}

.close {
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #aaa;
}

.close:hover {
  color: #000;
}

.modal-body {
  padding: 20px;
}

.songpyeon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.songpyeon-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background-color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.songpyeon-option:hover {
  border-color: #007bff;
  box-shadow: 0 4px 8px rgba(0,123,255,0.3);
  transform: translateY(-2px);
}

.songpyeon-option img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 10px;
}

.songpyeon-details {
  text-align: center;
}

.songpyeon-name {
  font-size: 14px;
  color: #333;
  font-weight: bold;
  margin-bottom: 4px;
}

.songpyeon-bonus {
  font-size: 14px;
  color: #28a745;
  font-weight: bold;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .songpyeon-slots {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .songpyeon-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .slot-image-container {
    width: 80px;
    min-height: 100px;
  }
  
  .slot-image {
    width: 50px;
    height: 50px;
  }
}
