/* NASA Farm Navigators - ROI Calculator Styles */

.roi-calculator-dashboard {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 30px;
    margin: 20px 0;
    color: white;
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.roi-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.roi-header h2 {
    margin: 0 0 10px 0;
    font-size: 32px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.roi-header p {
    font-size: 16px;
    opacity: 0.9;
    margin: 0 0 20px 0;
}

.market-update-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    position: absolute;
    top: 0;
    right: 0;
}

.market-update-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.market-update-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.roi-content {
    display: grid;
    gap: 30px;
}

/* Farm Input Section */
.farm-input-section,
.nasa-integration-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 25px;
    backdrop-filter: blur(10px);
}

.farm-input-section h3,
.nasa-integration-section h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #FFD700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-weight: bold;
    font-size: 14px;
    color: #FFD700;
}

.input-group input,
.input-group select {
    padding: 12px 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #FFD700;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* NASA Integration Section */
.dataset-checkboxes {
    display: grid;
    gap: 15px;
    margin-bottom: 25px;
}

.dataset-option {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.dataset-option:has(input:checked) {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    position: relative;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-label input:checked + .checkmark {
    background: #FFD700;
}

.checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid #333;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label input:checked + .checkmark::after {
    display: block;
}

.dataset-info strong {
    display: block;
    margin-bottom: 5px;
    font-size: 16px;
}

.dataset-info p {
    margin: 0;
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.4;
}

.investment-input {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    border-left: 4px solid #FFD700;
}

.investment-input label {
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
    color: #FFD700;
}

.investment-input input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 18px;
    font-weight: bold;
}

.investment-input small {
    display: block;
    margin-top: 8px;
    opacity: 0.7;
    font-size: 12px;
}

/* Calculate Section */
.calculate-section {
    text-align: center;
    margin: 20px 0;
}

.calculate-btn {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: none;
    border-radius: 50px;
    padding: 15px 40px;
    color: #333;
    font-weight: bold;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
    position: relative;
    min-width: 200px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calculate-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(255, 215, 0, 0.5);
    background: linear-gradient(135deg, #FFA500, #FFD700);
}

.btn-loading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(51, 51, 51, 0.3);
    border-top: 2px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Results Section */
.results-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.results-header h3 {
    margin: 0 0 25px 0;
    font-size: 24px;
    text-align: center;
    color: #FFD700;
}

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

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.stat-card.positive {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.2);
}

.stat-card.profit {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 8px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.stat-label {
    font-size: 14px;
    opacity: 0.8;
}

/* Comparison Section */
.comparison-section {
    margin: 30px 0;
}

.comparison-section h4 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #FFD700;
    text-align: center;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.comparison-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.comparison-item.improved {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

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

.comparison-header h5 {
    margin: 0;
    font-size: 16px;
}

.improvement-badge {
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.metrics {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.metric:last-child {
    border-bottom: none;
}

.metric-label {
    font-size: 14px;
    opacity: 0.8;
}

.metric-value {
    font-weight: bold;
}

.improvement {
    color: #28a745;
    font-size: 12px;
    font-weight: bold;
    margin-left: 8px;
}

/* Benefits Breakdown */
.benefits-breakdown {
    margin: 30px 0;
}

.benefits-breakdown h4 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #FFD700;
    text-align: center;
}

.benefits-grid {
    display: grid;
    gap: 15px;
}

.benefit-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    border-left: 4px solid #FFD700;
}

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

.benefit-header h5 {
    margin: 0;
    font-size: 16px;
}

.benefit-impact.positive {
    background: rgba(40, 167, 69, 0.3);
    color: #28a745;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.benefit-impact.inactive {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.benefit-description {
    margin: 0;
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.4;
}

/* Projection Chart */
.projection-section {
    margin: 30px 0;
}

.projection-section h4 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #FFD700;
    text-align: center;
}

.projection-chart {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.projection-bars {
    display: flex;
    justify-content: space-between;
    align-items: end;
    height: 200px;
    gap: 10px;
}

.projection-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.bar {
    width: 100%;
    background: linear-gradient(to top, #FFD700, #FFA500);
    border-radius: 4px 4px 0 0;
    transition: all 0.3s ease;
    min-height: 20px;
}

.bar-label {
    text-align: center;
}

.year {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 4px;
}

.amount {
    font-size: 11px;
    font-weight: bold;
    color: #FFD700;
}

.projection-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.projection-stat {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.projection-stat .label {
    display: block;
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 8px;
}

.projection-stat .value {
    font-size: 18px;
    font-weight: bold;
    color: #FFD700;
}

/* Sensitivity Analysis */
.sensitivity-section {
    margin: 30px 0;
}

.sensitivity-section h4 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #FFD700;
    text-align: center;
}

.sensitivity-section p {
    text-align: center;
    margin-bottom: 20px;
    opacity: 0.8;
}

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

.sensitivity-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    border: 2px solid transparent;
}

.sensitivity-item.conservative {
    border-color: #ffc107;
    background: rgba(255, 193, 7, 0.1);
}

.sensitivity-item.base {
    border-color: #17a2b8;
    background: rgba(23, 162, 184, 0.1);
}

.sensitivity-item.optimistic {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

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

.scenario-header h5 {
    margin: 0;
    font-size: 16px;
}

.scenario-roi {
    font-weight: bold;
    font-size: 14px;
}

.scenario-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    opacity: 0.8;
}

/* Recommendation */
.recommendation-section {
    margin: 30px 0;
}

.recommendation-section h4 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #FFD700;
    text-align: center;
}

.recommendation-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 25px;
    border: 2px solid transparent;
}

.recommendation-card.highly-recommended {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.2);
}

.recommendation-card.recommended {
    border-color: #17a2b8;
    background: rgba(23, 162, 184, 0.2);
}

.recommendation-card.consider {
    border-color: #ffc107;
    background: rgba(255, 193, 7, 0.2);
}

.recommendation-card.not-recommended {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.2);
}

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

.rec-category {
    font-size: 20px;
    font-weight: bold;
    color: #FFD700;
}

.rec-confidence {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.rec-reason {
    font-size: 16px;
    margin-bottom: 20px;
    opacity: 0.9;
    line-height: 1.5;
}

.key-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.key-metric {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 15px;
    border-radius: 8px;
}

.metric-icon {
    font-size: 20px;
}

.metric-text {
    font-weight: bold;
}

/* Export Section */
.export-section {
    margin: 30px 0 0 0;
    text-align: center;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.export-btn,
.share-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.export-btn:hover,
.share-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 40px;
    background: rgba(220, 53, 69, 0.2);
    border-radius: 15px;
    border: 2px solid #dc3545;
}

.error-message h3 {
    margin: 0 0 15px 0;
    color: #dc3545;
    font-size: 24px;
}

.error-message p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

/* Toast Messages */
.toast-message {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 10000;
}

.toast-message.show {
    transform: translateX(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .roi-calculator-dashboard {
        padding: 20px;
        margin: 10px;
    }

    .input-grid {
        grid-template-columns: 1fr;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
    }

    .quick-stats {
        grid-template-columns: 1fr;
    }

    .projection-bars {
        height: 150px;
    }

    .sensitivity-grid {
        grid-template-columns: 1fr;
    }

    .key-metrics {
        grid-template-columns: 1fr;
    }

    .export-section {
        flex-direction: column;
        align-items: center;
    }

    .market-update-btn {
        position: static;
        margin: 10px 0 0 0;
    }
}