@import "tailwindcss";

/* モバイルのみ表示（768px 以上で非表示） */
@media (min-width: 768px) {
  .mobile-only {
    display: none !important;
  }
  .mobile-only-flex {
    display: none !important;
  }
  .desktop-only {
    display: block !important;
  }
}

@media (max-width: 767px) {
  .desktop-only {
    display: none !important;
  }
}

.mobile-only-flex {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* FullCalendar カスタムスタイル */
.farmer-calendar.fc {
  font-size: 0.8125rem;
  --fc-border-color: #e2e8f0;
  --fc-page-bg-color: #ffffff;
  --fc-neutral-bg-color: #f8fafc;
  --fc-today-bg-color: transparent;
  --fc-button-text-color: #475569;
  --fc-button-bg-color: #ffffff;
  --fc-button-border-color: #e2e8f0;
  --fc-button-hover-bg-color: #f8fafc;
  --fc-button-hover-border-color: #cbd5f5;
  --fc-button-active-bg-color: #2563eb;
  --fc-button-active-border-color: #2563eb;
}

.farmer-calendar.fc .fc-button.fc-button-active,
.farmer-calendar.fc .fc-button[aria-pressed="true"] {
  background-color: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.2);
}

.farmer-calendar.fc .fc-button.fc-button-active:hover,
.farmer-calendar.fc .fc-button[aria-pressed="true"]:hover {
  background-color: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
  color: #ffffff !important;
}

.farmer-calendar .farmer-calendar-day-today {
  background-color: transparent !important;
}

.farmer-calendar.fc .fc-toolbar.fc-header-toolbar {
  margin-bottom: 1rem;
}

.farmer-calendar.fc .fc-toolbar-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.02em;
}

.farmer-calendar.fc .fc-button {
  background-color: #ffffff;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  text-transform: none;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.375rem 0.75rem;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.04);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.farmer-calendar.fc .fc-button:hover:not(:disabled) {
  background-color: #f8fafc;
  color: #0f172a;
  border-color: #cbd5f5;
}

.farmer-calendar.fc .fc-button:focus,
.farmer-calendar.fc .fc-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.farmer-calendar.fc .fc-button-group {
  gap: 0;
}

.farmer-calendar.fc .fc-button-group > .fc-button {
  border-radius: 0;
  margin-left: -1px;
}

.farmer-calendar.fc .fc-button-group > .fc-button:first-child {
  border-top-left-radius: 0.5rem;
  border-bottom-left-radius: 0.5rem;
  margin-left: 0;
}

.farmer-calendar.fc .fc-button-group > .fc-button:last-child {
  border-top-right-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
}

.farmer-calendar.fc .fc-button-group > .fc-button {
  background-color: #ffffff;
  color: #475569;
  border-color: #e2e8f0;
}

.farmer-calendar.fc .fc-button-group > .fc-button:hover:not(:disabled) {
  background-color: #f8fafc;
  color: #0f172a;
}

.farmer-calendar.fc .fc-button-primary:not(:disabled).fc-button-active,
.farmer-calendar.fc .fc-button-group > .fc-button-primary:not(:disabled).fc-button-active,
.farmer-calendar.fc .fc-button-primary:not(:disabled):active {
  background-color: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.18);
}

.farmer-calendar.fc .fc-prev-button,
.farmer-calendar.fc .fc-next-button,
.farmer-calendar.fc .fc-today-button,
.farmer-calendar.fc .fc-openSettings-button {
  background-color: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: #475569 !important;
}

.farmer-calendar.fc .fc-prev-button:hover:not(:disabled),
.farmer-calendar.fc .fc-next-button:hover:not(:disabled),
.farmer-calendar.fc .fc-today-button:hover:not(:disabled),
.farmer-calendar.fc .fc-openSettings-button:hover:not(:disabled) {
  background-color: #f1f5f9 !important;
  border-color: transparent !important;
  color: #0f172a !important;
}

.farmer-calendar.fc .fc-today-button:disabled {
  opacity: 0.4;
}

.farmer-calendar.fc .fc-prev-button,
.farmer-calendar.fc .fc-next-button {
  padding: 0.375rem 0.5rem;
}

