body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    background-color: #eef;
    color: #333;
    line-height: 1.6;
}

/* Header Styles */
#main-header {
    background-color: #2a52be;
    color: white;
    width: 100%;
    padding: 20px 0;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
    position: relative;
}

#main-header .header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
}

#main-header h1 {
    margin: 0 0 10px 0;
    font-size: 3em;
    color: white;
}

#team-identifier {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 1px;
}

/* Container for header navigation buttons */
.header-buttons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Quiz Navigation Button */
.quiz-navigate-btn {
    background-color: #e67e22 !important; /* Orange */
    padding: 15px 30px !important;
    font-size: 1.2em !important;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: white;
    transition: background-color 0.3s ease;
}

.quiz-navigate-btn:hover {
    background-color: #d35400 !important;
}

/* About Navigation Button - UPDATED COLOR */
.about-navigate-btn {
    background-color: #27ae60 !important; /* Green */
    padding: 15px 30px !important;
    font-size: 1.2em !important;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: white;
    transition: background-color 0.3s ease;
}

.about-navigate-btn:hover {
    background-color: #219d54 !important; /* Darker green for hover */
}

/* Back button for quiz.html and about.html headers */
.back-to-sim-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: #5cb85c; /* Green color */
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}

.back-to-sim-btn:hover {
    background-color: #4cae4c;
}

.simulation-container {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    width: 90%;
    max-width: 1200px;
    background-color: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 40px;
}

.source-beakers {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
}

.beaker {
    width: 100px;
    height: 150px;
    border: 2px solid #aaa;
    border-top: none;
    border-radius: 0 0 15px 15px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    background-color: #f8f8f8;
    box-shadow: inset 0 -5px 10px rgba(0, 0, 0, 0.05);
}

.beaker::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background-color: #aaa;
    border-radius: 5px 5px 0 0;
}

.beaker p {
    margin-top: 10px;
    font-weight: bold;
    color: #666;
    text-align: center;
    font-size: 0.9em;
}

.large-beaker {
    width: 180px;
    height: 250px;
}

.liquid {
    width: 100%;
    height: 0; /* JS controls this */
    transition: height 0.5s ease-out, background-color 0.8s ease-in-out;
}

