/* Base styles */
body {
    background-color: #FDFBF7;
    color: #333333;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    font-size: clamp(1rem, 2vw + 1rem, 1.25rem);
}

h1, h2, h3 {
    margin: 0;
    padding: 0.5em 0;
}

h1 {
    font-size: clamp(2rem, 4vw + 1rem, 3rem);
}

h2 {
    font-size: clamp(1.5rem, 3vw + 1rem, 2rem);
}

h3 {
    font-size: clamp(1.25rem, 2.5vw + 1rem, 1.75rem);
}

/* Hide data-zh by default */
[data-zh]::after {
    display: none;
}

/* Input styles */
input[type="text"],
input[type="number"],
input[type="email"] {
    width: 100%;
    padding: 1em;
    margin: 0.5em 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: clamp(1rem, 2vw + 0.5rem, 1.25rem);
    min-height: 48px;
}

/* Zip code input styling */
.climate-input-group {
    margin: 2em 0;
}

.zip-input-wrapper {
    display: flex;
    gap: 1em;
    margin: 1em 0;
    flex-direction: column;
}

.zip-input-wrapper input {
    flex: 1;
    min-width: 0;
}

.btn-verify {
    background-color: #7A8B69;
    color: white;
    padding: 1em;
    border: none;
    border-radius: 4px;
    font-size: clamp(1rem, 2vw + 0.5rem, 1.25rem);
    cursor: pointer;
    min-height: 48px;
    width: 100%;
    transition: all 0.3s ease;
}

.btn-verify:hover:not(:disabled) {
    background-color: #6A7B59;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(122, 139, 105, 0.2);
}

.btn-verify:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.error-message {
    color: #8B0000; /* Use a soft dark red for error messages */
    font-size: 0.9em;
    margin-top: 0.5em;
    min-height: 1.2em;
}

/* Climate Analysis Section */
.climate-analysis {
    margin-top: 2em;
    transition: all 0.5s ease;
    opacity: 1;
}

.climate-analysis.hidden {
    display: none;
    opacity: 0;
}

.analysis-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2em;
    gap: 1em;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #7A8B69;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.analysis-content {
    animation: slideIn 0.6s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Zone Info Card */
.zone-info-card {
    background: linear-gradient(135deg, #E8F5E8 0%, #F0F8F0 100%);
    border: 2px solid #7A8B69;
    border-radius: 8px;
    padding: 2em;
    margin-bottom: 2em;
}

.zone-info-card h3 {
    color: #7A8B69;
    margin-bottom: 1.5em;
}

.zone-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1em;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75em 0;
    border-bottom: 1px solid rgba(122, 139, 105, 0.1);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item .label {
    font-weight: 600;
    color: #333;
}

.detail-item .value {
    color: #7A8B69;
    font-weight: 700;
}

/* Climate Overview Card */
.climate-overview-card {
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 1.5em;
    margin-bottom: 2em;
}

.climate-overview-card h3 {
    color: #333;
    margin-bottom: 1em;
}

.climate-overview-card p {
    line-height: 1.8;
    color: #555;
}

/* Crops by Season */
.crops-by-season {
    margin-bottom: 2em;
}

.crops-by-season h3 {
    color: #333;
    margin-bottom: 1.5em;
}

.season-section {
    margin-bottom: 2em;
}

.season-section h4 {
    color: #7A8B69;
    margin-bottom: 1em;
    font-size: 1.1em;
}

.crops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1em;
}

.crop-tag {
    background-color: white;
    border: 2px solid #7A8B69;
    border-radius: 8px;
    padding: 1em;
    text-align: center;
    transition: all 0.3s ease;
    cursor: default;
}

.crop-tag:hover {
    background-color: #E8F5E8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(122, 139, 105, 0.15);
}

.crop-icon {
    font-size: 2em;
    margin-bottom: 0.5em;
}

.crop-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5em;
    font-size: 0.95em;
}

.crop-period {
    font-size: 0.85em;
    color: #7A8B69;
}

/* Easy Crops Card */
.easy-crops-card {
    background: linear-gradient(135deg, #FFF8DC 0%, #FFFACD 100%);
    border: 2px solid #D2691E;
    border-radius: 8px;
    padding: 1.5em;
    margin-bottom: 2em;
}

.easy-crops-card h3 {
    color: #D2691E;
    margin-bottom: 1em;
}

.easy-crops-card p {
    margin-bottom: 1em;
    color: #555;
}

.easy-crops-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75em;
}

