@import "tailwindcss";

/* Your custom styles can go here or in separate files */

@font-face {
  font-family: "Lexend";
  src: url("../fonts/Lexend/Lexend-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  max-width: 1280px;
  margin: 0 auto!important;
  padding: 0 1rem;
  line-height: 1.5;
}
h1, h2, h3, h4, h5, h6 { margin-top: 0; font-family: "Lexend", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
label:not([class]) { display: block; margin-top: 1rem; font-weight: 600; }
input:not([class]), select:not([class]), button:not([class]) {
  margin-top: 0.4rem;
  padding: 0.4rem 0.6rem;
  font-size: 0.95rem;
}
select[multiple] {
  width: 100%;
  min-height: 8rem;
}

.crop-chips-container {
  margin-top: 0.5rem;
}

ul.ks-cboxtags {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul.ks-cboxtags li {
  display: inline-block;
  margin: 3px 4px;
}

@media (max-width: 640px) {
  ul.ks-cboxtags li {
    display: inline-block;
    margin: -16px 7px 7px 0;
  }
}

ul.ks-cboxtags li label {
  display: inline-block;
  background-color: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(139, 139, 139, 0.3);
  color: #adadad;
  border-radius: 25px;
  white-space: nowrap;
  padding: 6px 12px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
  position: relative;
  padding-left: 30px;
}

ul.ks-cboxtags li input[type="checkbox"] {
  position: absolute;
  opacity: 0;
}

.chip-fade-in {
  opacity: 0;
  animation: chipFadeIn 0.35s ease forwards;
}
@keyframes chipFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

ul.ks-cboxtags li label::before {
  content: "\f067";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 12px;
  display: inline-block;
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.3s ease-in-out;
}

ul.ks-cboxtags li input[type="checkbox"]:checked + label {
  border: 2px solid #f08a24;
  background-color: #f08a24;
  color: #fff;
  transition: all 0.2s;
}

ul.ks-cboxtags li input[type="checkbox"]:checked + label::before {
  content: "\f00c";
  transform: translateY(-50%) rotate(-360deg);
}

/* Load more link styling */
.chip-toggle-wrap {
  text-align: center;
  margin-top: 8px;
}
.chip-toggle-link {
  background: none;
  border: none;
  color: #1d4ed8;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  text-decoration: underline;
}
.chip-toggle-link:hover {
  color: #153e9f;
}
.chip-toggle-link:focus-visible {
  outline: 2px solid #1d4ed8;
  outline-offset: 2px;
}

@media (max-width: 640px) {
  #results {
    display: flex !important;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 12px;
    padding: 0 12px 10px;
    margin: 0 -12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  #results .result-item {
    min-width: 260px;
    max-width: 320px;
    flex: 0 0 auto;
    scroll-snap-align: start;
  }
}

button:not([class]) {
  margin-top: 1.2rem;
  cursor: pointer;
}
.actions-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}
.actions-row button { margin-top: 0; }
.btn-reset:not([class*="bg-"]) {
  background: #f3f3f3;
  border: 1px solid #d0d0d0;
  color: #333;
}
.btn-reset:not([class*="bg-"]):hover {
  background: #e8e8e8;
}
#results {
  margin-top: 0.5rem;
}
.result-item {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
}
.result-cover {
  width: 100%;
  height: 160px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
}
.climate-stat-icon {
  width: 16px;
  display: inline-block;
  text-align: center;
  margin-right: 6px;
  color: #0f1a2b;
}
.note {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.25rem;
}
:root {
  --calendar-purple: #4b3ad1;
  --calendar-pink: #e8458b;
  --calendar-green: #2bbf6a;
  --calendar-orange: #f08a24;
  --calendar-ink: #0f1a2b;
}
.calendar-card {
  background: white;
  padding: 1.5rem;
  border-radius: 26px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.14);
  color: #fff;
  overflow: hidden;
  border: 0px solid rgba(255,255,255,0.28);
  position: relative;
  margin-bottom: 50px;
}
.calendar-card #crop-calendar {
  background: #ffffff;
  border-radius: 16px;
  padding: 0.75rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}
