body {
    background-color: #f8f9fa;
    color: #343a40;
}

/* Header & Navigation Styles */
.header {
    background: linear-gradient(135deg, #1a2a6c, #2a4858);
    padding: 20px 0;
    margin-bottom: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
}

.header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.header h1 {
    color: white;
    font-size: 2.2rem;
    font-weight: 600;
    margin: 0;
    padding: 10px 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    letter-spacing: 0.5px;
    text-align: center;
}

.section-title {
    color: #27ae60;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.form-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 30px;
}

.btn-primary {
    background-color: #27ae60;
    border-color: #27ae60;
}

.btn-primary:hover, 
.btn-primary:focus {
    background-color: #219653;
    border-color: #219653;
}

.btn-outline-primary {
    color: #27ae60;
    border-color: #27ae60;
    transition: all 0.2s ease;
}

.btn-outline-primary:hover, 
.btn-outline-primary:focus {
    background-color: #27ae60;
    border-color: #27ae60;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.input-line {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.input-line label {
    width: 120px;
    margin-bottom: 0;
}

.input-content {
    flex-grow: 1;
}

.remove-btn {
    color: #dc3545;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 10px;
}

.results-container {
    background-color: #f1f8e9;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

/* Chart container styles */
.chart-container {
    position: relative;
    width: 100%;
}

#emissionPieChart-container {
    min-height: 300px;
}

#projectionChart-container {
    min-height: 300px;
}

/* Remove redundant styles that might conflict */
.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

#projectionChart {
    margin: 0 auto;
}

.chart-container {
    position: relative;
    height: 340px;
    margin: 0;
}

#emissionsChart, 
#projectionChart {
    width: 100% !important;
    height: 100% !important;
}

.result-chart {
    width: 100% !important;
    height: 100% !important;
    margin: 0 auto;
}

.top-right-links {
    position: absolute;
    top: 20px;
    right: 20px;
}

.top-right-links a {
    color: white;
    margin-left: 15px;
    text-decoration: none;
}

.top-right-links a:hover {
    text-decoration: underline;
}

.footer {
    background-color: #343a40;
    color: white;
    padding: 20px 0;
    margin-top: 50px;
}

.carbon-credit-badge {
    font-size: 1.5rem;
    padding: 10px 20px;
    border-radius: 30px;
    display: inline-block;
    margin-bottom: 15px;
}

.card {
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: none;
}

.card-body {
    padding: 1.5rem;
}

.results-container h6 {
    font-weight: 600;
    color: #495057;
}

.list-group-flush .list-group-item {
    padding: 0.5rem 0;
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

/* Custom Select Styles */
.custom-select-container {
    position: relative;
    width: 100%;
}

.custom-select-input {
    width: 100%;
    padding: 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    background-color: #fff;
    cursor: pointer;
}

.custom-select-dropdown {
    position: absolute;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    background-color: white;
    z-index: 1000;
    display: none;
    margin-top: 2px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.custom-select-search {
    width: 100%;
    padding: 0.375rem 0.75rem;
    border: none;
    border-bottom: 1px solid #ced4da;
}

.custom-select-option {
    padding: 0.375rem 0.75rem;
    cursor: pointer;
}

.custom-select-option:hover {
    background-color: #f8f9fa;
}

.custom-select-option.selected {
    background-color: #e9ecef;
}

.custom-select-add-new {
    padding: 0.375rem 0.75rem;
    background-color: #e6f7ff;
    cursor: pointer;
    font-style: italic;
    color: #0066cc;
    border-top: 1px dashed #ced4da;
}

.ai-tag {
    background-color: #e6f7ff;
    color: #0066cc;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 3px;
    margin-left: 5px;
    vertical-align: middle;
}

/* AI Assistant Styles */
.custom-select-input:focus {
    cursor: text;
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(39, 174, 96, 0.25);
}

.ai-search-result {
    margin-top: 10px;
    padding: 15px;
    background-color: #f8f9fa;
    border-left: 3px solid #27ae60;
    border-radius: 4px;
    font-size: 0.9rem;
}

#aiSearchingIndicator {
    display: flex;
    align-items: center;
    margin-top: 10px;
    padding: 10px;
    background-color: #f0f7ff;
    border-radius: 4px;
}

#aiSearchingIndicator .spinner-border {
    width: 1rem;
    height: 1rem;
    margin-right: 10px;
}