/* Base liquid colors for source beakers */
.acid-liquid { background-color: #ff4d4d; /* Red for acid */ }
.base-liquid { background-color: #4da6ff; /* Blue for base */ }
.neutral-liquid { background-color: #90ee90; /* Default/initial neutral */ }

/* pH-specific colors for the mixed liquid */
.ph-1, .ph-2 { background-color: #ff0000; } /* Strong Acid: Red */
.ph-3 { background-color: #ff4d4d; }
.ph-4 { background-color: #ff8000; }
.ph-5 { background-color: #ffbf00; }
.ph-6 { background-color: #ffff00; } /* Weak Acid: Yellow */
.ph-7 { background-color: #90ee90; } /* Neutral: Light Green */
.ph-8 { background-color: #87ceeb; } /* Light Blue */
.ph-9 { background-color: #4da6ff; }
.ph-10 { background-color: #0080ff; }
.ph-11 { background-color: #004dff; }
.ph-12 { background-color: #0000ff; } /* Strong Base: Blue */
.ph-13, .ph-14 { background-color: #8a2be2; } /* Very Strong Base: Violet/Purple */


.mixing-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.buttons {
    margin-top: 25px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.buttons button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.buttons button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.buttons button:active {
    background-color: #004080;
    transform: translateY(0);
}


.ph-display {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ph-meter-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ph-meter {
    width: 40px;
    height: 250px;
    background: linear-gradient(to top,
        #ff0000, #ff4d4d, #ff8000, #ffbf00, #ffff00, /* Acidic (1-6) */
        #90ee90, /* Neutral (7) */
        #87ceeb, #4da6ff, #0080ff, #004dff, #0000ff, #8a2be2 /* Basic (8-14) */
    );
    border: 1px solid #ccc;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

.ph-bar {
    width: 100%;
    height: 0; /* JS controls this */
    background-color: rgba(255, 255, 255, 0.5); /* Semi-transparent white indicator */
    position: absolute;
    bottom: 0;
    transition: height 0.8s ease-out;
    border-top: 1px solid rgba(0,0,0,0.2); /* A subtle line at the top of the fill */
}

.ph-scale-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 250px; /* Match ph-meter height */
    font-size: 0.9em;
    font-weight: bold;
    color: #666;
    text-align: right;
}

.ph-scale-labels span:nth-child(1) { /* 14 */
    align-self: flex-end;
    margin-top: -10px; /* Adjust vertical position */
}
.ph-scale-labels span:nth-child(2) { /* 7 */
    align-self: flex-end;
    transform: translateY(-50%);
}
.ph-scale-labels span:nth-child(3) { /* 1 */
    align-self: flex-end;
    margin-bottom: -10px; /* Adjust vertical position */
}


#current-ph {
    font-size: 1.4em;
    font-weight: bold;
    color: #444;
    margin-top: 20px;
}

/* Litmus Paper Section Styles */
.litmus-section {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    width: 100%; /* Ensure it spans available width */
    max-width: fit-content; /* Adjust to content size */
}

.litmus-section h2 { /* Styling for the main "Litmus Paper Test" heading */
    color: #33a532; /* Green for litmus section */
    margin-bottom: 20px;
    font-size: 1.8em;
}

.litmus-papers-container { /* Container for both litmus papers */
    display: flex;
    justify-content: center; /* Center the two papers */
    gap: 30px; /* Space between the two paper wrappers */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.litmus-paper-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 15px;
    width: 150px; /* Define a fixed width for each wrapper */
}

.litmus-paper-wrapper h3 { /* Sub-heading for each paper type */
    color: #555;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.litmus-display-wrapper {
    width: 100px; /* Overall width of the paper visual */
    height: 40px; /* Overall height of the paper visual */
    margin: 0 auto 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
}

.litmus-paper { /* This is now the actual color-changing element */
    width: 100%;
    height: 100%;
    transition: background-color 0.5s ease-in-out;
}

/* NEW: Common Acids and Bases Section Styles (Moved from the previous response) */
.info-lists-section {
    text-align: center;
    margin-top: 40px; /* More space above this section */
    padding: 25px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.info-lists-section h2 {
    color: #2a52be; /* Match primary blue heading color */
    font-size: 2em;
    margin-bottom: 25px;
}

.lists-container {
    display: flex;
    justify-content: center;
    gap: 30px; /* Space between the two list boxes */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.list-box {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    flex: 1; /* Allow boxes to grow and shrink */
    min-width: 280px; /* Minimum width before wrapping */
    max-width: 400px; /* Maximum width to prevent them from becoming too wide */
    text-align: left;
}

.list-box h3 {
    font-size: 1.5em;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid; /* Dynamic border color */
}

.acid-list h3 {
    color: #cc3333; /* Red for acids */
    border-color: #cc3333;
}

.base-list h3 {
    color: #3366cc; /* Blue for bases */
    border-color: #3366cc;
}

.list-box ul {
    list-style-type: none; /* Remove default bullet points */
    padding: 0;
    margin: 0;
}

.list-box li {
    margin-bottom: 8px;
    font-size: 1em;
    display: flex; /* For custom bullet points */
    align-items: flex-start;
}

.list-box li::before {
    content: '•'; /* Custom bullet point */
    color: #777;
    margin-right: 8px;
    font-weight: bold;
}


/* --- Media Queries for Responsiveness --- */

/* For screens smaller than 768px (common breakpoint for tablets/mobiles) */
@media (max-width: 768px) {
    /* Header Adjustments */
    #main-header .header-content {
        padding: 15px 10px;
    }
    #main-header h1 {
        font-size: 2em; /* Smaller font size for main heading */
        margin-bottom: 10px;
    }
    #team-identifier {
        font-size: 0.9em; /* Smaller font size for team identifier */
        margin-bottom: 10px;
    }
    .header-buttons {
        flex-direction: column; /* Stack buttons vertically on small screens */
        gap: 10px; /* Reduce gap */
    }
    .quiz-navigate-btn, .about-navigate-btn {
        width: 80%; /* Make buttons take more width */
        max-width: 250px; /* Limit their max width */
        padding: 10px 20px !important;
        font-size: 1em !important;
    }
    .back-to-sim-btn {
        top: 10px; /* Adjust position for smaller header */
        left: 10px;
        padding: 6px 12px;
        font-size: 0.8em;
    }


    /* Simulation Container */
    .simulation-container {
        flex-direction: column; /* Stack sections vertically */
        align-items: center; /* Center items in the column */
        padding: 15px;
        width: 95%; /* Take up more width on smaller screens */
        gap: 20px; /* Reduce gap between sections */
    }

    /* Source Beakers (Acid/Base) */
    .source-beakers {
        flex-direction: row; /* Keep them side-by-side but reduce gap */
        justify-content: center;
        gap: 15px;
        width: 100%;
    }
    .beaker {
        width: 80px; /* Smaller beakers */
        height: 120px;
    }
    .large-beaker {
        width: 150px; /* Smaller mixing beaker */
        height: 200px;
    }
    .beaker p {
        font-size: 0.75em; /* Smaller text below beakers */
    }

    /* Buttons */
    .buttons button {
        padding: 10px 20px; /* Smaller buttons */
        font-size: 1em;
    }

    /* pH Display */
    .ph-meter-wrapper {
        align-items: flex-start; /* Align meter to top of labels */
        gap: 5px;
    }
    .ph-meter, .ph-scale-labels {
        height: 200px; /* Adjust height for smaller screens */
    }
    .ph-scale-labels span {
        font-size: 0.8em; /* Smaller pH labels */
    }
    #current-ph {
        font-size: 1.2em; /* Smaller pH value display */
    }

    /* Litmus Section */
    .litmus-section {
        padding: 10px;
        max-width: 95%; /* Adjust max-width for better fit */
    }
    .litmus-section h2 {
        font-size: 1.5em; /* Smaller main litmus heading */
        margin-bottom: 15px;
    }
    .litmus-papers-container {
        flex-direction: column; /* Stack papers vertically on small screens */
        gap: 20px; /* Space between stacked papers */
    }
    .litmus-paper-wrapper {
        width: 100%; /* Allow wrapper to take full width */
        max-width: 180px; /* Limit individual paper wrapper width */
        margin: 0 auto 15px; /* Center and add bottom margin */
    }
    .litmus-paper-wrapper h3 {
        font-size: 1em; /* Smaller sub-heading */
    }
    .litmus-display-wrapper {
        width: 80px; /* Smaller litmus paper visual */
        height: 30px;
        margin: 0 auto 8px;
    }

    /* Responsive adjustments for info-lists-section */
    .info-lists-section {
        margin-top: 30px;
        padding: 15px;
    }

    .info-lists-section h2 {
        font-size: 1.6em;
        margin-bottom: 20px;
    }

    .lists-container {
        flex-direction: column; /* Stack boxes vertically on small screens */
        gap: 20px; /* Space between stacked boxes */
        align-items: center; /* Center stacked boxes */
    }

    .list-box {
        min-width: unset; /* Remove min-width override for small screens */
        width: 90%; /* Take up more width on small screens */
        max-width: 350px; /* Max width for stacked boxes */
        padding: 15px;
    }
    .list-box h3 {
        font-size: 1.3em;
    }
    .list-box li {
        font-size: 0.95em;
    }
}

/* Optional: Even smaller screens (e.g., very small phones) */
@media (max-width: 480px) {
    #main-header h1 {
        font-size: 1.8em;
    }
    .quiz-navigate-btn, .about-navigate-btn {
        padding: 8px 15px !important;
        font-size: 0.9em !important;
    }
    .simulation-container {
        padding: 10px;
        gap: 15px;
    }
    .beaker {
        width: 70px;
        height: 100px;
    }
    .large-beaker {
        width: 130px;
        height: 180px;
    }
    .buttons button {
        padding: 8px 15px;
        font-size: 0.9em;
    }
    .ph-meter, .ph-scale-labels {
        height: 180px;
    }
    .info-lists-section h2 {
        font-size: 1.4em;
    }
    .list-box {
        padding: 12px;
    }
    .list-box h3 {
        font-size: 1.2em;
    }
    .list-box li {
        font-size: 0.9em;
    }
}