/* 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: #d32f2f;
    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: #E8F5E8;
    border-color: #7A8B69;
}

.crop-card input[type="checkbox"] {
    width: auto;
    margin: 0;
}

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

.roi-bar {
    height: 20px;
    background: linear-gradient(to right, #7A8B69 0%, #7A8B69 var(--percentage), #ccc var(--percentage), #ccc 100%);
    border-radius: 10px;
    margin: 0.5em 0;
}

/* Affiliate link */
.affiliate-link {
    background-color: #FFD700;
    padding: 1em;
    margin: 1em 0;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
}

/* Responsive layout */
main {
    padding: 1em;
}

@media (min-width: 600px) {
    main {
        max-width: 900px;
        margin: auto;
    }
}

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