/*
 * Custom styles for the AP Calc BC Score Calculator and similar tools.
 */

/* Score Badges */
.badge {
    padding: 0.5em 0.75em;
    font-size: 1.1em;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
    display: inline-block;
}

.badge.score-5 {
    background-color: #28a745; /* Green */
}

.badge.score-4 {
    background-color: #20c997; /* Teal */
}

.badge.score-3 {
    background-color: #007bff; /* Blue */
}

.badge.score-2 {
    background-color: #fd7e14; /* Orange */
}

.badge.score-1 {
    background-color: #6c757d; /* Gray */
}

/* Progress Bars for Section Breakdown */
.progress {
    height: 1.5rem; /* Make progress bars a bit taller */
    font-size: 0.875rem;
    background-color: var(--bs-tertiary-bg); /* Use Bootstrap 5 variable for background */
    border-radius: 0.375rem;
    overflow: hidden; /* Ensure text doesn't overflow rounded corners */
}

.progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: var(--bs-progress-bar-color); /* Use Bootstrap variable */
    text-align: center;
    white-space: nowrap;
    background-color: var(--bs-progress-bar-bg); /* Use Bootstrap variable */
    transition: width 0.6s ease;
}

/* Custom colors for progress bars (if needed, otherwise Bootstrap defaults are fine) */
.progress-bar.bg-info {
    background-color: var(--bs-info) !important;
}

.progress-bar.bg-success {
    background-color: var(--bs-success) !important;
}


/* Accordion Overrides for AB Subscore and Advanced Panels */
.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25); /* Standard Bootstrap focus ring */
    border-color: #86b7fe;
}

.accordion-button:not(.collapsed) {
    color: var(--bs-accordion-active-color);
    background-color: var(--bs-accordion-active-bg);
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

/* Form Validation Feedback */
.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

.form-control:focus.is-invalid {
    border-color: var(--bs-danger);
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* General calculator input styling for better readability */
.form-label {
    font-weight: 500;
}

/* Styling for the results section */
#results {
    border-left: 5px solid var(--bs-primary);
}

/* Dark theme adjustments */
body[data-bs-theme="dark"] .badge.score-5 { background-color: #20993d; }
body[data-bs-theme="dark"] .badge.score-4 { background-color: #1aae84; }
body[data-bs-theme="dark"] .badge.score-3 { background-color: #0069d9; }
body[data-bs-theme="dark"] .badge.score-2 { background-color: #da650e; }
body[data-bs-theme="dark"] .badge.score-1 { background-color: #5a6268; }

body[data-bs-theme="dark"] .bg-light { background-color: var(--bs-dark-bg-subtle) !important; }
body[data-bs-theme="dark"] .border.rounded.bg-light { background-color: var(--bs-dark-bg-subtle) !important; border-color: var(--bs-secondary) !important; }
body[data-bs-theme="dark"] .accordion-button:not(.collapsed) {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-white);
}
body[data-bs-theme="dark"] .card {
    background-color: var(--bs-dark-bg-subtle);
    border-color: var(--bs-secondary);
}
body[data-bs-theme="dark"] .card-body {
    color: var(--bs-body-color);
}
body[data-bs-theme="dark"] .form-text {
    color: var(--bs-secondary-color) !important;
}
body[data-bs-theme="dark"] .input-group-text {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}
body[data-bs-theme="dark"] .bg-white { background-color: var(--bs-body-bg) !important; }
