
        #map { 
            /*height: 100vh; 
            width: 100%;*/

            /*margin-left: 300px;  Ensure the map does not overlap with the sidebar */
            width: calc(100% - 300px);
            height: 100vh;
         }

        #sidebar {
            position: fixed;
            top: 0;
            right: 0;
            height: 100%;
            width: 300px;
            background-color: #f8f9fa;
            padding: 20px;
            overflow-y: auto;
            box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
            /*transform: translateX(100%);*/
            transition: transform 0.3s ease;
            z-index: 5;
        }

        header {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            background-color: #fff;
            padding: 10px 20px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
            z-index: 10;
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 60px;
        }

        .header-left {
            flex: 1;
        }

        .header-center {
            flex: 25;
            display: flex;
            justify-content: center;
        }

        /* Right section for icons */
        .header-right {
            display: flex;
            align-items: center;
            gap: 20px;
            font-size: 20px;
            color: #333;
        }

        .header-right i {
            cursor: pointer;
            transition: color 0.3s ease;
        }

        .header-right i:hover {
            color: #007bff;
        }

        /*#sidebar.show {
            transform: translateX(0);
        }*/

        /* Tab Styles */
.tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
    margin-top: 60px;
}

.tab-button {
    padding: 10px 15px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: #6c757d;
    transition: all 0.3s ease;
}

.tab-button.active {
    color: #007bff;
    border-bottom: 2px solid #007bff;
}

.tab-content {
    display: none;
    padding: 15px 0;
}

.tab-content.active {
    display: block;
}

/* Accordion Styles */
.accordion-item {
    margin-bottom: 10px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    overflow: hidden;
}

.accordion-header {
    width: 100%;
    padding: 12px 15px;
    background: #f8f9fa;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.accordion-header:hover {
    background: #e9ecef;
}

.accordion-content {
    padding: 15px;
    display: none;
}

.accordion-content.active {
    display: block;
}

/* Bottom Actions */
.bottom-actions {
    position: sticky;
    bottom: 0;
    background: #f8f9fa;
    padding: 15px;
    border-top: 1px solid #dee2e6;
    margin-top: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tabs {
        flex-direction: column;
    }
    
    .tab-button {
        width: 100%;
        text-align: left;
    }
}

        #toggleButton{
            position: absolute;
            top: 10px;
            right: 10px;
            padding: 10px;
            font-size: 16px;
            background-color: #007bff;
            color: #fff;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            z-index: 6;
        }

        #searchBox {
            width: 80%;
            max-width: 550px;
            padding: 10px;
            font-size: 16px;
           
            border-radius: 5px;
            outline: none;
            margin: 0 auto;
        }

        .action-button {
            width: 100%;
            padding: 10px;
            font-size: 16px;
            color: #fff;
            background-color: #007bff;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            margin-top: 10px;
        }

        .action-button:hover {
            background-color: #0056b3;
        }

        .info-icon {
            color: #28a745;
            cursor: pointer;
            margin-left: 8px;
            transition: color 0.3s ease;
        }

        .info-icon:hover {
            color: #218838;
        }

        .result-container {
            margin-top: 10px;
            padding: 10px;
            background-color: #fff;
            border-radius: 5px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }

        .result {
            font-size: 14px;
            margin-top: 5px;
            color: #333;
            display: flex;
            align-items: center;
        }

        .recommendation {
            font-size: 13px;
            margin-top: 10px;
            padding: 10px;
            background-color: #e9ecef;
            border-radius: 5px;
            display: none;
        }

        .loading {
            display: inline-block;
            margin-left: 8px;
            color: #6c757d;
            animation: spin 1s linear infinite;
        }

        .grid-cell {
            border: 1px solid #ffffff;
            opacity: 0.7;
        }

        .legend {
            position: absolute;
            bottom: 30px;
            right: 320px;
            background: white;
            padding: 10px;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
            display: none;
            z-index: 4;
        }

        .legend-item {
            display: flex;
            align-items: center;
            margin: 5px 0;
        }

        .legend-color {
            width: 20px;
            height: 20px;
            margin-right: 10px;
        }

        .stats-panel {
            margin-top: 20px;
            padding: 10px;
            background: #f5f5f5;
            border-radius: 5px;
        }

        #downloadBtn {
            background: #28a745;
        }

        #clearBtn {
            background: #dc3545;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .health-metrics, .soil-metrics {
            margin: 15px 0;
            padding: 10px;
            background: #f8f9fa;
            border-radius: 5px;
        }

        .metric {
            margin: 10px 0;
            display: flex;
            flex-direction: column;
        }

        .metric-label {
            font-weight: bold;
            color: #495057;
        }

        .metric-value {
            font-size: 1.2em;
            color: #007bff;
        }

        .metric-interpretation {
            font-size: 0.9em;
            color: #6c757d;
            font-style: italic;
        }

        .stress-visualization {
            height: 20px;
            background: #e9ecef;
            border-radius: 10px;
            overflow: hidden;
            margin: 10px 0;
        }

        .stress-bar {
            height: 100%;
            background: linear-gradient(90deg, #28a745, #ffc107, #dc3545);
            transition: width 0.3s ease;
        }

        .recommendations {
            margin-top: 15px;
            padding: 10px;
            background: #e9ecef;
            border-radius: 5px;
        }

        .trend-summary {
            margin-top: 20px;
            padding: 15px;
            background: #f8f9fa;
            border-radius: 5px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .trend-summary p {
            margin: 5px 0;
            color: #495057;
        }

        canvas#trendChart {
            margin: 20px 0;
            max-height: 300px;
        }

        .action-input {
            width: 100%;
            padding: 10px;
            font-size: 16px;
            border: 2px solid #007bff;
            border-radius: 5px;
            outline: none;
            margin-bottom: 10px;
            margin-top: 10px;
        }

        .robot-status {
            margin-top: 10px;
            padding: 10px;
            border-radius: 5px;
            background-color: #f8f9fa;
        }
 
        .grid-details {
            margin-top: 20px;
            max-height: 300px;
            overflow-y: auto;
        }
        
        .grid-cells-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        
        .grid-cell-item {
            display: flex;
            justify-content: space-between;
            padding: 10px;
            background: #f8f9fa;
            border-radius: 5px;
            cursor: pointer;
        }
        
        .grid-cell-item:hover {
            background: #e9ecef;
        }
        
        .cell-number {
            font-weight: bold;
        }
        
        .cell-ndvi {
            color: #007bff;
        }
        
        .cell-class {
            font-style: italic;
        }
        
        .cell-info {
            padding: 10px;
        }

        .field-health-controls {
            position: absolute;
            top: 10px;
            right: 10px;
            background: white;
            padding: 10px;
            border-radius: 5px;
            box-shadow: 0 2px 6px rgba(0,0,0,0.3);
            max-width: 300px;
        }
        
        .button-container {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            margin-bottom: 10px;
        }
        
        .button-container button {
            padding: 8px;
            border: none;
            border-radius: 4px;
            background: #4CAF50;
            color: white;
            cursor: pointer;
            transition: background 0.3s;
        }
        
        .button-container button:hover {
            background: #45a049;
        }
        
        .results-container {
            max-height: 400px;
            overflow-y: auto;
            padding: 10px;
        }
        
        .analysis-results {
            font-size: 14px;
        }
        
        .stress-legend {
            margin: 10px 0;
            padding: 10px;
            background: #f5f5f5;
            border-radius: 4px;
        }
        
        .legend-item {
            display: flex;
            align-items: center;
            margin: 5px 0;
        }
        
        .color-box {
            width: 20px;
            height: 20px;
            margin-right: 10px;
            border: 1px solid #ccc;
        }
        
        .recommendations {
            margin-top: 10px;
            padding: 10px;
            background: #f0f8ff;
            border-radius: 4px;
        }
        
        .recommendations ul {
            margin: 0;
            padding-left: 20px;
        }

        /* Add to existing CSS */
.analysis-options {
    margin-bottom: 15px;
}

.analysis-options .btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
}

