/* Inspired by official document/monochrome wireframe style */
body {
    font-family: 'Courier New', Courier, monospace;
    background-color: #fff;
    color: #000;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
}

header {
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

h1 {
    text-align: center;
    font-size: 2.5em;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.project-description {
    text-align: center;
    margin-top: 5px;
    font-size: 1.1em;
    color: #555;
}

nav {
    text-align: center;
    margin-top: 10px;
}

nav a {
    color: #000;
    text-decoration: none;
    margin: 0 15px;
    font-size: 1.2em;
    border-bottom: 1px dotted #000;
}

nav a.active {
    border-bottom: 2px solid #000;
    font-weight: bold;
}

main {
    max-width: 900px;
    margin: 0 auto;
}

section {
    margin-bottom: 40px;
}

h2 {
    border-bottom: 1px solid #000;
    padding-bottom: 5px;
    margin-bottom: 20px;
    font-size: 1.8em;
}

table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #000;
}

th, td {
    border: 1px solid #000;
    padding: 10px;
    text-align: left;
}

thead {
    background-color: #f2f2f2; /* Light grey for header, still monochrome */
}

th {
    font-weight: bold;
}

.hidden {
    display: none;
}

#cases-list .case {
    border: 1px solid #000;
    padding: 15px;
    margin-bottom: 15px;
}

#cases-list .case h3 {
    margin-top: 0;
}

.offender-info {
    display: flex;
}

.mugshot-thumb {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

#detail-section {
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    border: 2px solid #000;
}

#detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #000;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

#back-button {
    background: none;
    border: 1px solid #000;
    padding: 5px 10px;
    cursor: pointer;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1em;
}

.judge-link, .offender-link, .case-link {
    text-decoration: underline;
    cursor: pointer;
    color: #000;
}

.hero-score {
    text-align: center;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #000;
}

.hero-score span {
    display: block;
    font-size: 1.2em;
    text-transform: uppercase;
}

.hero-score strong {
    display: block;
    font-size: 4em;
    font-weight: bold;
}

.case-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    font-size: 1.1em;
}

#score-calculator {
    padding: 15px;
    border: 1px solid #000;
    margin-top: 20px;
    display: inline-block;
}

#score-calculator label {
    margin-right: 10px;
}

#score-calculator select, #score-calculator button {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1em;
    padding: 5px;
    border: 1px solid #000;
    background-color: #fff;
}

#score-calculator button {
    cursor: pointer;
    margin-left: 10px;
}

#calculator-result {
    margin-top: 15px;
    font-size: 1.2em;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #000;
    font-size: 0.9em;
    color: #555;
}

.chart-container {
    position: relative;
    width: 100%;
    margin: 20px 0;
    aspect-ratio: 1.2 / 1;
    min-height: 400px;
}

canvas {
    max-width: 100%;
    height: 100% !important;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 1.8em;
    }

    nav a {
        margin: 0 10px;
        font-size: 1em;
    }

    main, #detail-section {
        padding: 0 10px;
    }

    .case-details-grid {
        grid-template-columns: 1fr;
    }

    th, td {
        padding: 8px;
    }

    .hero-score strong {
        font-size: 3em;
    }

    .offender-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .mugshot-thumb {
        width: 40px;
        height: 40px;
        margin-right: 0;
        margin-bottom: 5px;
    }

    .chart-container {
        min-height: 300px;
    }
}

@media (max-width: 480px) {
    nav {
        display: flex;
        flex-direction: column;
    }

    nav a {
        margin-bottom: 10px;
        border-bottom: 1px dotted #000;
    }

    h1 {
        font-size: 1.5em;
        letter-spacing: 1px;
    }

    h2 {
        font-size: 1.4em;
    }

    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        border: 1px solid #000;
        margin-bottom: 10px;
    }

    td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
        text-align: right;
    }

    .chart-container {
        min-height: 280px;
    }

    td:before {
        position: absolute;
        top: 6px;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
    }

        td:nth-of-type(1):before { content: "Rank"; }
        td:nth-of-type(2):before { content: "Judge Name"; }
        td:nth-of-type(3):before { content: "Leniency Score"; }
        td:nth-of-type(4):before { content: "Court/State"; }

        /* Keep stats table as table on mobile */
        #stats-table {
            display: table;
            width: 100%;
            border-collapse: collapse;
            border: 1px solid #000;
        }

        #stats-table thead {
            display: table-header-group;
        }

        #stats-table tbody {
            display: table-row-group;
        }

        #stats-table tr {
            display: table-row;
            border: none;
            margin-bottom: 0;
        }

        #stats-table th, #stats-table td {
            display: table-cell;
            border: 1px solid #000;
            padding: 8px;
            text-align: left;
            position: static;
            padding-left: 8px;
        }

        #stats-table td:before {
            display: none;
        }
    }

    /* --- Search Styles --- */
#search-section {
    position: relative;
    padding: 0;
    margin-bottom: 20px;
    border: none;
}

    #search-container {
        position: relative;
        max-width: 600px;
        margin: 0 auto;
    }

    #search-input {
        width: 100%;
        padding: 10px;
        font-family: 'Courier New', Courier, monospace;
        font-size: 1.2em;
        border: 1px solid #000;
        background-color: #fff;
        color: #000;
        box-sizing: border-box;
    }

    #search-results {
        position: absolute;
        top: 100%;
        left: 10px;
        right: 10px;
        background-color: #fff;
        border: 1px solid #000;
        border-top: none;
        max-height: 300px;
        overflow-y: auto;
        display: none;
        z-index: 1000;
    }

    .search-result-group-title {
        padding: 5px 10px;
        font-weight: bold;
        text-transform: uppercase;
        border-bottom: 1px solid #000;
        color: #000;
    }

    .search-result-group-list {
        list-style-type: disc;
        margin: 0;
        padding-left: 20px;
    }

    .search-result-list-item {
        padding: 2px 0;
    }

    .search-result-item {
        color: #000;
        text-decoration: none;
        padding: 2px;
    }

    .search-result-item:hover {
        background-color: #f0f0f0;
    }

    .search-result-item .result-name {
        font-weight: normal;
    }

