/* ================================
   Crops Calculator
   Crop profit table and related styles
   ================================ */

#cropCalcCards { margin-top: 16px; }

.crop-table-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    position: relative;
}
.crop-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.crop-table th,
.crop-table td {
    padding: 7px 6px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.crop-table th {
    background: rgba(214,203,184,0.3);
    color: var(--muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: sticky;
    top: 0;
    z-index: 10;
}
/* Tier row tints */
.crop-table tbody tr.tier-basic {
    background: rgba(194,178,128,0.05);
}
.crop-table tbody tr.tier-medium {
    background: rgba(158,138,114,0.10);
}
.crop-table tbody tr.tier-advanced {
    background: rgba(120,100,80,0.16);
}
/* Striping within tiers */
.crop-table tbody tr.tier-basic:nth-child(even) {
    background: rgba(194,178,128,0.11);
}
.crop-table tbody tr.tier-medium:nth-child(even) {
    background: rgba(158,138,114,0.17);
}
.crop-table tbody tr.tier-advanced:nth-child(even) {
    background: rgba(120,100,80,0.23);
}
/* Hover */
.crop-table tbody tr:hover {
    background: rgba(214,203,184,0.2);
}
.crop-name-cell {
    text-align: left;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}
.crop-row-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    image-rendering: pixelated;
    vertical-align: middle;
    margin-right: 4px;
}
.crop-seed-cell {
    font-family: monospace;
    color: var(--text);
}
.crop-seed-cell.modified { color: var(--info); }
.crop-seed-sfl {
    font-size: 0.8em;
    opacity: 0.6;
}
.crop-time-cell {
    color: var(--text);
}
.crop-time-cell.modified { color: var(--info); }
.crop-yield-cell {
    color: var(--green);
    font-family: monospace;
}
.crop-yield-cell.boosted {
    color: var(--warning);
    font-weight: 600;
}
.crop-sell-cell {
    font-family: monospace;
    color: var(--text);
}
.crop-sell-cell.modified { color: var(--info); }
.crop-profit-cell {
    font-family: monospace;
    font-weight: 600;
}
.crop-profithr-cell {
    font-family: monospace;
    font-weight: 600;
}
.crop-profit-cell .positive,
.crop-profithr-cell .positive { color: var(--positive); }
.crop-profit-cell .negative,
.crop-profithr-cell .negative { color: var(--negative); }

.crop-best-row {
    background: rgba(74,124,63,0.05) !important;
    border-left: 3px solid var(--green);
}
.crop-best-row .crop-profithr-cell {
    font-weight: 700;
}

.crop-patch-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: var(--muted);
    margin-left: 8px;
}
.crop-patch-input {
    width: 42px;
    padding: 2px 4px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 0.7rem;
    text-align: center;
}
.crop-patch-input:focus {
    outline: none;
    border-color: var(--info);
}
.crop-total-cell {
    font-family: monospace;
    font-weight: 700;
}
.crop-total-cell .positive { color: var(--positive); }
.crop-total-cell .negative { color: var(--negative); }
.crop-total-header {
    color: var(--info) !important;
}

.crop-th-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-right: 2px;
}
.crop-table .global-tooltip-trigger { cursor: help; }

/* ── AOE Yield Indicator ── */
.crop-aoe-yield {
    font-size: 0.75em;
    opacity: 0.6;
    font-weight: 400;
    cursor: help;
}

/* ── Inline Tier Labels ── */
.crop-tier-label {
    font-size: 0.6rem;
    font-weight: 600;
    margin-left: 4px;
    vertical-align: middle;
    padding: 1px 3px;
    border-radius: 3px;
    letter-spacing: 0.3px;
}
.tier-label-basic {
    color: #8b7d5e;
    background: rgba(194,178,128,0.2);
}
.tier-label-medium {
    color: #7a6b56;
    background: rgba(158,138,114,0.2);
}
.tier-label-advanced {
    color: #6b5a45;
    background: rgba(120,100,80,0.25);
}

/* ── Season Icons (inline per crop) ── */
.crop-season-icons {
    display: inline;
    margin-left: 3px;
    vertical-align: middle;
}
.crop-season-icon {
    width: 12px;
    height: 12px;
    object-fit: contain;
    image-rendering: pixelated;
    vertical-align: middle;
    margin-left: 1px;
}

/* ── Controls Row (season filter + plots) ── */
.crop-controls-row {
    display: flex;
    align-items: center;
    margin-left: auto;
}

/* ── Season Filter ── */
.crop-season-filter {
    display: flex;
    align-items: center;
    gap: 2px;
}
.crop-season-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--muted);
    font-size: 0.65rem;
    padding: 2px 5px;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.crop-season-btn:hover {
    border-color: var(--info);
    color: var(--text);
}
.crop-season-btn.active {
    background: var(--info);
    color: var(--bg);
    border-color: var(--info);
    font-weight: 600;
}
.crop-season-btn-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
    image-rendering: pixelated;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .crop-table { font-size: 0.75rem; }
    .crop-table th,
    .crop-table td { padding: 5px 3px; }
}
