/**
 * @package     Joomla.Plugin
 * @subpackage  System.sentencing
 *
 * @copyright   Copyright (C) 2026. All rights reserved.
 * @license     GNU General Public License version 3 or later
 */

.sentencing-calculator-container {
    max-width: 960px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #222;
}

.sentencing-calculator {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.calculator-header {
    padding: 20px 24px 12px;
    border-bottom: 1px solid #eee;
}

.calculator-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #222;
}

.calculator-subtitle {
    margin: 4px 0 0;
    color: #666;
    font-size: 14px;
}

.calculator-disclaimer {
    margin: 0 24px;
    padding: 12px 16px;
    background: #f5f5f5;
    border-left: 4px solid #999;
    border-radius: 4px;
    font-size: 13px;
    color: #444;
}

.disclaimer-toggle {
    color: #007FC8;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
}

.disclaimer-toggle:hover {
    text-decoration: none;
}

.disclaimer-full {
    margin-top: 10px;
    padding: 12px;
    background: #fff;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.6;
}

/* Live stats bar */
.stats-bar {
    display: flex;
    flex-wrap: wrap;
    margin: 16px 24px 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.stat-box {
    flex: 1;
    min-width: 90px;
    padding: 12px 14px;
    background: #fafafa;
    border-right: 1px solid #e0e0e0;
}

.stat-box:last-child {
    border-right: none;
}

.stat-box.stat-months {
    background: #b3182c;
    color: #ffffff;
}

.stat-box.stat-months .stat-label {
    color: rgba(255, 255, 255, 0.85);
}

.stat-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
}

.stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    margin-top: 2px;
}

.calculator-body {
    padding: 20px 24px 24px;
}

.count-panel {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.count-panel > summary {
    padding: 12px 16px;
    background: #f2f2f2;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.count-panel > summary::-webkit-details-marker {
    display: none;
}

.count-panel > summary::before {
    content: "\25BE";
    display: inline-block;
    margin-right: 8px;
}

.count-panel:not([open]) > summary::before {
    content: "\25B8";
}

.panel-section {
    padding: 16px;
    border-top: 1px solid #eee;
}

.panel-section:first-of-type {
    border-top: none;
}

.section-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 10px;
    color: #333;
}

.offense-inputs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.offense-inputs .form-control {
    flex: 1;
    min-width: 180px;
}

.offense-picks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.offense-pick {
    border: 1px solid #ccc;
    background: #f7f7f7;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.offense-pick:hover {
    background: #0453A0;
    color: #fff;
    border-color: #0453A0;
}

.guideline-questions {
    margin-top: 14px;
}

.intro-box {
    margin: 16px 24px 0;
    padding: 14px 18px;
    background: #f0f4f8;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.intro-box p {
    margin: 0 0 8px 0;
}

.intro-box p:last-child {
    margin-bottom: 0;
}

.ch-calc {
    margin-top: 14px;
    padding: 14px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #eee;
}

.ch-dates-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.ch-dates-row > div {
    flex: 1;
    min-width: 200px;
}

.ch-dates-row label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
}

.ch-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    font-size: 13px;
}

.ch-table th {
    text-align: left;
    padding: 6px 8px;
    border-bottom: 2px solid #ddd;
    font-size: 12px;
    color: #666;
}

.ch-table td {
    padding: 4px 6px;
    vertical-align: middle;
}

.ch-table input, .ch-table select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 13px;
}

.ch-table .ch-remove-row {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #999;
}

.ch-table .ch-remove-row:hover {
    color: #c00;
}