.easy-crop-badge {
    background-color: #D2691E;
    color: white;
    padding: 0.5em 1em;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

/* Climate CTA */
.climate-cta {
    background-color: white;
    border: 2px solid #7A8B69;
    border-radius: 8px;
    padding: 2em;
    text-align: center;
    margin-bottom: 2em;
}

.climate-cta p {
    margin-bottom: 1.5em;
    line-height: 1.8;
    color: #555;
}

.btn-primary {
    background-color: #7A8B69;
    color: white;
    padding: 1em 2em;
    border: none;
    border-radius: 4px;
    font-size: clamp(1rem, 2vw + 0.5rem, 1.25rem);
    cursor: pointer;
    min-height: 48px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: #6A7B59;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(122, 139, 105, 0.2);
}

/* Responsive adjustments */
@media (min-width: 600px) {
    .zip-input-wrapper {
        flex-direction: row;
    }
    
    .zip-input-wrapper input {
        flex: 1;
    }
    
    .zip-input-wrapper button {
        width: auto;
        flex: 0.4;
    }
    
    .zone-details {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .crops-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* Crop cards */
.crop-card {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 1em;
    margin: 0.5em 0;
    background-color: white;
    cursor: pointer;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.crop-card.selected {
    background-color: #FFDAB9; /* light orange */
    border-color: #D2691E; /* chocolate/orange accent */
    color: #5a2b00;
}

.crop-card input[type="checkbox"] {
    display: none; /* hide any leftover checkboxes */
}

/* ROI Display */
#roi-display {
    margin: 1em 0;
    padding: 1em;
    background-color: white;
    border-radius: 8px;
    border: 1px solid #ccc;
}

/* Print styles */
@media print {
    body {
        background-color: white;
        color: black;
    }
    header, footer, .affiliate-link, button, input {
        display: none;
    }
    #roi-display {
        border: none;
        padding: 0;
    }
}

/* Garden size and crop selection panels */
.garden-size-section {
    margin: 1.5em 0;
    padding: 1em 0;
}

.garden-inputs {
    display: flex;
    gap: 0.75em;
    flex-direction: column;
    margin-bottom: 0.75em;
}

.garden-inputs input {
    min-height: 48px;
    font-size: 16px;
    padding: 0.75em;
}

.garden-actions { margin-bottom: 1em; }

.panel {
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 1em;
    margin-top: 0.75em;
    transition: all 0.5s ease-in-out;
    opacity: 0;
    transform: translateY(10px);
}

.panel.visible {
    opacity: 1;
    transform: translateY(0);
}

.panel.hidden { display: none; }

.space-message { font-size: 1rem; color: #333; margin-bottom: 0.5em; }
.space-encourage { color: #555; }

/* Crop selection */
.crop-selection {
    margin-top: 1em;
}

.tags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75em;
    margin-bottom: 0.75em;
}

.tag {
    padding: 0.75em 0.5em;
    border-radius: 8px;
    border: 2px solid #ccc;
    background: white;
    text-align: center;
    cursor: pointer;
    font-size: 16px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tag.selected {
    background: #E8F5E8;
    border-color: #7A8B69;
}

.tag .star { margin-left: 6px; color: #D2691E; }

.tags-note { font-size: 0.95rem; color: #555; margin-top: 0.5em; }

.choices-feedback { margin-top: 0.75em; }

/* crop card icon */
.crop-card-icon {
    font-size: 1.6rem;
    margin-bottom: 0.4rem;
}

/* tag icon */
.tag-icon { font-size: 1.4rem; margin-bottom: 0.25rem; }

/* Location radio cards */
.location-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.6rem; }
.location-card {
    border: 2px solid #e6e6e6; padding: 0.8rem; border-radius: 8px; cursor: pointer; background: #fff; text-align: left;
}
.location-card input[type="radio"] { display: none; }
.location-card strong { display: block; margin-bottom: 0.25rem; }
.location-card .muted { color: #666; font-size: 0.95rem; }
.location-card:hover { border-color: #7A8B69; box-shadow: 0 4px 12px rgba(122,139,105,0.06); }
.location-card.selected { border-color: #D2691E; background: #FFF4EB; }

/* Garden plan grid */
.garden-plan-grid { display: grid; gap: 6px; margin-top: 1em; }
.grid-cell { border: 1px solid #ddd; border-radius: 6px; padding: 0.6rem; min-width: 48px; min-height: 48px; display:flex; flex-direction:column; align-items:center; justify-content:center; font-size:0.95rem; }
.grid-cell .emoji { font-size: 1.4rem; }
.companion-border { outline: 3px dashed rgba(30,150,60,0.6); }
.micro-hotSheltered { background: rgba(255,234,216,0.5); } /* warm orange */
.micro-strongShade { background: rgba(220,235,255,0.45); } /* light blue */
.micro-windy { background: rgba(245,245,245,0.6); }
.micro-sheltered { background: rgba(250,250,250,0.6); }
.micro-semiShade { background: rgba(235,245,255,0.45); }

/* plan combo and house module */
.plan-combo { width: 100%; display: flex; }
.north-label { font-size: 0.95rem; color: #333; }
.house-module { background: #e0e0e0; border-radius: 6px; display:flex; align-items:center; justify-content:center; padding:0.6rem; }
.companion-border { box-shadow: inset 0 0 0 3px rgba(30,150,60,0.12); border: 2px dashed rgba(30,150,60,0.6); }

/* empty cell visuals and tooltip */
.empty-cell { background: rgba(250,250,250,0.6); }
.empty-cell::after {
    content: attr(data-tooltip);
    position: absolute;
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    transform: translateY(-8px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease, transform 0.12s ease;
    z-index: 20;
}
.empty-cell:hover::after { opacity: 1; transform: translateY(-12px) scale(1); }

@media (min-width: 600px) {
    .garden-inputs { flex-direction: row; }
}