.calendar-card .fc-toolbar {
  color: #0f1a2b;
  margin-bottom: 0.75rem;
}
.calendar-card .fc th,
.calendar-card .fc td,
.calendar-card .fc {
  color: #0f1a2b;
}
.weeks-view-card {
  background: transparent;
  color: var(--calendar-ink);
  gap: 0.35rem;
  display: flex;
  flex-direction: column;
}
.calendar-shell {
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  color: inherit;
}
.calendar-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: space-between;
  color: #292929;
  margin-bottom: 0.3rem;
}
.calendar-title {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0.2px;
}
.calendar-subtitle {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.9;
}
#calendar {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: rgba(255,255,255,0.16);
  border-radius: 14px;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 10px 26px rgba(0,0,0,0.14);
}
.calendar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-ghost {
  margin-top: 0;
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(15,26,43,0.15);
  background: #ffffff;
  color: var(--calendar-ink);
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
  cursor: pointer;
}
.btn-ghost:hover { background: #f6f7fb; }
.calendar-body {
  margin-top: 0.6rem;
  background: linear-gradient(135deg, #f6c77b 0%, #e57ca2 45%, #7a78f2 100%);
  padding: 0.6rem;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28);
}
.calendar-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0rem;
  font-size: 0.9rem;
  background: none;
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(15,26,43,0.12);
  min-width: 960px;
  table-layout: fixed;
}
.calendar-table th,
.calendar-table td {
  padding: 0.6rem 0.4rem;
  text-align: center;
  vertical-align: middle;
  color: var(--calendar-ink);
  border: 1px solid rgba(0,0,0,0.04);
}
.calendar-table th {
  background: #f8f8fb;
  font-weight: 700;
  letter-spacing: 0.3px;
  position: sticky;
  top: 0;
  z-index: 1;
}
.calendar-table td {
  background: linear-gradient(180deg, #ffffff 0%, #fdfcfe 100%);
}
.calendar-table tr:nth-child(even) td { background: linear-gradient(180deg, #fbfbff 0%, #f7f7fd 100%); }
.calendar-table .crop-col {
  text-align: left;
  background: #f3f5ff;
  font-weight: 700;
  width: 160px;
  position: sticky;
  left: 0;
  z-index: 2;
  box-shadow: 4px 0 12px rgba(0,0,0,0.04);
}
.cell-pill {
  display: inline-block;
  padding: 2px 3px;
  border-radius: 9999px;
  font-size: 11px;
  margin: 1px;
  white-space: nowrap;
  font-weight: 700;
  color: #fff;
  border: 0px solid rgba(0,0,0,0.08);
  box-shadow: 0 6px 14px rgba(0,0,0,0.14);
}
.cell-sow-indoor { background: #6c5ce7; color: #fff; }
.cell-sow-outdoor { background: #ff4f8b; color: #fff; }
.cell-plant-out { background: #2ecc71; color: #fff; }
.cell-harvest { background: #f39c12; color: #fff; }
.fc-event.sow-indoor-event { background-color: #6c5ce7; border-color: #6c5ce7; color: #fff; }
.fc-event.sow-outdoor-event { background-color: #ff4f8b; border-color: #ff4f8b; color: #fff; }
.fc-event.plant-out-event { background-color: #2ecc71; border-color: #2ecc71; color: #fff; }
.fc-event.harvest-event { background-color: #f39c12; border-color: #f39c12; color: #fff; }
.fc-prev-button .fa::before { content: "\2039"; font-family: inherit; font-weight: 700; }
.fc-next-button .fa::before { content: "\203A"; font-family: inherit; font-weight: 700; }
.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
  margin: 0 0 0.65rem 0;
  font-size: 0.95rem;
  color: #f1f3f9;
  font-weight: 600;
  background: rgba(12, 17, 33, 0.7);
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 12px 28px rgba(0,0,0,0.22);
  backdrop-filter: blur(10px);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.legend-swatch {
  width: 52px;
  height: 12px;
  border-radius: 6px;
  display: inline-block;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}
.legend-label {
  font-weight: 800;
  letter-spacing: 0.1px;
}
.legend-sow-indoor { background: #6c5ce7; }
.legend-sow-outdoor { background: #ff4f8b; }
.legend-plant-out { background: #2ecc71; }
.legend-harvest { background: #f39c12; }
.calendar-section { margin-top: 0.8rem; }
.calendar-subheading {
  margin: 0.4rem 0 0.2rem;
  font-size: 1rem;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.weeks-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.weeks-view-header .calendar-subheading {
  margin: 0;
}
.calendar-scroll {
  overflow-x: auto;
  padding-bottom: 0.4rem;
}
.calendar-scroll::-webkit-scrollbar {
  height: 10px;
}
.calendar-scroll::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
}
.calendar-scroll::-webkit-scrollbar-thumb {
  background: rgba(15,26,43,0.25);
  border-radius: 12px;
}
.calendar-scroll-wrapper {
  position: relative;
  overflow-x: auto;      /* scrolling container for sticky first column */
  overflow-y: hidden;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.25) rgba(255,255,255,0.25);
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(15,26,43,0.12);
  border: 1px solid rgba(0,0,0,0.04);
}
.calendar-scroll-wrapper::-webkit-scrollbar {
  height: 4px;
}
.calendar-scroll-wrapper::-webkit-scrollbar-track {
  background: transparent;
}
.calendar-scroll-wrapper::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.18);
  border-radius: 999px;
}
.calendar-scroll-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.26);
}
.calendar-weeks-table {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  table-layout: fixed;
}
.calendar-weeks-table th,
.calendar-weeks-table td {
  width: 28px;
  padding: 2px 0;
  text-align: center;
  font-size: 11px;
}
.calendar-weeks-table td.week-cell {
  vertical-align: top;
  padding-top: 3px;
}
.calendar-weeks-table .crop-col {
  width: 120px;
  text-align: left;
  padding-left: 8px;
  /* Sticky first column: stays fixed while horizontal scrolling */
  position: sticky;
  left: 0;
  z-index: 40;
  background: #f3f5ff;
  box-shadow: 6px 0 12px rgba(0,0,0,0.08);
}
.calendar-weeks-table thead .crop-col {
  z-index: 50;
}
.calendar-weeks-table thead .week-head {
  position: sticky;
  top: 0;
  z-index: 45;
  background: #f8f8fb;
}
.timeline-print-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}
.print-btn {
  background: #4f46e5;
  color: #fff;
  font-weight: 700;
  padding: 0.5rem 0.9rem;
  border: none;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.16);
  cursor: pointer;
}
.print-btn:hover {
  background: #4338ca;
}
.legend-item-right {
  margin-left: auto;
}
/* print CTA hidden in print handled below */
.calendar-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.1rem 0;
}
.view-toggle {
  display: inline-flex;
  gap: 0.4rem;
}
.view-btn.active {
  background: #0f1a2b;
  color: #fff;
  border-color: #0f1a2b;
}
.calendar-controls label {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  color: #fff;
  background: rgba(255,255,255,0.14);
  padding: 0.25rem 0.45rem;
  border-radius: 10px;
}
.calendar-controls select,
.calendar-controls input {
  padding: 0.3rem 0.5rem;
  font-size: 0.9rem;
  border-radius: 6px;
  border: 1px solid rgba(15,26,43,0.08);
  background: rgba(255,255,255,0.9);
  color: var(--calendar-ink);
  min-height: 32px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.08);
}
.calendar-controls button {
  margin-top: 0;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  border: none;
  background: #fff;
  color: #0f1a2b;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(0,0,0,0.14);
}
.force-rounded-lg {
  border-radius: 0.5rem !important;
}
.force-rounded-full {
  border-radius: 10px !important;
}
.calendar-header .print-hidden {
  background: #fff;
  color: var(--calendar-ink);
  border: none;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(0,0,0,0.16);
  margin-top: 0;
}

pre {
  padding: 0.75rem;
  background: #f6f8fa;
  border: 1px solid #e1e1e1;
  border-radius: 6px;
  font-size: 0.9rem;
  max-width: 100%;
  overflow-x: auto;
}
#crops option.selected-option {
  background: #d8eaff;
  color: #0b3d91;
}
.print-hidden { }
@media print {
  @page {
    size: A3 landscape;
    margin: 20px;
  }

  /* Preserve colors in print */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Show only the week-based annual timeline */
  body * {
    visibility: hidden !important;
  }
  .calendar-card,
  #calendar,
  .calendar-section,
  .calendar-section *,
  .calendar-legend,
  .calendar-legend * {
    visibility: visible !important;
  }
  body > :not(.calendar-card) {
    display: none !important;
  }
  .calendar-card > :not(#calendar):not(.calendar-legend) {
    display: none !important;
  }
  #calendar > :not(.calendar-section) {
    display: none !important;
  }
  .calendar-card {
    position: static !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Hide non-print UI */
  .print-hidden,
  .calendar-toolbar,
  .calendar-controls,
  .crop-chips-container,
  .print-btn,
  .timeline-print-bar {
    display: none !important;
  }

  html, body {
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    background: #fff !important;
  }

  /* Flatten the card/wrappers for print */
  .calendar-card,
  .calendar-body,
  .calendar-section {
    box-shadow: none !important;
    border: none !important;
    background: #fff !important;
    border-radius: 0 !important;
    page-break-inside: avoid !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .calendar-legend {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding: 0 0 6px 0 !important;
    margin: 0 0 6px 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    border: none !important;
    color: #000 !important;
  }
  .calendar-legend .legend-label,
  .calendar-legend .legend-item {
    color: #000 !important;
  }

  /* Make the scroll container fully visible in print */
  .calendar-scroll-wrapper {
    overflow: visible !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    background: #fff !important;
    page-break-inside: avoid !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Ensure the week table renders at full width with simple styling */
  .calendar-weeks-table {
    min-width: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    table-layout: fixed;
    border-collapse: collapse !important;
    background: #fff !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
  }
  .calendar-weeks-table th,
  .calendar-weeks-table td {
    width: auto !important;
    padding: 1px 2px !important;
    font-size: 8px !important;
    color: #000 !important;
    background: #fff !important;
    box-shadow: none !important;
    border: 1px solid #e5e7eb !important;
  }

  /* Disable sticky in print to avoid disappearing content */
  .calendar-table th,
  .calendar-weeks-table .crop-col,
  .calendar-weeks-table thead .week-head {
    position: static !important;
    left: auto !important;
    top: auto !important;
    z-index: 1 !important;
    box-shadow: none !important;
  }
}
.frost-graph { margin-top: 1rem; margin-bottom: 2rem;}
.frost-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
}
.frost-card {
  background: linear-gradient(135deg, #f4bc6b 0%, #eb8b6b 100%);
  color: #fff;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.12);
}
.frost-card h4 { margin: 0 0 0.35rem 0; font-size: 1rem; }
.frost-date { font-weight: 700; margin-bottom: 0.4rem; }
.frost-bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.35);
  overflow: hidden;
}
.frost-marker {
  position: absolute;
  top: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid rgba(0,0,0,0.1);
  box-shadow: 0 6px 14px rgba(0,0,0,0.18);
  transform: translateX(-50%);
}
.frost-bar.-last { background: linear-gradient(90deg, #ffef9d, #ffbc7a); }
.frost-bar.-first { background: linear-gradient(90deg, #8fd6ff, #d4e7ff); }




button.mt-3.inline-flex.items-center.gap-x-2.rounded-full.border.border-gray-300.bg-white.px-4.py-2.text-sm.font-medium.text-gray-700.shadow-sm.hover\:bg-gray-50.focus\:outline-none.focus\:ring-2.focus\:ring-indigo-500.focus\:ring-offset-2 {
    border-radius: 8px;
}