/* --- Dossier Card Styles --- */
.dossier-card {
    border: 2px solid #000;
    padding: 20px;
    background-color: #fdfdfd;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 20px auto;
}

.dossier-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.dossier-header h2 {
    margin: 0;
    font-size: 2em;
    text-transform: uppercase;
}

#download-btn {
    background-color: #000;
    color: #fff;
    border: none;
    padding: 10px 15px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1em;
    cursor: pointer;
    text-transform: uppercase;
}

.dossier-profile {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.mugshot {
    border: 1px solid #000;
    padding: 5px;
    background-color: #eee;
}

.mugshot img {
    display: block;
    max-width: 150px;
}

.offender-info {
    display: flex;
    flex-direction: column;
}

.offender-info h2 {
    margin: 0 0 5px 0;
    border: none;
}

.dob {
    font-size: 0.9em;
    font-weight: normal;
    text-align: left;
}

.dossier-field {
    margin-bottom: 8px;
    font-size: 0.9em;
}

.status-active {
    color: #ff0000;
    font-weight: bold;
    text-transform: uppercase;
    border: 1px solid #ff0000;
    padding: 2px 5px;
    display: inline-block;
}

#offender-cases-list .case-entry {
    border-top: 1px dotted #000;
    padding: 10px 0;
}

#offender-cases-list .case-entry:first-child {
    border-top: none;
}

/* Removed duplicate chart-container styles */

/* Judge Dossier Styles */
.mugshot-container {
    border: 1px solid #000;
    padding: 10px;
    background-color: #eee;
    text-align: center;
    margin-bottom: 20px;
}

.placeholder-photo {
    font-size: 2em;
    font-weight: bold;
    color: #555;
}

.judge-details {
    margin-bottom: 20px;
}

.detail-row {
    margin-bottom: 8px;
    font-size: 1.1em;
}

.status-indicator {
    color: #ff0000;
    font-weight: bold;
    text-transform: uppercase;
    border: 1px solid #ff0000;
    padding: 2px 5px;
    display: inline-block;
}

#downloadBtn {
    background-color: #000;
    color: #fff;
    border: none;
    padding: 10px 15px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1em;
    cursor: pointer;
    text-transform: uppercase;
    margin-top: 20px;
}

#downloadChartBtn {
    background-color: #000;
    color: #fff;
    border: none;
    padding: 10px 15px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1em;
    cursor: pointer;
    text-transform: uppercase;
    margin-top: 10px;
}

.leniency-breakdown {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ccc;
}

.leniency-breakdown h3 {
    margin-top: 0;
    border-bottom: 1px solid #000;
    padding-bottom: 5px;
}

.lenient-case {
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #ddd;
}

.lenient-case p {
    margin: 0 0 10px 0;
    font-weight: bold;
}

.lenient-case ul {
    margin: 0;
    padding-left: 20px;
}

.lenient-case li {
    margin-bottom: 5px;
}

/* --- Judge Card Styles --- */
#judges-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.judge-card {
    display: flex;
    align-items: center;
    border: 1px solid #000;
    padding: 15px;
    background-color: #fdfdfd;
}

.judge-card-rank {
    font-size: 1.5em;
    font-weight: bold;
    margin-right: 15px;
}

.judge-card-info {
    flex-grow: 1;
}

.judge-card-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.2em;
}

.judge-card-info p {
    margin: 0;
    color: #555;
}

/* --- Stats Card Styles --- */
#stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: #f2f2f2;
    border: 1px solid #000;
    padding: 15px;
    text-align: center;
}

.stat-card h4 {
    margin: 0 0 10px 0;
    font-size: 1em;
    text-transform: uppercase;
}

.stat-card p {
    margin: 0;
    font-size: 2em;
    font-weight: bold;
}
.judge-card-score {
    font-size: 2em;
    font-weight: bold;
}

/* --- Case Card Styles --- */
#cases-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.case-card {
    border: 1px solid #000;
    background-color: #fdfdfd;
    text-align: center;
}

.case-card-mugshot {
    width: 100%;
    height: 200px;
    background-color: #eee;
}

.case-card-mugshot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.case-card-info {
    padding: 15px;
}

.case-card-info h3 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
}

.case-card-info p {
    margin: 5px 0;
    font-size: 0.9em;
}

.case-mugshot {
    text-align: center;
    margin: 20px 0;
}

.case-mugshot img {
    max-width: 300px;
    max-height: 300px;
    object-fit: cover;
    border: 1px solid #ccc;
}

/* --- Stats Card Styles --- */
#stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: #f2f2f2;
    border: 1px solid #000;
    padding: 15px;
    text-align: center;
}

.stat-card h4 {
    margin: 0 0 10px 0;
    font-size: 1em;
    text-transform: uppercase;
}

.stat-card p {
    margin: 0;
    font-size: 2em;
    font-weight: bold;
}



.lenient-case a {
    color: #000;
    text-decoration: underline;
}