.farmer-calendar.fc .fc-openSettings-button {
  padding: 0.375rem 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

.farmer-calendar.fc .fc-openSettings-button:hover:not(:disabled) {
  color: #475569;
}

.farmer-calendar.fc .fc-icon {
  font-size: 0.95rem;
}

.farmer-calendar.fc .fc-col-header-cell {
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.5rem 0;
  font-weight: 600;
  font-size: 0.75rem;
  color: #64748b;
  letter-spacing: 0.04em;
}

.farmer-calendar.fc .fc-col-header-cell.fc-day-sat .fc-col-header-cell-cushion {
  color: #2563eb;
}

.farmer-calendar.fc .fc-col-header-cell.fc-day-sun .fc-col-header-cell-cushion,
.farmer-calendar.fc .fc-col-header-cell.fc-day-holiday .fc-col-header-cell-cushion {
  color: #dc2626;
}

.farmer-calendar.fc .fc-col-header-cell-cushion {
  padding: 0.25rem 0;
  text-decoration: none;
}

.farmer-calendar.fc .fc-daygrid-day-frame {
  padding: 0.25rem;
  min-height: 5.25rem;
}

.farmer-calendar.fc .fc-daygrid-day-top {
  flex-direction: row;
  justify-content: flex-start;
}

.farmer-calendar.fc .fc-daygrid-day-number {
  padding: 0;
  text-decoration: none;
  color: #334155;
  font-weight: 500;
}

.farmer-calendar__day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.25rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  line-height: 1;
}

.farmer-calendar.fc .fc-day-other .fc-daygrid-day-number {
  color: #cbd5f5;
}

.farmer-calendar.fc .fc-day-sat:not(.fc-day-other) .farmer-calendar__day-number {
  color: #2563eb;
}

.farmer-calendar.fc .fc-day-sun:not(.fc-day-other) .farmer-calendar__day-number,
.farmer-calendar.fc .fc-day-holiday:not(.fc-day-other) .farmer-calendar__day-number {
  color: #dc2626;
}

.farmer-calendar .farmer-calendar-day-sat {
  background-color: #f1f5f9;
}

.farmer-calendar .farmer-calendar-day-sun,
.farmer-calendar .farmer-calendar-day-holiday {
  background-color: #fef2f2;
}

.farmer-calendar.fc .fc-col-header-cell.farmer-calendar-day-sat .fc-col-header-cell-cushion {
  color: #2563eb;
}

.farmer-calendar.fc .fc-col-header-cell.farmer-calendar-day-sun .fc-col-header-cell-cushion,
.farmer-calendar.fc .fc-col-header-cell.farmer-calendar-day-holiday .fc-col-header-cell-cushion {
  color: #dc2626;
}

.farmer-calendar .farmer-calendar-day-sat .farmer-calendar__day-number {
  color: #2563eb;
}

.farmer-calendar .farmer-calendar-day-sun .farmer-calendar__day-number,
.farmer-calendar .farmer-calendar-day-holiday .farmer-calendar__day-number {
  color: #dc2626;
}

.farmer-calendar .farmer-calendar-day-today .farmer-calendar__day-number {
  background-color: #2563eb;
  color: #ffffff !important;
  font-weight: 700;
}

.farmer-calendar.fc-col-header-cell.farmer-calendar-day-today .fc-col-header-cell-cushion {
  color: #2563eb;
  font-weight: 700;
}

.farmer-calendar.fc .fc-daygrid-day:hover {
  background-color: rgba(241, 245, 249, 0.5);
}

.farmer-calendar.fc .fc-event {
  cursor: pointer;
  border: none;
  background-color: #2563eb;
  border-radius: 0.375rem;
  padding: 0.0625rem 0.375rem;
  font-size: 0.75rem;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.08);
}

.farmer-calendar.fc .fc-event:hover {
  filter: brightness(0.95);
}

.farmer-calendar.fc .fc-daygrid-event-dot {
  border-color: #2563eb;
}

.farmer-calendar.fc .fc-scrollgrid {
  border-radius: 0.5rem;
  overflow: hidden;
  border-color: #e2e8f0;
}

.farmer-calendar.fc .fc-scrollgrid-section > * {
  border-color: #e2e8f0;
}

@media (max-width: 640px) {
  .farmer-calendar.fc {
    font-size: 0.75rem;
  }
  .farmer-calendar.fc .fc-toolbar.fc-header-toolbar {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: space-between;
  }
  .farmer-calendar.fc .fc-toolbar-chunk {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  .farmer-calendar.fc .fc-toolbar-title {
    font-size: 1rem;
  }
  .farmer-calendar.fc .fc-daygrid-day-frame {
    min-height: 3.5rem;
  }
  .farmer-calendar__day-number {
    min-width: 1.25rem;
    height: 1.25rem;
    font-size: 0.75rem;
  }
}

@layer components {
  /* 播種データテーブルのコンテナ */
  .seeding-table-container {
    width: 100% !important;
    display: block !important;
  }

  /* 播種データテーブルのヘッダー固定 */
  .seeding-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100% !important;
  }

  .seeding-table thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    background-color: #f9fafb;
  }

  .seeding-table thead tr:nth-child(2) th {
    top: 33px;
  }
}
