/* Base styles from original */
body { /* Note: These body styles might be overridden by the theme. Scope if needed */
    font-family: sans-serif;
     /* Removed display: flex; align-items:center; etc. - let the theme handle page layout */
     /* background-color: #f4f4f4; /* Theme controls background */
}

/* Container for the whole plugin UI */
#interactive-soroban-plugin-container {
    margin: 20px auto;
    padding: 15px;
    border: 1px solid #ddd;
    background-color: #fff;
    max-width: 800px; /* Adjust as needed */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center; /* Center content within the container */
}

#interactive-soroban-plugin-container h2 {
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.isa-controls fieldset {
    border: 1px solid #ccc;
    padding: 10px 15px;
    margin-bottom: 15px;
    text-align: left;
}
.isa-controls legend {
    font-weight: bold;
    padding: 0 5px;
}
.isa-controls label {
    display: block; /* Each radio on its own line */
    margin-bottom: 5px;
    cursor: pointer;
}
.isa-controls input[type="radio"] {
    margin-right: 5px;
}


#isa-display { /* Renamed ID for uniqueness */
    font-size: 2em;
    margin: 0 auto 20px auto; /* Center the display */
    padding: 10px 20px;
    border: 1px solid #ccc;
    background-color: white;
    min-width: 200px; /* Wider for decimals */
    max-width: 90%;
    text-align: right;
    font-family: monospace; /* Good for numbers */
}

.abacus {
    display: flex;
    justify-content: center; /* Center the columns */
    border: 10px solid #8B4513;
    padding: 20px 10px 10px 10px;
    background-color: #DEB887;
    border-radius: 5px;
    position: relative;
    overflow: hidden; /* Hide any potential overflow */
    margin: 0 auto; /* Center the abacus */
    width: fit-content; /* Size to content */
}

.abacus::before { /* Top beam */
    content: '';
    position: absolute;
    top: 10px;
    left: 0;
    right: 0;
    height: 10px;
    background-color: #8B4513;
    z-index: 2; /* Above beads/rods */
}

.column {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 5px;
    background-color: transparent; /* Make column background transparent */
    width: 40px;
    position: relative; /* Needed for positioning pseudo-elements */
}

/* The black rod using a pseudo-element */
.column::before {
    content: '';
    position: absolute;
    left: 50%; /* Center horizontally */
    transform: translateX(-50%); /* Adjust horizontal centering */
    top: 0; /* Start from the top */
    bottom: 0; /* Go to the bottom */
    width: 4px; /* Thickness of the rod */
    background-color: #333; /* Dark grey/black for the rod */
    z-index: 0; /* Place it behind beads */
    border-radius: 2px; /* Slightly rounded ends */
}

/* === REMOVED: Old unit rod marker rule that was here === */


.bead {
    width: 35px;
    height: 20px;
    background-image: linear-gradient(to bottom, #FFD700, #DAA520);
    border-radius: 30%;
    margin: 4px 0;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, background-image 0.2s ease-in-out;
    border: 1px solid #a17d1a;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3),
                inset 0 -1px 1px rgba(0, 0, 0, 0.2);
    position: relative; /* Needed for z-index */
    z-index: 1;         /* Stack above pseudo-element rod */
}

.heavenly-section {
    padding-bottom: 25px;
    /* === MODIFIED: Made the bar thicker === */
    border-bottom: 11px solid #8B4513; /* The Reckoning Bar */
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
    position: relative; /* Needed for dot positioning */
    z-index: 1;
}

/* === ADDED: New rule for unit rod marker ON the reckoning bar === */
.column.unit-rod .heavenly-section::after {
    content: '';
    position: absolute;
    /* Position the top edge of the dot relative to the bottom content edge */
    /* -2px centers it vertically on a 4px border */
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%); /* Center horizontally */
    width: 8px;  /* Dot size */
    height: 8px; /* Dot size */
    background-color: white;
    border-radius: 50%;
    border: 1px solid #333; /* Optional: slight border for visibility */
    z-index: 3; /* Ensure it's visually on top of the bar */
}


.earthly-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}


/* --- Active States (Moved towards the center bar) --- */
.heavenly-section .bead.active {
    transform: translateY(30px); /* Adjust as needed */
    background-image: linear-gradient(to bottom, #FFEE58, #FBC02D);
}

.earthly-section .bead.active {
    transform: translateY(-30px); /* Adjust as needed */
    background-image: linear-gradient(to bottom, #FFEE58, #FBC02D);
}

/* Action Buttons */
.isa-actions button {
    padding: 8px 15px;
    font-size: 1em;
    cursor: pointer;
    margin: 0 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f0f0f0;
}
.isa-actions button:hover {
    background-color: #e0e0e0;
}
.isa-actions button#isa-submit-button {
    background-color: #4CAF50; /* Green */
    color: white;
    border-color: #3a8f40;
}
.isa-actions button#isa-submit-button:hover {
    background-color: #3a8f40;
}
.isa-actions button#isa-next-button {
    background-color: #2196F3; /* Blue */
    color: white;
    border-color: #1769aa;
}
.isa-actions button#isa-next-button:hover {
    background-color: #1769aa;
}


/* Feedback Area Styles */
#isa-feedback-area.correct {
    color: green;
}

#isa-feedback-area.incorrect {
    color: red;
}