* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Zen Maru Gothic", "M PLUS Rounded 1c", "Kosugi Maru",
    "Hiragino Maru Gothic ProN", "ヒラギノ丸ゴ ProN W4", sans-serif;
  background-color: #f5f0e8;
  color: #333;
  line-height: 1.8;
  padding-top: 80px;
}

/* パンくずリスト */
.breadcrumb {
  background-color: #f5f0e8;
  padding: 15px 30px;
  font-size: 13px;
  color: #666;
}

.breadcrumb a {
  color: #5a7a5a;
  text-decoration: none;
}

/* メインコンテンツ */
.main-content {
  display: flex;
  padding: 0px 30px 30px 0;
  gap: 50px;
  max-width: 1200px;
  margin: 0 auto;
}

.left-section {
  flex: 1;
}

.right-section {
  flex: 1;
}

/* セクションタイトル */
.section-title {
  font-size: 20px;
  font-weight: 700;
  color: #333;
  margin-bottom: 20px;
  border-bottom: 2px solid #5a7a5a;
  padding-bottom: 10px;
}

/* エントリーボックス */
.entry-box {
  border: 1px solid #ccc;
  border-radius: 12px;
  padding: 0 25px;
  margin-bottom: 20px;
  background-color: #f5f0e8;
}

.entry-content {
  flex: 1;
}

/* 捕獲情報 */
.info-block {
  margin-bottom: 30px;
  margin-top: 15px;
  border-top: 1px solid #ccc;
}

.info-block h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 15px;
}

.info-item {
  margin-bottom: 8px;
  font-size: 14px;
}

.info-label {
  font-weight: 700;
}

/* 検査詳細 */
.inspection-section {
  margin-top: 12px;
}

.inspection-section h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 15px;
  border-bottom: 1px solid #ccc;
  padding-bottom: 8px;
}

.result-negative {
  color: blue;
  font-weight: 700;
  font-size: 18px;
}

/* 加工所情報 */
.processor-info {
  background-color: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.processor-info h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #5a7a5a;
}

.processor-info p {
  margin-bottom: 10px;
  font-size: 14px;
}

.processor-info a {
  color: #5a7a5a;
  text-decoration: none;
}

.processor-info a:hover {
  text-decoration: underline;
}

.products-list {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #ddd;
}

/* 日付とシールの行 */
.dates-seal-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  margin-top: 0px;
  flex-wrap: nowrap;
  gap: 20px;
}

.dates-section {
  flex: 1;
}

/* 検査済みシール */
.seal-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.seal-label {
  font-size: 14px;
  color: #666;
}

/* 商品画像 */
.product-images {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.product-image {
  flex: 1;
  height: 150px;
  background-color: #ddd;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image-placeholder {
  background: linear-gradient(135deg, #e8d8c8 0%, #d0c0b0 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 12px;
}


/* レスポンシブ対応 */
@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
    padding: 0px 20px 20px 20px;
  }

  .breadcrumb {
    display: none;
  }

  .product-images {
    flex-direction: column;
  }

  .product-image {
    height: 200px;
  }

  /* Entry box mobile styles */
  .entry-box {
    padding: 15px;
  }

  .info-item {
    word-break: break-word;
  }

  .info-block h2 {
    font-size: 16px;
  }

  .dates-seal-row {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .seal-section img {
    width: 80px;
  }
}

/* ===== 日付選択ウィジェット ===== */
.date-widget-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 30px;
  display: flex;
  justify-content: center;
}

.date-widget {
  position: relative;
  display: inline-block;
}

/* Trigger Button */
.date-widget-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  background: linear-gradient(135deg, #ffffff 0%, #faf8f5 100%);
  border: 2px solid #5a7a5a;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(90, 122, 90, 0.1);
}

.date-widget-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(90, 122, 90, 0.2);
  border-color: #4a6a4a;
}

.date-widget-trigger.active {
  background: linear-gradient(135deg, #5a7a5a 0%, #6a8a6a 100%);
  border-color: #5a7a5a;
}

.date-widget-trigger.active .trigger-icon,
.date-widget-trigger.active .trigger-label,
.date-widget-trigger.active .trigger-date,
.date-widget-trigger.active .trigger-arrow {
  color: white;
}

.date-widget-trigger.loading {
  opacity: 0.7;
  pointer-events: none;
}

.trigger-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #5a7a5a 0%, #7a9a7a 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.3s ease;
}

.date-widget-trigger.active .trigger-icon {
  background: rgba(255, 255, 255, 0.2);
}

.trigger-icon svg {
  width: 20px;
  height: 20px;
}

.trigger-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.trigger-label {
  font-size: 11px;
  color: #888;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
}

.trigger-date {
  font-size: 16px;
  font-weight: 700;
  color: #333;
  transition: color 0.3s ease;
}

.trigger-arrow {
  margin-left: 8px;
  color: #5a7a5a;
  transition: all 0.3s ease;
}

