        :root {
            --primary-color: #2c7da0;
            --secondary-color: #a9d6e5;
            --accent-color: #01497c;
            --light-gray: #f8f9fa;
            --border-color: #eaeaea;
            --text-color: #333;
            --text-muted: #6c757d;
            --success-color: #28a745;
            --warning-color: #ffc107;
            --ecological-green: #198754;
            --ecological-yellow: #ffc107;
            --ecological-orange: #fd7e14;
            --ecological-red: #dc3545;
            --producer-color: #28a745;
            --primary-consumer-color: #ffc107;
            --secondary-consumer-color: #fd7e14;
            --tertiary-consumer-color: #dc3545;
            --decomposer-color: #6c757d;
        }
         
        .page-header {
            background: linear-gradient(135deg, rgba(169, 214, 229, 0.4) 0%, rgba(44, 125, 160, 0.4) 100%);
            padding: 1.5rem 0;
            margin-bottom: 2rem;
            border-bottom: 1px solid rgba(44, 125, 160, 0.2);
            position: relative;
            overflow: hidden;  color: var(--text-color);
        }
         
        .breadcrumb {
            background-color: transparent;
            padding: 0.5rem 0;
            margin-bottom: 0.5rem;
        }
        
        .breadcrumb-item a {
            color: var(--text-muted);
            text-decoration: none;
        }
        
        .breadcrumb-item.active {
            color: var(--text-color);
        }
         
        .ecological-info-box {
            background-color: rgba(25, 135, 84, 0.05);
            border-left: 3px solid var(--ecological-green);
            padding: 1rem;
            border-radius: 0 4px 4px 0;
            margin: 1.5rem 0;
        }
         
        /* Toggle switch for calculation modes */
        .calculation-modes {
            display: flex;
            background-color: var(--light-gray);
            border-radius: 6px;
            padding: 4px;
            margin-bottom: 1.5rem;
            flex-wrap: wrap;
        }
        
        .mode-btn {
            flex: 1;
            text-align: center;
            padding: 0.75rem;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.3s;
            font-weight: 600;
            min-width: 120px;
            margin: 2px;
        }
        
        .mode-btn.active {
            background-color: var(--primary-color);
            color: white;
        }
        
        /* Toast notifications */
        .toast-container {
            position: fixed;
            bottom: 20px;
            right: 20px;
            z-index: 1050;
        }
         
        /* Range slider styling */
        .form-range {
            width: 100%;
            height: 1rem;
            padding: 0;
            background-color: transparent;
            -webkit-appearance: none;
        }
        
        .form-range:focus {
            outline: none;
        }
        
        .form-range::-webkit-slider-thumb {
            width: 1rem;
            height: 1rem;
            margin-top: -0.5rem;
            background-color: var(--primary-color);
            border: 0;
            border-radius: 1rem;
            -webkit-appearance: none;
        }
        
        .form-range::-webkit-slider-runnable-track {
            width: 100%;
            height: 0.5rem;
            cursor: pointer;
            animate: 0.2s;
            background: var(--light-gray);
            border-radius: 0.5rem;
        }
        
        .slider-value {
            background-color: var(--primary-color);
            color: white;
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            font-size: 0.8rem;
            margin-left: 0.5rem;
        }
        
        /* Input group styling */
        .input-group {
            margin-bottom: 1rem;
        }
        
        /* Mode-specific form styling */
        .mode-form {
            display: none;
        }
        
        .mode-form.active {
            display: block;
        }
        
        /* Comparison table */
        .comparison-table {
            width: 100%;
            border-collapse: collapse;
            margin: 1.5rem 0;
        }
        
        .comparison-table th, .comparison-table td {
            padding: 0.75rem;
            text-align: left;
            border-bottom: 1px solid var(--border-color);
        }
        
        .comparison-table th {
            background-color: var(--light-gray);
            font-weight: 600;
        }
        
        .comparison-table tr:hover {
            background-color: rgba(44, 125, 160, 0.05);
        }
        
        /* Ecological-specific styling */
        .ecological-alert {
            background-color: rgba(220, 53, 69, 0.1);
            border-left: 4px solid var(--ecological-red);
            padding: 1rem;
            margin: 1rem 0;
            border-radius: 0 4px 4px 0;
        }
        
        .suitable-range {
            color: var(--ecological-green);
            font-weight: 600;
        }
        
        .unsuitable-range {
            color: var(--ecological-red);
            font-weight: 600;
        }
        
        .reference-table {
            width: 100%;
            border-collapse: collapse;
            margin: 1.5rem 0;
        }
        
        .reference-table th, .reference-table td {
            padding: 0.75rem;
            text-align: left;
            border: 1px solid var(--border-color);
        }
        
        .reference-table th {
            background-color: var(--light-gray);
            font-weight: 600;
        }
        
        .reference-table tr:nth-child(even) {
            background-color: rgba(44, 125, 160, 0.05);
        }
        
        .generating-indicator {
            display: none;
            text-align: center;
            padding: 1rem;
            color: var(--text-muted);
        }
        
        /* Food web specific styles */
        .foodweb-input-group {
            display: flex;
            align-items: center;
            margin-bottom: 1rem;
        }
        
        .foodweb-input {
            width: 150px;
            margin-right: 1rem;
        }
        
        .foodweb-classification {
            padding: 1rem;
            border-radius: 8px;
            margin: 1rem 0;
            border-left: 5px solid;
        }
        
        .foodweb-stable {
            background-color: rgba(40, 167, 69, 0.1);
            border-left-color: var(--ecological-green);
        }
        
        .foodweb-vulnerable {
            background-color: rgba(255, 193, 7, 0.1);
            border-left-color: var(--ecological-yellow);
        }
        
        .foodweb-unstable {
            background-color: rgba(253, 126, 20, 0.1);
            border-left-color: var(--ecological-orange);
        }
        
        .foodweb-collapse {
            background-color: rgba(220, 53, 69, 0.1);
            border-left-color: var(--ecological-red);
        }
        
        .foodweb-chart-container {
            position: relative;
            height: 500px;
            width: 100%;
            margin: 1.5rem 0;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            background-color: white;
        }
        
        .foodweb-status-indicator {
            display: inline-block;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            margin-right: 8px;
        }
        
        .status-stable {
            background-color: var(--ecological-green);
        }
        
        .status-vulnerable {
            background-color: var(--ecological-yellow);
        }
        
        .status-unstable {
            background-color: var(--ecological-orange);
        }
        
        .status-collapse {
            background-color: var(--ecological-red);
        }
        
        /* Species selector styling */
        .ecosystem-selector {
            margin-bottom: 1.5rem;
        }
        
        .ecosystem-option {
            padding: 0.75rem;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            margin-bottom: 0.5rem;
            cursor: pointer;
            transition: all 0.3s;
        }
        
        .ecosystem-option:hover {
            background-color: rgba(44, 125, 160, 0.05);
        }
        
        .ecosystem-option.selected {
            background-color: rgba(44, 125, 160, 0.1);
            border-color: var(--primary-color);
        }
        
        .ecosystem-icon {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: rgba(25, 135, 84, 0.1);
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 1rem;
            color: var(--ecological-green);
        }
        
        .parameter-slider {
            margin-bottom: 1.5rem;
        }
        
        .slider-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 0.5rem;
        }
        
        .slider-label {
            font-weight: 600;
        }
        
        .slider-value-display {
            color: var(--primary-color);
            font-weight: 600;
        }
        
        /* Species management */
        .species-management {
            margin-bottom: 1.5rem;
        }
        
        .species-item {
            display: flex;
            align-items: center;
            padding: 0.75rem;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            margin-bottom: 0.5rem;
            background-color: white;
        }
        
        .species-color {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            margin-right: 1rem;
        }
        
        .species-details {
            flex: 1;
        }
        
        .species-name {
            font-weight: 600;
            margin-bottom: 0.25rem;
        }
        
        .species-trophic {
            font-size: 0.9rem;
            color: var(--text-muted);
        }
        
        .species-actions {
            display: flex;
            gap: 0.5rem;
        }
        
        /* Trophic level colors */
        .trophic-producer {
            background-color: var(--producer-color);
        }
        
        .trophic-primary {
            background-color: var(--primary-consumer-color);
        }
        
        .trophic-secondary {
            background-color: var(--secondary-consumer-color);
        }
        
        .trophic-tertiary {
            background-color: var(--tertiary-consumer-color);
        }
        
        .trophic-decomposer {
            background-color: var(--decomposer-color);
        }
        
        /* Network visualization - FIXED CENTERING */
        #foodwebNetwork {
            width: 100%;
            height: 500px;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            background-color: white;
            display: flex;
            justify-content: center;
            align-items: center;
            overflow: hidden;
        }
        
        .network-wrapper {
            width: 100%;
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        
        /* Simulation controls */
        .simulation-controls {
            display: flex;
            gap: 1rem;
            margin: 1.5rem 0;
            flex-wrap: wrap;
        }
        
        .simulation-btn {
            flex: 1;
            min-width: 120px;
        }
        
        /* Energy flow table */
        .energy-table {
            width: 100%;
            border-collapse: collapse;
            margin: 1.5rem 0;
        }
        
        .energy-table th, .energy-table td {
            padding: 0.75rem;
            text-align: center;
            border: 1px solid var(--border-color);
        }
        
        .energy-table th {
            background-color: var(--light-gray);
            font-weight: 600;
        }
        
        .energy-table tr:nth-child(even) {
            background-color: rgba(44, 125, 160, 0.05);
        }
        
        /* Export button */
        .export-btn {
            margin-top: 1rem;
        }
        
        /* Modal styles for species editing */
        .modal-content {
            border-radius: 8px;
            border: none;
            box-shadow: 0 4px 20px rgba(0,0,0,0.15);
        }
        
        .modal-header {
            background-color: var(--light-gray);
            border-bottom: 1px solid var(--border-color);
            border-radius: 8px 8px 0 0;
        }
        
        .modal-footer {
            border-top: 1px solid var(--border-color);
            border-radius: 0 0 8px 8px;
        }
        
        /* Species form styling */
        .species-form-group {
            margin-bottom: 1rem;
        }
        
        .trophic-radio-group {
            display: flex;
            gap: 1rem;
            flex-wrap: wrap;
        }
        
        .trophic-radio-option {
            flex: 1;
            min-width: 120px;
        }
        
        .trophic-radio-option input[type="radio"] {
            display: none;
        }
        
        .trophic-radio-option label {
            display: block;
            padding: 0.75rem;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s;
        }
        
        .trophic-radio-option input[type="radio"]:checked + label {
            background-color: rgba(44, 125, 160, 0.1);
            border-color: var(--primary-color);
            color: var(--primary-color);
            font-weight: 600;
        }
        
        .trophic-color-indicator {
            width: 16px;
            height: 16px;
            border-radius: 50%;
            display: inline-block;
            margin-right: 0.5rem;
        }
        
        /* Responsive adjustments for network */
        @media (max-width: 992px) {
            #foodwebNetwork {
                height: 400px;
            }
        }
        
        @media (max-width: 768px) {
            #foodwebNetwork {
                height: 300px;
            }
            
            .species-item {
                flex-direction: column;
                align-items: flex-start;
            }
            
            .species-actions {
                margin-top: 0.5rem;
                width: 100%;
                justify-content: flex-end;
            }
        }
        
        /* Loading animation for simulation */
        @keyframes pulse {
            0% { opacity: 1; }
            50% { opacity: 0.5; }
            100% { opacity: 1; }
        }
        
        .simulating {
            animation: pulse 1.5s infinite;
        }
        
        /* Connection visualization improvements */
        .connection-strength {
            display: inline-block;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            margin-right: 5px;
        }
        
        .strength-weak {
            background-color: var(--ecological-green);
        }
        
        .strength-medium {
            background-color: var(--ecological-yellow);
        }
        
        .strength-strong {
            background-color: var(--ecological-orange);
        }
    