.ai-model-info {
    display: block;
    font-size: 0.75rem;
    color: #6c757d;
    text-align: right;
    font-style: italic;
    margin-top: 5px;
}

.custom-select-input[readonly] {
    background-color: #fff;
    cursor: pointer;
}

/* Menu Styles */
.main-menu {
    background: linear-gradient(135deg, #1a7740, #145a32);
    padding: 0;
    margin-bottom: 20px;
}

.nav-section {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    padding: 5px 0;
}

.menu-item {
    position: relative;
    padding: 10px 15px;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.menu-item.has-submenu {
    padding-right: 25px;
}

.menu-item.has-submenu:after {
    content: '▼';
    font-size: 8px;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 4px;
    z-index: 1000;
}

.menu-item:hover .submenu {
    display: block;
}

.submenu a {
    display: block;
    padding: 8px 15px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
}

.submenu a:hover {
    background: #f8f9fa;
    color: #27ae60;
}

.submenu a.active {
    background: #27ae60;
    color: white;
}

/* Layout Styles */
.main-layout {
    display: flex;
    gap: 20px;
    position: relative;
}

.content-area {
    flex: 2;
    min-width: 0;
}

.details-panel {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    position: sticky;
    top: 20px;
    height: calc(100vh - 40px);
    overflow-y: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
}

/* Content Section Styles */
.content-section {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.content-section.crop-type {
    border-left: 5px solid #27ae60;
}

.content-section.fertilizer {
    border-left: 5px solid #3498db;
}

.content-section.pesticide {
    border-left: 5px solid #e74c3c;
}

.content-section.energy {
    border-left: 5px solid #f39c12;
}

.content-section.biomass {
    border-left: 5px solid #9b59b6;
}

.content-section h1 {
    color: #27ae60;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

/* Background Colors */
.bg-light-blue {
    background-color: #e1f5fe;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .chart-container {
        height: 60vh;
    }
    
    .main-layout {
        flex-direction: column;
    }
    
    .details-panel {
        position: static;
        max-width: none;
        height: auto;
    }
}

/* Flex Layout Styles */
.row-flex {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.flex-column {
    flex: 0 0 calc(50% - 10px);
    width: calc(50% - 10px);
}

.h-100 {
    height: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .row-flex {
        flex-direction: column;
    }
    
    .flex-column {
        flex: 0 0 100%;
        width: 100%;
    }
}

/* Results List Styles */
.results-list {
    margin: 0;
    padding: 0;
}

.results-list .list-group-item {
    border-left: none;
    border-right: none;
    padding: 1rem 0;
}

.results-list .list-group-item:first-child {
    border-top: none;
}

.results-list .list-group-item div {
    font-size: 1.2rem;
}

.results-list .fw-bold {
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.results-list #carbon-absorbed,
.results-list #emissions,
.results-list #carbon-credits-badge {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0.2rem 0;
}

.results-list #carbon-absorbed {
    color: #198754;  /* Bootstrap success color */
}

.results-list #emissions {
    color: #dc3545;  /* Bootstrap danger color */
}

.results-list #carbon-credits-badge {
    color: #0d6efd;  /* Bootstrap primary color */
}

/* Metrics display styles */
.metric-value {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0.3rem 0;
    line-height: 1.2;
}

.card-body .fw-bold {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-body small {
    color: #6c757d;
    font-size: 0.8rem;
}

/* Ensure metrics are evenly spaced */
.d-flex.justify-content-between > div {
    flex: 1;
    padding: 0 10px;
    position: relative;
}

.d-flex.justify-content-between > div:not(:last-child):after {
    content: '';
    position: absolute;
    right: 0;
    top: 10%;
    height: 80%;
    width: 1px;
    background: #dee2e6;
}

/* AI Model Manager specific styles */
.model-card {
    transition: all 0.2s ease;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.model-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.model-card .card-header {
    background: linear-gradient(to right, #f8f9fa, #ffffff);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.model-card .form-check-input {
    width: 3rem;
    height: 1.5rem;
}

.model-card .api-key-input {
    font-family: monospace;
    letter-spacing: 0.1em;
}

.model-card .model-info {
    font-size: 0.9rem;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.test-result {
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-label.text-muted.fw-bold {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge {
    font-weight: 500;
    padding: 0.5em 0.8em;
}

/* Consistent Admin Page Styles */
.admin-content {
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}
