/*
 * KayakFish Conditions v10.1 — Table styles only.
 * Hero is 100% inline. This file only handles the hourly table
 * and footer (too verbose to inline) + the spin keyframe.
 */

@keyframes kfc-spin {
	from { transform: rotate(0deg); }
	to   { transform: rotate(360deg); }
}

/* Table container */
.kfc-tbl-outer {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: #ddd transparent;
}
.kfc-tbl-outer::-webkit-scrollbar { height: 4px; }
.kfc-tbl-outer::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.kfc-tbl-inner {
	width: 100%;
	border-collapse: collapse;
	min-width: 560px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
	font-size: 13px;
}

/* Header */
.kfc-th {
	background: #f8fafc;
	border-bottom: 2px solid #e2e8f0;
	color: #9ca3af;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .07em;
	padding: 7px 10px;
	text-align: left;
	text-transform: uppercase;
	white-space: nowrap;
}
.kfc-em {
	font-style: normal;
	font-weight: 400;
	font-size: 9px;
	letter-spacing: 0;
	text-transform: none;
	margin-left: 2px;
	color: #b0bec5;
}

/* Rows */
.kfc-tr:hover .kfc-td { background: #f8fafc; }
.kfc-past { opacity: .38; }

.kfc-td {
	border-bottom: 1px solid #f1f5f9;
	padding: 9px 10px;
	vertical-align: middle;
	white-space: nowrap;
	color: #111827;
}
.kfc-tbl-inner tbody tr:last-child .kfc-td { border-bottom: none; }

/* Values */
.kfc-tv { font-size: 13px; font-weight: 600; color: #111827; }
.kfc-bv { font-size: 14px; font-weight: 700; color: #111827; }
.kfc-u  { font-size: 9px; color: #9ca3af; margin-left: 1px; font-weight: 500; }
.kfc-cm { font-size: 10px; color: #9ca3af; font-weight: 600; margin-left: 2px; }
.kfc-sky { text-align: center; font-size: 18px; }

/* Score colors */
.kfc-score--good    .kfc-bv { color: #16a34a !important; }
.kfc-score--caution .kfc-bv { color: #d97706 !important; }
.kfc-score--bad     .kfc-bv { color: #dc2626 !important; }
.kfc-score--good              { color: #16a34a !important; }
.kfc-score--caution           { color: #d97706 !important; }
.kfc-score--bad               { color: #dc2626 !important; }
.kfc-red .kfc-bv              { color: #dc2626 !important; font-weight: 700 !important; }
.kfc-red                      { color: #dc2626 !important; }

/* Footer */
.kfc-foot-outer {
	background: #f8fafc;
	border-top: 1px solid #e2e8f0;
}
.kfc-legend-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 5px 14px;
	padding: 8px 18px;
	font-size: 11px;
	color: #4b5563;
	border-bottom: 1px solid #f1f5f9;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}
.kfc-leg-item { display: inline-flex; align-items: center; gap: 5px; }
.kfc-leg-sep  { display: inline-block; width: 1px; height: 12px; background: #e2e8f0; vertical-align: middle; }
.kfc-credits-bar {
	display: flex;
	justify-content: space-between;
	padding: 6px 18px;
	font-size: 11px;
	color: #9ca3af;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}
.kfc-link { color: #0ea5e9; text-decoration: none; }
.kfc-link:hover { text-decoration: underline; }

/* Mobile */
@media (max-width: 540px) {
	.kfc-cm { display: none; }
}

/* ══ Mobile improvements ══════════════════════════════════════════════════ */

/* Sticky first column (Time) when scrolling horizontally */
.kfc-tbl-outer {
	position: relative;
}
.kfc-tbl-inner .kfc-th:first-child,
.kfc-tbl-inner .kfc-td:first-child {
	position: sticky;
	left: 0;
	z-index: 2;
	background: #fff;
	box-shadow: 2px 0 4px rgba(0,0,0,.06);
}
.kfc-tbl-inner thead .kfc-th:first-child {
	background: #f8fafc;
	z-index: 3;
}
/* Ensure hover doesn't break sticky */
.kfc-tr:hover .kfc-td:first-child {
	background: #f8fafc !important;
}

/* Mobile card layout: stack cards vertically, make them full-width */
@media (max-width: 600px) {

	/* Hero cards: 2-column grid on mobile instead of single col */
	.kfc-widget table[style*="table-layout:fixed"] > tbody > tr {
		display: grid !important;
		grid-template-columns: 1fr 1fr !important;
	}
	.kfc-widget table[style*="table-layout:fixed"] > tbody > tr > td {
		display: block !important;
		width: auto !important;
		border-right: none !important;
		border-bottom: 1px solid #e2e8f0 !important;
		padding: 14px !important;
	}
	/* Tide + Sun&Moon: full width */
	.kfc-widget table[style*="table-layout:fixed"] > tbody > tr > td:nth-child(3),
	.kfc-widget table[style*="table-layout:fixed"] > tbody > tr > td:nth-child(4) {
		grid-column: span 1;
	}

	/* Reduce font sizes in hero for mobile */
	.kfc-widget [style*="font-size:26px"] {
		font-size: 20px !important;
	}

	/* Table: make time column narrower on mobile */
	.kfc-tbl-inner .kfc-th:first-child,
	.kfc-tbl-inner .kfc-td:first-child {
		min-width: 72px;
		padding: 9px 6px !important;
	}
	.kfc-tval { font-size: 11px !important; }
	.kfc-bv   { font-size: 12px !important; }
	.kfc-th   { font-size: 9px !important; padding: 6px 6px !important; }
	.kfc-td   { padding: 8px 6px !important; }

	/* Hide compass direction text on very small screens (arrows still show) */
	.kfc-cm { display: none; }

	/* Day tabs: smaller on mobile */
	.kfc-widget [class*="kfc-day-btn"],
	.kfc-widget .kfc-day-btn {
		min-width: 52px !important;
		padding: 8px 6px 6px !important;
	}
}

@media (max-width: 380px) {
	/* Single column cards on very small phones */
	.kfc-widget table[style*="table-layout:fixed"] > tbody > tr {
		grid-template-columns: 1fr !important;
	}
}

/* ── Location selector: pills on desktop, dropdown on mobile ── */
@media (max-width: 520px) {
	.kfc-loc-pills  { display: none !important; }
	.kfc-loc-select { display: block !important; }
}
@media (min-width: 521px) {
	.kfc-loc-pills  { display: flex !important; }
	.kfc-loc-select { display: none !important; }
}
