:root {
    --dark-green: #006400;
    --light-green: #90EE90;
    --text-color: #333;
    --bg-color: #f8f9fa;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .table-responsive {
        margin: 0 -1rem;
        padding: 0 1rem;
    }
    
    .slider-container {
        padding-right: 2.5rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group > * {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .badge {
        width: auto;
        white-space: normal;
        text-align: right;
    }
}

h1 {
    font-size: 2.5rem;
    font-weight: 600;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.help-icon {
    width: 16px;
    height: 16px;
    margin-left: 0.5rem;
    cursor: pointer;
}

.slider-container {
    position: relative;
    padding-right: 3rem;
}

.slider-value {
    position: absolute;
    right: 0;
    top: 0;
    font-weight: 500;
}

.form-control, .form-select {
    background-color: white !important;
    color: black !important;
    border: 2px solid var(--dark-green) !important;
    border-radius: 4px;
    padding: 0.5rem;
}

.form-range {
    accent-color: var(--dark-green);
}

/* Subprocess checkboxes styling */
.subprocess-checkbox {
    margin-right: 0.5rem;
}

.form-check {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.form-check:hover {
    background-color: rgba(0, 100, 0, 0.1);
}

.form-check-input:checked {
    background-color: var(--dark-green);
    border-color: var(--dark-green);
}

/* Webkit (Chrome, Safari, newer versions of Opera) */
.form-range::-webkit-slider-thumb {
    background: var(--dark-green);
}

.form-range::-webkit-slider-runnable-track {
    background: var(--light-green);
    height: 8px;
    border-radius: 4px;
}

/* Mozilla Firefox */
.form-range::-moz-range-thumb {
    background: var(--dark-green);
}

.form-range::-moz-range-track {
    background: var(--light-green);
    height: 8px;
    border-radius: 4px;
}

/* Microsoft Edge and IE */
.form-range::-ms-thumb {
    background: var(--dark-green);
}

.form-range::-ms-track {
    background: var(--light-green);
    height: 8px;
    border-radius: 4px;
}

.btn-primary {
    background-color: var(--dark-green);
    border: none;
    padding: 0.75rem 2rem;
    font-weight: 500;
}

.btn-primary:hover {
    background-color: #005000;
}

/* Disabled slider styling */
.form-range:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Formula styles */
code {
    display: block;
    padding: 0.75rem;
    background-color: rgba(0, 100, 0, 0.1);
    border-radius: 4px;
    font-family: monospace;
    margin: 0.5rem 0;
    white-space: pre-wrap;
    line-height: 1.6;
    font-size: 1rem;
}

.formula-section {
    margin-bottom: 1.5rem;
}

.formula-section:last-child {
    margin-bottom: 0;
}

/* Mathematical symbols */
code .sum {
    font-size: 1.5em;
    font-weight: bold;
    font-family: "Times New Roman", serif;
    margin: 0 0.5rem;
    color: var(--bs-primary);
}

.card-body h4.h6 {
    color: var(--bs-primary);
    margin-top: 1.5rem;
}

.card-body h4.h6:first-child {
    margin-top: 0;
}

/* Chatbot styles - Green Design like the reference image */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 55px;
    height: 55px;
    background-color: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: all 0.3s ease;
    border: 2px solid #67B04F;
}

.chatbot-container.open {
    width: 350px;
    height: 520px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    border: none;
}

.chatbot-icon {
    color: #67B04F;
    font-size: 24px;
}

.chatbot-container.open .chatbot-icon {
    display: none;
}

.chatbot-content {
    display: none;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background-color: #FFFFFF;
    border-radius: 15px;
    overflow: hidden;
}

.chatbot-container.open .chatbot-content {
    display: flex;
}

.chatbot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #67B04F;
    padding: 15px 20px;
}

.chatbot-header-text {
    display: flex;
    flex-direction: column;
}

.chatbot-title {
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.chatbot-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 400;
}

.chatbot-settings {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
}

.chatbot-close {
    position: absolute;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #67B04F;
    border: none;
    color: white;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    transition: all 0.2s;
}

.chatbot-close:hover {
    background-color: #5a9845;
}

.chatbot-expand {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: #E04D36;
    border: none;
    color: white;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.chatbot-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: white;
}

.chatbot-input-container {
    display: flex;
    padding: 10px 15px;
    background-color: #F7F7F7;
    border-top: 1px solid #EBEBEB;
}

.chatbot-input {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid #E5E5E5;
    border-radius: 30px;
    background-color: white;
    color: #333;
    font-size: 14px;
}

.chatbot-input:focus {
    outline: none;
    border-color: #67B04F;
    box-shadow: 0 0 0 2px rgba(103, 176, 79, 0.2);
}

.chatbot-send {
    width: 45px;
    height: 45px;
    margin-left: 10px;
    border-radius: 50%;
    background-color: #8DC86A;
    color: white;
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.chatbot-send:hover {
    background-color: #7AB759;
}

.message {
    margin-bottom: 15px;
    max-width: 85%;
    padding: 10px 15px;
    border-radius: 15px;
    line-height: 1.5;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.user-message {
    background-color: #F7F7F7;
    color: #333;
    align-self: flex-end;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.assistant-message {
    background-color: #67B04F;
    color: white;
    border-bottom-left-radius: 5px;
}

.loading-indicator {
    display: flex;
    justify-content: center;
    margin: 15px 0;
}

.dot {
    width: 8px;
    height: 8px;
    margin: 0 4px;
    background-color: #67B04F;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes pulse {
    0%, 80%, 100% {
        transform: scale(0.7);
    }
    40% {
        transform: scale(1.0);
    }
}

.chatbot-container.expanded {
    width: 420px;
    height: 600px;
}

/* Markdown styling in chatbot */
.assistant-message {
    line-height: 1.5;
}

.chatbot-heading {
    margin: 8px 0 5px 0;
    color: #003b00; /* Darker green that's more readable */
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid rgba(103, 176, 79, 0.3);
    padding-bottom: 3px;
}

.chatbot-list {
    margin: 5px 0;
    padding-left: 20px;
}

.chatbot-list-item {
    margin-bottom: 3px;
}

.assistant-message {
    color: #333333; /* Dark gray text instead of green */
}

.assistant-message p {
    margin: 0 0 8px 0;
    color: #333333; /* Ensure all paragraph text is dark gray */
}

.assistant-message strong, 
.assistant-message b {
    color: #003b00; /* Darker green for bold text */
    font-weight: 600;
}

.chatbot-code {
    background-color: rgba(103, 176, 79, 0.1);
    color: #333333;
    padding: 1px 3px;
    border-radius: 3px;
    font-family: monospace;
    white-space: pre-wrap;
}

.assistant-message a {
    color: #004d00; /* Darker green for links */
    text-decoration: underline;
}

/* DRUID logo styling in chatbot */
.chatbot-logo-container {
    text-align: right;
    margin-bottom: 8px;
}

.chatbot-druid-logo {
    height: 24px;
    width: auto;
    opacity: 0.85;
    margin-left: auto;
    display: block;
}

/* Debug mode indicator */
.chatbot-settings.active {
    background-color: #ffc107 !important;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.6);
}

/* Toast notification */
.chatbot-toast {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    z-index: 2000;
    font-size: 14px;
    max-width: 300px;
    animation: fadeIn 0.3s ease-in, fadeOut 0.3s ease-out 2.7s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
}

/* Navigation bar styling */
.navbar {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

.navbar-brand img {
    transition: transform 0.2s ease;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.nav-link {
    color: #333 !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #7AC143;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-item.active .nav-link::after {
    width: 100%;
}

.nav-item.active .nav-link {
    color: #006400 !important;
}