.ch-calc-result {
    margin-top: 12px;
    padding: 10px 14px;
    background: #eef7ee;
    border-left: 3px solid #3E9B52;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}

.theme-dark .intro-box { background: #333; color: #ddd; }
.theme-dark .ch-calc { background: #333; border-color: #444; }
.theme-dark .ch-table th { color: #aaa; border-color: #555; }
.theme-dark .ch-table input, .theme-dark .ch-table select { background: #262626; border-color: #555; color: #eee; }
.theme-dark .ch-calc-result { background: #2a3a2a; color: #cde; }

.soc-hint {
    background: #f5f5f5;
    border-left: 3px solid #999;
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 13px;
    color: #444;
    margin: 0 0 14px 0;
}

.soc-question {
    margin-bottom: 14px;
}

.soc-question label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    color: #333;
}

.soc-question.soc-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 400;
}

.soc-question.soc-checkbox input {
    margin-top: 3px;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #007FC8;
    box-shadow: 0 0 0 3px rgba(0, 127, 200, 0.15);
}

.adjustment-row {
    margin-bottom: 8px;
    font-size: 13px;
}

.adjustment-row label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.adjustment-row-select label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.adjustment-row-select select {
    max-width: 420px;
}

.breakdown-section {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 16px;
}

.breakdown-list {
    font-size: 14px;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px solid #f0f0f0;
}

.breakdown-row:last-child {
    border-bottom: none;
    font-weight: 700;
}

.breakdown-value {
    font-variant-numeric: tabular-nums;
}

.sentencing-table-wrapper {
    margin: 20px 0;
    background: #fafafa;
    border-radius: 8px;
    padding: 16px;
}

.sentencing-table-wrapper h4 {
    margin: 0 0 12px 0;
    color: #333;
    font-size: 15px;
}

.sentencing-table {
    overflow-x: auto;
}

.sentencing-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #ffffff;
}

.sentencing-table th,
.sentencing-table td {
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    text-align: center;
}

.sentencing-table th {
    background: #007FC8;
    color: #ffffff;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}

.sentencing-table tr.highlight-row {
    background: #fff3cd;
}

.sentencing-table td.highlight-cell {
    background: #ffc107;
    font-weight: 700;
}

.result-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-print {
    background: #007FC8;
    color: #fff;
}

.btn-print:hover {
    background: #0453A0;
}

.btn:hover {
    opacity: 0.9;
}

.calculator-footer {
    background: #fafafa;
    padding: 16px 24px;
    border-top: 1px solid #eee;
    text-align: center;
}

.footer-text {
    margin: 0;
    color: #888;
    font-size: 12px;
}

/* Dark theme */
.theme-dark .sentencing-calculator { background: #262626; border-color: #444; }
.theme-dark .calculator-header { border-color: #444; }
.theme-dark .calculator-title { color: #ff6b7a; }
.theme-dark .calculator-subtitle { color: #aaa; }
.theme-dark .stat-box { background: #333; border-color: #444; }
.theme-dark .count-panel, .theme-dark .panel-section, .theme-dark .breakdown-section { border-color: #444; }
.theme-dark .count-panel > summary { background: #333; color: #eee; }
.theme-dark .panel-section { color: #ddd; }
.theme-dark .section-label, .theme-dark .soc-question label { color: #ddd; }
.theme-dark .form-control { background: #333; border-color: #555; color: #eee; }
.theme-dark .offense-pick { background: #333; border-color: #555; color: #eee; }
.theme-dark .sentencing-table-wrapper { background: #333; }
.theme-dark .sentencing-table table { background: #262626; color: #eee; }
.theme-dark .sentencing-table td { border-color: #444; }
.theme-dark .calculator-footer { background: #333; border-color: #444; }
.theme-dark .breakdown-row { border-color: #3a3a3a; }
.theme-dark .soc-hint { background: #333; color: #ccc; border-color: #666; }

/* Light theme (subtler than default) */
.theme-light .calculator-header { background: #fdfaf9; }
.theme-light .stat-box { background: #ffffff; }
.theme-light .sentencing-table-wrapper { background: #ffffff; }

@media (max-width: 768px) {
    .calculator-body { padding: 16px; }
    .stats-bar { margin: 16px 12px 0; }
    .stat-box { min-width: 45%; }
    .offense-inputs { flex-direction: column; }
    .result-actions { flex-direction: column; }
    .btn { width: 100%; }
}

@media print {
    .sentencing-calculator { border: 1px solid #ccc; box-shadow: none; }
    .btn, .result-actions, .offense-picks { display: none !important; }
}
