/* --- General Body and Typography --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0; /* Removed default margin */
    background-color: #f8f9fa; /* Slightly off-white for comfort */
    color: #333;
    line-height: 1.6;
}

main {
    max-width: 900px;
    margin: 2em auto;
    padding: 0 0em;
    justify-content: center;
}

h1, h2, h3 {
    line-height: 1.2;
}

h2 {
    text-align: center;
    margin-top: 3em;
    margin-bottom: 1.5em;
    color: #495057;
}

a {
    color: #0056b3;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
    padding-left: 0;
}

li {
    margin-bottom: 0.5em;
}

/* --- Hero Section --- */
.hero {
    text-align: center;
    background-color: #343a40; /* Dark background */
    color: white;
    padding: 4rem 1rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 1.5rem auto;
    color: #e9ecef; /* Lighter text color */
}

/* --- Call to Action Button --- */
.cta-button {
    display: inline-block;
    padding: 12px 25px;
    border: none;
    background-color: #6153cc; /* Primary brand color */
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.2s ease-in-out;
}

.cta-button:hover {
    background-color: #4d42a3; /* Darker shade on hover */
    text-decoration: none;
}

/* --- Card Layout --- */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* Responsive grid */
    gap: 20px;
}

.card {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.card h3 {
    margin-top: 0;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* Style for the "coming soon" card */
.card.upcoming {
    background-color: #f8f9fa;
    text-align: center;
    color: #6c757d;
}

.card.upcoming h3 {
    border-bottom: none;
}

/* counts on main page */
.problem-count {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background-color: #e9ecef; /* A light grey background */
    color: #6c757d;           /* Muted text color */
    font-size: 0.75em;        /* Smaller font size */
    font-weight: 600;
    border-radius: 10px;      /* Pill shape */
    vertical-align: middle;   /* Aligns it nicely with the text */
}

/* Make each list item a flex container to align items easily */
.card ul li {
    display: flex;
    flex-wrap: wrap;       /* This is crucial to allow wrapping */
    align-items: center;
    row-gap: 0.2em;        /* Controls the small vertical space between the lines */
    column-gap: 0.5em;     /* Controls space between [problems] and [key] */
    margin-bottom: 1.2em;    /* Controls space between each topic entry */
}

.card ul li a:first-child {
    flex-basis: 100%;      /* This forces the first link to take the full width */
}

.secondary-links {
    display: inline-flex;  /* Treats the span as a flex container */
    align-items: center;   /* Vertically aligns the text and links */
    gap: 0.3em;            /* Creates perfect, even spacing between items */
    color: #6c757d;        /* Sets the color for non-link text like "or" */
}

.secondary-links a {
    text-decoration: underline;
    font-weight: 600;      /* Makes the links bold */
    color: #0056b3;        /* Ensures links have the default link color */
}

.secondary-links a:hover {
    color: #003d82;        /* Darkens the link color on hover */
}

/* --- Footer --- */
footer { 
    text-align: center; 
    padding: 2em 0;
    color: #6c757d;
    margin-top: 4em;
}

/* from original css */

button {
    padding: 10px 20px;
    border: none;
    background-color: #6153cc;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
}

#guess-controls { margin: 0 0 0 0; }

#guess-controls button { padding: 10px 30px; }

#skip-next-btn { background-color: #bbc8ca; min-width: 120px; }

#feedback-message { height: 30px; font-size: 1.2rem; font-weight: bold; }

.correct, .correct-value { color: #28a745; }

.incorrect, .incorrect-value { color: #dc3545; }

/* responsive mode */
@media (max-width: 650px) {
    #structures {
        flex-direction: column; /* Stack the viewers vertically */
        align-items: center;    /* Center them in the column */
    }
}

.score-container-global {
    text-align: center;
    padding: 5px;
/*  border: 1px solid #ced4da;
    border-radius: 10px;
    background-color: #f8f9fa;
*/
}

.score-container-global h3 {
    margin: 0 0 10px 0; /* No top margin, 10px bottom margin */
    font-size: 1rem;
    font-weight: 600;
    color: #6c757d;
}

.score-badges {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.score-container-badges {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.score-badge {
    display: inline-block;
    padding: 5px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 20px; /* This creates the pill shape */
}

.score-badge strong {
    font-size: 1rem;
}

.container {
    max-width: 800px;
    margin: 2em auto; /* Centers the container on the page */
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#structures { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }

.viewer-canvas, .viewer-container {
    width: 300px;
    height: 300px;
    position: relative;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center; 
}

#rdkit-loader-text {
    z-index: 10;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 12px 24px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-family: sans-serif;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    display: none;
}

/* for MW sliders */
.filters fieldset {
    border-radius: 8px;
    width: 300px;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 10px; /* Adjust spacing as needed */
    margin-top: 5px;
}

#mw-slider {
    flex-grow: 1; /* Allows the slider to fill the space */
}

.range-label {
    color: #6c757d; /* A muted text color */
    font-size: 0.9em;
}

.sub-fix {
    margin: 0 !important;
    padding: 0 !important;
}

.back-link {
    width: 100%; /* Make it span the full width */
    margin-bottom: 0rem; /* Space between nav and main heading */
    text-align: left;
}

/* Style for the link itself */
.back-link a {
    text-decoration: none; /* Remove the underline */
    color: #007bff; /* A standard link blue, change as needed */
    font-weight: 500;
}

/* Optional: Change color on hover for better feedback */
.back-link a:hover {
    text-decoration: underline;
}