/* Seed Starting Calculator - WordPress Plugin Styles */
.seed-calculator-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.calculator-title {
    font-size: 2rem;
    font-weight: 700;
    color: #0c7938;
    margin-bottom: 8px;
}

.calculator-subtitle {
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 0;
}

/* Form Styles */
.seed-form {
    margin-bottom: 30px;
}

.form-section {
    margin-bottom: 20px;
}

.form-section label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #0c7938;
    box-shadow: 0 0 0 3px rgba(12, 121, 56, 0.1);
}

.location-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.crop-selection {
    margin-bottom: 20px;
}

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

.crop-checkbox {
    position: relative;
    cursor: pointer;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    text-align: center;
    transition: all 0.2s ease;
    background: #ffffff;
}

.crop-checkbox:hover {
    border-color: #0c7938;
    background: #f0fdf4;
}

.crop-checkbox.selected {
    border-color: #0c7938;
    background: #dcfce7;
    color: #0c7938;
}

.crop-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.crop-checkbox label {
    margin: 0;
    font-weight: 500;
    cursor: pointer;
}

.custom-crop-section {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.custom-crop-section.show {
    display: block;
}

.submit-button {
    background: #0c7938;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    width: 100%;
}

.submit-button:hover {
    background: #0a5c2a;
}

.submit-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.submit-button.loading {
    position: relative;
    color: transparent;
}

.submit-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Results Styles */
.results-container {
    margin-top: 30px;
}

.results-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.tab-button {
    flex: 1;
    padding: 12px 20px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.tab-button:hover {
    color: #0c7938;
    background: #f9fafb;
}

.tab-button.active {
    color: #0c7938;
    border-bottom-color: #0c7938;
    background: #f0fdf4;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.timeline-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.crop-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.reset-button {
    background: none;
    border: 1px solid #d1d5db;
    color: #6b7280;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-button:hover {
    border-color: #0c7938;
    color: #0c7938;
}

.timeline-instructions {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 20px;
    font-style: italic;
}

/* Interactive Timeline Styles - FIXED LAYOUT */
.interactive-timeline {
    position: relative;
    margin-bottom: 20px;
    user-select: none;
}

/* Month headers - FORCE HORIZONTAL LAYOUT */
.month-headers {
    display: flex !important;
    width: 100% !important;
    margin-bottom: 8px !important;
    height: 20px !important;
    overflow: hidden !important;
}

.month-header {
    flex: 1 !important;
    text-align: center !important;
    font-size: 10px !important;
    font-weight: 500 !important;
    color: #6b7280 !important;
    padding: 4px 2px !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
}

/* Timeline track */
.timeline-track {
    position: relative !important;
    height: 60px !important;
    background: linear-gradient(90deg, #f3f4f6 0%, #ffffff 50%, #f3f4f6 100%) !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    overflow: visible !important;
    width: 100% !important;
    display: block !important;
}

/* Frost indicators */
.frost-indicator {
    position: absolute;
    width: 2px;
    height: 100%;
    top: 0;
    z-index: 2;
}

.frost-indicator.last-frost {
    background: #3b82f6;
}

.frost-indicator.first-frost {
    background: #1d4ed8;
}

/* Harvest window */
.harvest-window {
    position: absolute;
    height: 100%;
    background: rgba(12, 121, 56, 0.2);
    border-radius: 4px;
    z-index: 1;
    top: 0;
}

/* Timeline markers */
.timeline-marker {
    position: absolute !important;
    width: 18px !important;
    height: 18px !important;
    border-radius: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    cursor: grab !important;
    z-index: 999999 !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.timeline-marker:hover {
    transform: translate(-50%, -50%) scale(1.2) !important;
}

.timeline-marker:active {
    cursor: grabbing !important;
}

.timeline-marker.start-indoors {
    background: #f59e0b !important;
    border: 2px solid #d97706 !important;
}

.timeline-marker.transplant {
    background: #0c7938 !important;
    border: 2px solid #0a5c2a !important;
}

/* Marker labels */
.marker-label {
    position: absolute !important;
    top: -32px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    color: #374151 !important;
    background: rgba(255, 255, 255, 0.98) !important;
    padding: 4px 6px !important;
    border-radius: 4px !important;
    white-space: nowrap !important;
    pointer-events: none !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    z-index: 1000000 !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    line-height: 1.2 !important;
    display: block !important;
}

.connection-line {
    position: absolute;
    height: 2px;
    background: #d1d5db;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

/* Date summary */
.date-summary {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.date-item {
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.date-item.harvest {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.date-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.date-value {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
}

.date-item.harvest .date-value {
    color: #0c7938;
}

/* Warning messages */
.warning-message {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 6px;
    padding: 12px;
    margin-top: 15px;
    color: #92400e;
    font-size: 14px;
}

/* Loading states */
.loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    padding: 15px;
    color: #dc2626;
    margin: 20px 0;
}

/* Divi Theme Compatibility - CRITICAL OVERRIDES */
.et_pb_code .seed-calculator-container *,
.divi-theme .seed-calculator-container *,
[data-et-multi-view] .seed-calculator-container * {
    box-sizing: border-box !important;
}

.et_pb_code .month-headers,
.divi-theme .month-headers,
[data-et-multi-view] .month-headers {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    gap: 0 !important;
    margin-bottom: 8px !important;
    height: 20px !important;
}

.et_pb_code .month-header,
.divi-theme .month-header,
[data-et-multi-view] .month-header {
    flex: 1 !important;
    text-align: center !important;
    font-size: 10px !important;
    font-weight: 500 !important;
    color: #6b7280 !important;
    padding: 4px 2px !important;
    min-width: 0 !important;
    display: block !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    float: none !important;
    clear: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .seed-calculator-container {
        padding: 15px;
        margin: 10px;
    }
    
    .location-inputs {
        grid-template-columns: 1fr;
    }
    
    .crop-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .date-summary {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .results-tabs {
        flex-direction: column;
    }
    
    .timeline-card {
        padding: 15px;
    }
}