.analysis-options .btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    gap: 5px;
}

.analysis-options .btn i {
    font-size: 1.2em;
}

.analysis-placeholder {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
}

/* Ensure consistent styling with existing components */
#fieldHealthResults {
    margin-top: 10px;
    padding: 10px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Match existing legend styles */
#fieldHealthLegend .legend-item {
    display: flex;
    align-items: center;
    margin: 5px 0;
}

#fieldHealthLegend .color-box {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

/* Analysis Groups and Buttons */
.analysis-group {
    margin-bottom: 20px;
}

.btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
}

/* For single buttons (like Farm Size), span full width */
.btn-group:has(> button:only-child) {
    grid-template-columns: 1fr;
}

.btn {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 10px;
    height: auto;
    min-height: 100px;
    text-align: center;
    transition: all 0.3s ease;
    border-width: 2px;
}

.btn i {
    margin-bottom: 10px;
    font-size: 24px;
}

.btn .btn-text {
    font-size: 14px;
    font-weight: 500;
}

/* Button Hover Effects */
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Button Colors and States */
.btn-outline-success {
    color: #28a745;
    border-color: #28a745;
}

.btn-outline-success:hover {
    color: white;
    background-color: #28a745;
}

.btn-outline-primary {
    color: #007bff;
    border-color: #007bff;
}

.btn-outline-primary:hover {
    color: white;
    background-color: #007bff;
}

.btn-outline-info {
    color: #17a2b8;
    border-color: #17a2b8;
}

.btn-outline-info:hover {
    color: white;
    background-color: #17a2b8;
}

/* Results Container */
.result, .recommendation {
    margin-top: 15px;
    padding: 15px;
    border-radius: 6px;
    background-color: #f8f9fa;
}

/* Responsive Design */
@media (max-width: 768px) {
    .btn-group {
        grid-template-columns: 1fr;
    }
    
    .btn {
        min-height: 80px;
    }
}


