/* Calculator Styles */

:root {
    --dark-green: #386641;
    --medium-green: #6A994E;
    --light-green-bg: #A7C957;
    --cta-teal: #45b39d;
    --primary-button-color: #DBBA33;
    --white: #FFFFFF;
    --text-dark: #2c3e50;
    --border-color: #cccccc;
    --hero-bg-start: #dde5db;
    --card-hover: #f5f9f2;
    --card-selected: #e6f0e0;
    --formula-bg: #f8f9fa;
}

.impact-page-content {
    padding: 80px 0 40px 0; /* Increased top padding to prevent header overlap */
}

.impact-page-content h1 {
    color: var(--dark-green);
    text-align: center;
    margin-top: 40px;
    margin-bottom: 15px;
}

.impact-page-content > .container > p {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px;
    font-size: 1.1em;
    line-height: 1.6;
    color: var(--text-dark);
}

/* Calculator Container */
.calculator-container {
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 30px;
    margin-bottom: 40px;
}

.calculator-header {
    text-align: center;
    margin-bottom: 30px;
}

.calculator-header h2 {
    color: var(--dark-green);
    font-size: 1.8em;
    margin-bottom: 10px;
}

.calculator-header p {
    color: var(--text-dark);
    font-size: 1.1em;
}

/* Offset Cards */
.offset-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.offset-card {
    background-color: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.offset-card:hover {
    border-color: var(--medium-green);
    background-color: var(--card-hover);
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.offset-card.selected {
    border-color: var(--dark-green);
    background-color: var(--card-selected);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

.card-amount {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--dark-green);
    text-align: center;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.card-equivalent h3 {
    font-size: 1em;
    color: var(--text-dark);
    margin-bottom: 8px;
    text-align: center;
}

.card-equivalent p {
    font-size: 0.9em;
    color: var(--text-dark);
    text-align: center;
    line-height: 1.4;
}

/* Custom Amount Card */
.custom-amount-card {
    cursor: default; /* Override the pointer cursor from offset-card */
}

.custom-amount-card .card-amount label {
    font-weight: bold;
    color: var(--dark-green);
    margin: 0;
    display: block;
    text-align: center;
    line-height: 1.2;
}

.custom-input-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

#custom_co2_input {
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9em;
    text-align: center;
    transition: border-color 0.3s ease;
}

#custom_co2_input:focus {
    outline: none;
    border-color: var(--medium-green);
}

#calculate_custom_button {
    background-color: var(--primary-button-color);
    color: var(--white);
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    font-size: 0.9em;
}

#calculate_custom_button:hover {
    background-color: var(--accent-color); /* Use the same hover color as other buttons */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Results Container */
.results-container {
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 30px;
    margin-bottom: 40px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.results-header h2 {
    color: var(--dark-green);
    font-size: 1.8em;
    margin: 0;
}

.back-button {
    background: none;
    border: none;
    color: var(--medium-green);
    cursor: pointer;
    font-size: 1em;
    transition: color 0.3s ease;
}

.back-button:hover {
    color: var(--dark-green);
    text-decoration: underline;
}

.results-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.results-bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* Formula Section */
.formula-section {
    grid-column: span 2;
    background-color: var(--formula-bg);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.formula-section h3 {
    color: var(--dark-green);
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.4em;
    text-align: center;
}

.formula-explanation {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.formula-step {
    background-color: var(--white);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    min-width: 200px;
    display: flex;
    gap: 15px;
}

.step-number {
    background-color: var(--medium-green);
    color: var(--white);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--dark-green);
    font-size: 1.1em;
}

.formula-detail {
    font-size: 0.85em;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.formula-value {
    font-weight: bold;
    font-size: 1.2em;
    color: var(--dark-green);
    margin-top: 10px;
}

.formula-arrow {
    font-size: 1.8em;
    color: var(--medium-green);
    font-weight: bold;
}

.result-step {
    border: 2px solid var(--dark-green);
}

/* Visualization Section */
.visualization-section {
    /* No longer spans 2 columns */
}

.visualization-section h3 {
    color: var(--dark-green);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.4em;
}

#forest_visualization_canvas_container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #e0e8da;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
    max-height: 250px; /* Limit height */
    min-height: 200px; /* Ensure minimum height */
}

.hectare-info {
    text-align: center;
    font-size: 0.9em;
    color: var(--text-dark);
}

/* Donation Section */
.donation-section {
    background-color: var(--medium-green);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.donation-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.6em;
}

.donation-section p {
    font-size: 1.2em;
    margin-bottom: 25px;
}

.donate-button {
    display: inline-block;
    background-color: var(--primary-button-color);
    color: var(--white);
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.2em;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.donate-button:hover {
    background-color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    color: var(--white);
}

/* Responsive Adjustments */
@media (max-width: 900px) {
    .results-bottom-row {
        grid-template-columns: 1fr;
    }
    
    .formula-explanation {
        flex-direction: column;
    }
    
    .formula-arrow {
        transform: rotate(90deg);
    }
    
    #forest_visualization_canvas_container {
        max-height: none;
    }
}

@media (max-width: 600px) {
    .offset-cards {
        grid-template-columns: 1fr;
    }
    
    .custom-input-container {
        gap: 15px;
    }
    
    #custom_co2_input {
        text-align: left;
    }
    
    #calculate_custom_button {
        padding: 15px 20px;
    }
    
    .results-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

/* Reuse existing styles for carbon emissions and tree species sections */
.carbon-emissions-section,
.tree-species-info-section {
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

.carbon-emissions-section::before,
.tree-species-info-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(to right, var(--dark-green), var(--medium-green), var(--light-green-bg));
}

.carbon-emissions-section {
    background-color: #f0f7f4;
    margin-bottom: 30px;
}

.carbon-emissions-section h2 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--dark-green);
    font-size: 1.8em;
}

.tree-species-info-section {
    background-color: #f5f9f2;
}

/* Additional styles for emissions table */
.emissions-table {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
}

.emissions-table table {
    width: 100%;
    border-collapse: collapse;
}

.emissions-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #eaeaea;
    font-size: 0.9em;
    line-height: 1.4;
}

.emissions-table tr:last-child td {
    border-bottom: none;
}

.emissions-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.emissions-table td:first-child {
    width: 70%;
}

.emissions-table td:last-child {
    width: 30%;
    text-align: right;
    font-weight: bold;
    color: var(--dark-green);
}

/* Species grid styles */
.species-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.species-card {
    background-color: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.species-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.species-image {
    height: 180px;
    overflow: hidden;
}

.species-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.species-card:hover .species-image img {
    transform: scale(1.05);
}

.species-content {
    padding: 20px;
    flex: 1;
}

.species-card h3 {
    color: var(--dark-green);
    margin-bottom: 12px;
    font-size: 1.3em;
    border-bottom: 2px solid var(--light-green-bg);
    padding-bottom: 8px;
}

.species-card p {
    color: var(--text-dark);
    font-size: 0.95em;
    line-height: 1.6;
}

.strategy-note {
    background-color: var(--white);
    border-radius: 12px;
    padding: 35px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin: 40px auto;
    max-width: 900px;
    position: relative;
    overflow: hidden;
}

.strategy-note::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, var(--cta-teal), var(--medium-green));
}

.strategy-note h3 {
    color: var(--dark-green);
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5em;
    position: relative;
    padding-bottom: 15px;
}

.strategy-note h3::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background-color: var(--medium-green);
}

.strategy-note p {
    color: var(--text-dark);
    line-height: 1.7;
    font-size: 1.05em;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}