/**
 * Seed Starting Calculator Styles
 */

.seed-calculator-container {
    max-width: 900px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

.seed-calculator-header {
    text-align: center;
    margin-bottom: 30px;
}

.seed-calculator-header h2 {
    color: #154e45;
    font-size: 32px;
    margin-bottom: 10px;
}

.seed-calculator-header p {
    color: #616161;
    font-size: 18px;
}

/* Season Toggle */
.season-toggle-wrapper {
    background: linear-gradient(135deg, #e3f2fd 0%, #e1f5fe 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    border: 2px solid #154e45;
}

.season-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: center;
}

.season-btn {
    flex: 1;
    max-width: 250px;
    padding: 14px 24px;
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #616161;
    transition: all 0.3s ease;
}

.season-btn:hover {
    border-color: #154e45;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(21, 78, 69, 0.2);
}

.season-btn.active {
    background: #154e45;
    color: white;
    border-color: #154e45;
    box-shadow: 0 4px 12px rgba(21, 78, 69, 0.3);
}

.season-description {
    text-align: center;
    color: #424242;
    font-size: 14px;
    margin: 0;
    font-style: italic;
}

/* Form Styles */
.seed-calculator-form {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.form-row {
    margin-bottom: 25px;
}

.form-row label {
    display: block;
    font-weight: 600;
    color: #212121;
    margin-bottom: 10px;
    font-size: 16px;
}

/* ZIP Code Input Wrapper */
.zipcode-input-wrapper {
    position: relative;
    max-width: 400px;
    margin-bottom: 10px;
}

.zipcode-input-wrapper::before {
    content: "📍";
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    pointer-events: none;
}

#seed-zipcode {
    width: 100%;
    padding: 14px 16px 14px 50px;
    font-size: 18px;
    font-weight: 600;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: #fafafa;
}

#seed-zipcode:focus {
    outline: none;
    border-color: #154e45;
    box-shadow: 0 0 0 4px rgba(21, 78, 69, 0.15);
    background: white;
}

#seed-zipcode::placeholder {
    color: #9e9e9e;
    font-weight: normal;
}

.zipcode-hint {
    font-size: 13px;
    color: #757575;
    margin-top: 6px;
    font-style: italic;
}

/* Category Tabs */
.seed-category-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.seed-tab {
    padding: 10px 20px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
    color: #616161;
}

.seed-tab:hover {
    background: #e8e8e8;
    border-color: #ccc;
    color: #424242;
}

.seed-tab.active {
    background: #154e45;
    color: white;
    border-color: #154e45;
}

/* Plants Header with Toggle */
.plants-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.header-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.custom-plant-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.custom-plant-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 152, 0, 0.3);
}

.toggle-list-btn {
    padding: 10px 20px;
    background: #154e45;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-list-btn:hover {
    background: #1b5e20;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(21, 78, 69, 0.3);
}

.toggle-icon {
    transition: transform 0.3s ease;
    font-size: 12px;
}

.toggle-list-btn.expanded .toggle-icon {
    transform: rotate(180deg);
}

/* Custom Plant Form */
.custom-plant-form {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 3px solid #ff9800;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

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

.custom-plant-form h3 {
    color: #e65100;
    margin: 0 0 20px 0;
    font-size: 20px;
}

.custom-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.custom-form-field {
    display: flex;
    flex-direction: column;
}

.custom-form-field.full-width {
    grid-column: 1 / -1;
}

.custom-form-field label {
    font-weight: 600;
    color: #5d4037;
    margin-bottom: 6px;
    font-size: 14px;
}

.custom-form-field input,
.custom-form-field select,
.custom-form-field textarea {
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.custom-form-field input:focus,
.custom-form-field select:focus,
.custom-form-field textarea:focus {
    outline: none;
    border-color: #ff9800;
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.15);
}

.custom-form-actions {
    display: flex;
    gap: 10px;
}

.btn-save {
    flex: 1;
    padding: 12px 24px;
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.btn-cancel {
    padding: 12px 24px;
    background: #f5f5f5;
    color: #616161;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

/* Custom Plant Badge */
.seed-checkbox.custom-plant {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-color: #ff9800;
}

.seed-checkbox.custom-plant .seed-label::after {
    content: " ⭐";
    font-size: 12px;
}

/* Plant Selection Container */
.plant-selection-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out, opacity 0.3s ease;
    opacity: 0;
}

.plant-selection-container.expanded {
    max-height: 2000px;
    opacity: 1;
    margin-bottom: 20px;
}

.plant-selection-container.collapsed {
    max-height: 0;
    opacity: 0;
}

/* Search Bar */
.plant-search-wrapper {
    position: relative;
    margin-bottom: 20px;
}

#plant-search {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: white;
}

#plant-search:focus {
    outline: none;
    border-color: #154e45;
    box-shadow: 0 0 0 4px rgba(21, 78, 69, 0.15);
}