.trigger-arrow svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.date-widget-trigger.active .trigger-arrow svg {
  transform: rotate(180deg);
}

/* Calendar Dropdown */
.date-calendar-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-10px) scale(0.95);
  width: 320px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15),
    0 10px 20px rgba(90, 122, 90, 0.1);
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  border: 1px solid rgba(90, 122, 90, 0.1);
}

.date-calendar-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
}

.calendar-header {
  text-align: center;
  margin-bottom: 15px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee;
}

.calendar-hint {
  font-size: 12px;
  color: #888;
  background: #f8f5f0;
  padding: 6px 12px;
  border-radius: 20px;
  display: inline-block;
}

/* 月ナビゲーション */
.date-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5a7a5a;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background: #5a7a5a;
  color: white;
  border-color: #5a7a5a;
}

.nav-btn:active {
  transform: scale(0.95);
}

.nav-btn svg {
  width: 16px;
  height: 16px;
}

.current-month {
  font-size: 15px;
  font-weight: 700;
  color: #333;
}

/* カレンダーグリッド */
.calendar-grid {
  margin-bottom: 0;
}

.weekday-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.weekday {
  text-align: center;
  font-weight: 600;
  font-size: 11px;
  color: #999;
  padding: 6px 0;
}

.weekday.sunday {
  color: #e74c3c;
}

.weekday.saturday {
  color: #3498db;
}

.days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.day-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: lightgray;
  position: relative;
  transition: all 0.2s ease;
  animation: fadeInScale 0.3s ease-out forwards;
  opacity: 0;
  overflow: hidden;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.day-cell.empty {
  background: transparent;
  animation: none;
  opacity: 1;
}

.day-cell.sunday .day-number {
  color: #e74c3c;
}

.day-cell.saturday .day-number {
  color: #3498db;
}

.day-number {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  z-index: 2;
}

/* 検査データがある日付 */
.day-cell.has-data {
  background: linear-gradient(135deg, #ffe4e1 0%, #ffd4cc 100%);
  cursor: pointer;
  border: 1px solid transparent;
  justify-content: flex-start;
  padding-top: 1px;
  gap: 0;
}

.day-cell.has-data .day-number {
  font-size: 10px;
  line-height: 1;
  margin-bottom: -2px;
}

.day-cell.has-data:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 20px rgba(255, 150, 150, 0.5);
  border-color: #ffaaaa;
  z-index: 10;
}

.day-cell.has-data:active {
  transform: scale(0.95);
}

.pig-indicator {
  font-size: 24px;
  animation: pigBounce 2s ease-in-out infinite;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
  line-height: 1;
}

@keyframes pigBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

/* 選択された日付 */
.day-cell.selected {
  background: linear-gradient(135deg, #5a7a5a 0%, #7a9a7a 100%);
  box-shadow: 0 4px 12px rgba(90, 122, 90, 0.4);
}

.day-cell.selected .day-number {
  color: white !important;
  font-weight: 700;
}

.day-cell.selected .pig-indicator {
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
}

.day-cell.selected::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 10px;
  border: 2px solid #5a7a5a;
  animation: selectedPulse 2s ease-in-out infinite;
}

@keyframes selectedPulse {
  0%,
  100% {
    opacity: 0.8;
  }
  50% {
    opacity: 0.4;
  }
}

/* メインコンテンツローディングアニメーション */
.main-content.loading {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.main-content {
  transition: opacity 0.3s ease;
}

/* レスポンシブ対応 - 日付ウィジェット */
@media (max-width: 768px) {
  .date-widget-section {
    padding: 15px 15px;
  }

  .date-widget-trigger {
    padding: 10px 14px;
    gap: 10px;
  }

  .trigger-icon {
    width: 32px;
    height: 32px;
  }

  .trigger-icon svg {
    width: 16px;
    height: 16px;
  }

  .trigger-label {
    font-size: 10px;
  }

  .trigger-date {
    font-size: 14px;
  }

  .date-calendar-dropdown {
    width: 290px;
    padding: 15px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px) scale(0.95);
  }

  .date-calendar-dropdown.open {
    transform: translateX(-50%) translateY(0) scale(1);
  }

  .calendar-hint {
    font-size: 11px;
    padding: 5px 10px;
  }

  .nav-btn {
    width: 28px;
    height: 28px;
  }

  .nav-btn svg {
    width: 14px;
    height: 14px;
  }

  .current-month {
    font-size: 14px;
  }

  .weekday {
    font-size: 10px;
    padding: 4px 0;
  }

  .days-grid {
    gap: 3px;
  }

  .day-cell {
    border-radius: 6px;
  }

  .day-number {
    font-size: 12px;
  }

  .day-cell.has-data .day-number {
    font-size: 9px;
    margin-bottom: -2px;
  }

  .pig-indicator {
    font-size: 21px;
  }
}