#plant-search::placeholder {
    color: #9e9e9e;
}

.search-results-count {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: #757575;
    font-weight: 600;
    background: #f5f5f5;
    padding: 4px 12px;
    border-radius: 12px;
}

/* Selected Count Badge */
.selected-count-badge {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #154e45;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 600;
    color: #154e45;
    font-size: 15px;
}

#selected-count {
    font-size: 24px;
    font-weight: 700;
}

/* Seed Selection Grid */
.seed-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.seed-checkbox {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.seed-checkbox:hover {
    background: #f0f0f0;
    border-color: #154e45;
}

.seed-checkbox input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.seed-checkbox input[type="checkbox"]:checked + .seed-label {
    color: #154e45;
    font-weight: 600;
}

.seed-checkbox.checked {
    background: #e8f5e9;
    border-color: #154e45;
}

.seed-label {
    font-size: 14px;
    color: #424242;
}

/* Calculate Button */
.seed-calculate-btn {
    width: 100%;
    padding: 18px 32px;
    background: linear-gradient(135deg, #154e45 0%, #1b5e20 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
}

.seed-calculate-btn .btn-icon {
    font-size: 22px;
}

.seed-calculate-btn .btn-count {
    position: absolute;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
}

.seed-calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(21, 78, 69, 0.3);
}

.seed-calculate-btn:active {
    transform: translateY(0);
}

.seed-calculate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading State */
.seed-loading {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.seed-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #154e45;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Results Section */
.seed-results {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.seed-results-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.seed-results-header h3 {
    color: #154e45;
    font-size: 26px;
    margin-bottom: 10px;
}

.seed-results-header p {
    color: #616161;
    font-size: 16px;
}

.frost-date-info {
    background: #e8f5e9;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
}

.frost-date-info strong {
    color: #154e45;
    font-size: 18px;
}

/* Nearby ZIP Notice */
.nearby-zip-notice {
    display: flex;
    align-items: flex-start;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 2px solid #ff9800;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.2);
}

.nearby-zip-notice .notice-icon {
    font-size: 24px;
    margin-right: 15px;
    flex-shrink: 0;
}

.nearby-zip-notice .notice-content {
    flex: 1;
    color: #424242;
    line-height: 1.6;
}

.nearby-zip-notice .notice-content strong {
    color: #e65100;
}

/* Seed Result Card */
.seed-result-card {
    background: #fafafa;
    border-left: 4px solid #154e45;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.seed-result-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateX(5px);
}

.seed-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.seed-result-header h4 {
    color: #154e45;
    font-size: 22px;
    margin: 0;
}

.seed-category-badge {
    padding: 5px 12px;
    background: #154e45;
    color: white;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.seed-timeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.timeline-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.timeline-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.timeline-label {
    font-size: 12px;
    color: #616161;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 5px;
}

.timeline-date {
    font-size: 16px;
    color: #154e45;
    font-weight: 700;
}

.timeline-detail {
    font-size: 12px;
    color: #757575;
    margin-top: 5px;
}

.seed-notes {
    background: #fff3e0;
    border-left: 3px solid #ff9800;
    padding: 12px 15px;
    border-radius: 5px;
    font-size: 14px;
    color: #5d4037;
    line-height: 1.6;
}

.seed-notes strong {
    color: #e65100;
}

.direct-sow-badge {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 12px;
    background: #e3f2fd;
    color: #1565c0;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 600;
}

/* Action Buttons */
.seed-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.seed-action-btn {
    padding: 12px 24px;
    border: 2px solid #154e45;
    background: white;
    color: #154e45;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.seed-action-btn:hover {
    background: #154e45;
    color: white;
}

.seed-action-btn.primary {
    background: #154e45;
    color: white;
}

.seed-action-btn.primary:hover {
    background: #1b5e20;
    border-color: #1b5e20;
}

/* Print Styles */
@media print {
    .seed-calculator-form,
    .seed-actions,
    .seed-category-tabs {
        display: none;
    }

    .seed-result-card {
        page-break-inside: avoid;
    }
}

/* Fall Frost Missing Dialog */
.fall-frost-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fall-frost-dialog-overlay.visible {
    opacity: 1;
}

.fall-frost-dialog {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.fall-frost-dialog-overlay.visible .fall-frost-dialog {
    transform: translateY(0);
}

.fall-frost-dialog .dialog-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 15px;
}

.fall-frost-dialog h3 {
    color: #154e45;
    font-size: 24px;
    margin: 0 0 15px 0;
    text-align: center;
}

.fall-frost-dialog .dialog-message {
    color: #616161;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: center;
}

.fall-frost-dialog .dialog-explanation {
    background: #f5f5f5;
    border-left: 4px solid #ff9800;
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 4px;
}

.fall-frost-dialog .dialog-explanation p {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #424242;
}

.fall-frost-dialog .dialog-explanation p:last-child {
    margin-bottom: 0;
}

.fall-frost-dialog .dialog-explanation strong {
    color: #e65100;
}

.fall-frost-dialog .dialog-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fall-frost-dialog .dialog-btn {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.fall-frost-dialog .dialog-btn.primary {
    background: linear-gradient(135deg, #154e45 0%, #1b5e20 100%);
    color: white;
}

.fall-frost-dialog .dialog-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(21, 78, 69, 0.3);
}

.fall-frost-dialog .dialog-btn.secondary {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
}

.fall-frost-dialog .dialog-btn.secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.fall-frost-dialog .dialog-btn:not(.primary):not(.secondary) {
    background: #f5f5f5;
    color: #616161;
    border: 2px solid #e0e0e0;
}

.fall-frost-dialog .dialog-btn:not(.primary):not(.secondary):hover {
    background: #e0e0e0;
}

/* Temporary Success Message */
.temp-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    z-index: 10001;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.temp-message.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .seed-calculator-container {
        padding: 15px;
    }

    .seed-calculator-form {
        padding: 20px;
    }

    .plants-header {
        flex-direction: column;
        align-items: stretch;
    }

    .toggle-list-btn {
        width: 100%;
        justify-content: center;
    }

    #plant-search {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .search-results-count {
        position: static;
        display: block;
        margin-top: 8px;
        text-align: right;
    }

    .seed-category-tabs {
        flex-direction: column;
    }

    .seed-tab {
        width: 100%;
        text-align: center;
    }

    .seed-selection-grid {
        grid-template-columns: 1fr;
    }

    .seed-calculate-btn {
        flex-direction: column;
        gap: 8px;
    }

    .seed-calculate-btn .btn-count {
        position: static;
        margin-top: 5px;
    }

    .seed-timeline {
        grid-template-columns: 1fr;
    }

    .seed-result-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .seed-actions {
        flex-direction: column;
    }

    .seed-action-btn {
        width: 100%;
    }

    .fall-frost-dialog {
        padding: 20px;
        margin: 10px;
    }

    .fall-frost-dialog h3 {
        font-size: 20px;
    }

    .fall-frost-dialog .dialog-icon {
        font-size: 36px;
    }

    .temp-message {
        top: 10px;
        right: 10px;
        left: 10px;
        text-align: center;
    }
}

/* Hidden class for filtering */
.hidden {
    display: none !important;
}
