/*
 * Charge Calculator Styles - Rosewood Ridge Site
 * Web 3.0 Design System & Document Style Output
 */

@import url('variables.css');

/* --- General Container --- */
.container {
    /* Inherits base styles, add specifics if needed */
    max-width: 1400px; /* Wider container for side-by-side */
}

/* --- Input Section (Web 3.0 Style) --- */
.input-section {
    background: var(--gradient-dark);
    padding: 25px 30px;
    border-radius: var(--border-radius-std);
    margin-bottom: 2rem;
    border: 1px solid var(--accent-color);
    box-shadow: var(--box-shadow-std);
}

.input-section h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 600;
    border-bottom: 1px solid var(--accent-color);
    padding-bottom: 0.8rem;
    margin-top: 0;
    color: var(--text-color);
}

.defendant-info {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    color: var(--text-secondary-color);
    font-size: 0.9em;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    box-sizing: border-box;
    background-color: var(--input-bg);
    color: var(--text-color);
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    padding: 0.7rem 0.8rem;
    font-size: 0.95rem;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus {
    outline: 0;
    border-color: var(--highlight-color);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.4), var(--box-shadow-glow);
}

.charge-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end; /* Align items to bottom for button */
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.charge-row .form-group {
    margin-bottom: 0; /* Remove bottom margin for flex alignment */
}

.charge-row .form-group:nth-child(1) { flex-grow: 3; } /* Charge select wider */
.charge-row .form-group:nth-child(2) { flex-grow: 2; } /* Modifier select */
.charge-row .form-group:nth-child(3) { flex-grow: 1; max-width: 100px; } /* Count input */
.charge-row .form-group:nth-child(4) { flex-grow: 0; } /* Delete button */

.delete-button {
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-std);
    padding: 0.7rem; /* Match input height */
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s;
    height: calc(1.4rem + 1.6rem + 2px); /* Approx height match */
}

.delete-button:hover {
    background: #c82333;
}

/* --- Recommended Sentence Section (Document Style) --- */
.recommended-sentence {
    background-image: url('/assets/backdrop.webp'); /* Updated path */
    background-color: #f5e8c8; /* Fallback color */
    background-size: cover;
    border: 1px solid #8a6d3b; /* Darker border */
    border-radius: 5px;
    padding: 30px 40px;
    margin-top: 2rem;
    font-family: "Times New Roman", Times, serif;
    color: #3a2e1e; /* Dark brown text */
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.4);
    position: relative; /* For seal positioning */
}

.seal-image {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px; /* Adjust size as needed */
    height: auto;
    opacity: 0.8; /* Slightly faded */
}

#defendant-name {
    text-align: center;
    font-weight: bold;
    font-size: 1.3em;
    margin-top: 200px; /* Increased space below seal */
    margin-bottom: 10px;
    text-transform: uppercase;
}

.recommended-sentence h3 {
    text-align: center;
    font-weight: bold;
    font-size: 1.2em;
    margin: 15px 0;
    color: #3a2e1e;
}

.separator {
    border: none;
    border-top: 1.5px solid #8a6d3b;
    margin: 20px auto;
    width: 80%;
}

/* Charges Table (Document Style) */
.charges-table {
    margin: 15px 0;
}

#charges-list {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.1em; /* Slightly larger font for readability */
}

#charges-list thead {
    background-color: #5a3d2b; /* Dark brown header */
    color: #f5e8c8; /* Light text on dark header */
}

#charges-list th {
    padding: 10px 12px;
    text-align: center;
    font-weight: bold;
    border: 1px solid #8a6d3b;
}

#charges-list tbody tr {
    border-bottom: 1px solid #c8a064; /* Lighter brown lines */
}

#charges-list tbody tr:last-child {
    border-bottom: 1px solid #8a6d3b; /* Darker border at the end */
}

#charges-list td {
    padding: 8px 12px;
    text-align: left;
    border-left: 1px solid #c8a064;
    border-right: 1px solid #c8a064;
    vertical-align: top;
}

/* Specific column alignments */
#charges-list th:nth-child(3), /* Count */
#charges-list td:nth-child(3),
#charges-list th:nth-child(4), /* Sentence */
#charges-list td:nth-child(4),
#charges-list th:nth-child(5), /* Fine */
#charges-list td:nth-child(5) {
    text-align: center;
}

/* Make inputs inside the document table transparent */
#charges-list input,
#charges-list select {
    background-color: transparent !important;
    color: #3a2e1e !important; /* Match document text color */
    font-family: "Times New Roman", Times, serif !important;
    font-size: 1em !important; /* Match table font size */
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 2px !important; /* Minimal padding */
    width: auto; /* Allow natural width */
    max-width: 100%;
    text-align: inherit; /* Inherit alignment from cell */
}

#charges-list input[type="number"] {
    -moz-appearance: textfield; /* Firefox */
    width: 60px; /* Fixed width for number inputs */
    text-align: center;
}

#charges-list input[type="number"]::-webkit-outer-spin-button,
#charges-list input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#charges-list .sentence-input {
    width: 50px; /* Specific width for sentence */
    display: inline-block;
}

#charges-list .fine-header,
#charges-list td:nth-child(5) { /* Fine column */
    text-align: right;
    padding-right: 15px;
}
#charges-list td:nth-child(5) input {
    text-align: right;
}

#recommended-sentencing-details { /* Ensure styles target the new ID if needed */
    text-align: center;
    font-size: 1.2em;
    margin: 15px 0;
}

#recommended-sentencing-details span { /* Style for the bold parts */
    font-weight: bold;
    font-size: 1.1em;
}

.footer {
    text-align: center;
    font-size: 0.9em;
    margin-top: 20px;
    line-height: 1.4;
}

.footer b {
    font-size: 1.1em;
}

/* --- Download Button --- */
#download-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--highlight-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.8rem;
    line-height: 50px;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--box-shadow-std);
    transition: background-color 0.3s, transform 0.2s;
    z-index: 100;
}

#download-button:hover {
    background-color: var(--bright-accent);
    transform: scale(1.1);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .recommended-sentence {
        padding: 20px 15px;
        margin-top: 1rem;
    }

    .seal-image {
        width: 100px; /* Adjusted responsive size slightly */
        top: 10px;
    }

    #defendant-name {
        margin-top: 100px; /* Increased responsive margin-top */
        font-size: 1.1em;
    }

    #charges-list {
        font-size: 0.9em;
    }

    #charges-list th,
    #charges-list td {
        padding: 6px 8px;
    }

    #recommended-sentencing {
        font-size: 1em;
    }

    #download-button {
        width: 45px;
        height: 45px;
        font-size: 1.5rem;
        line-height: 45px;
        bottom: 15px;
        right: 15px;
    }

    .defendant-info {
        flex-direction: column;
        gap: 1rem;
    }

    .charge-row {
        flex-direction: column;
        align-items: stretch; /* Stretch items full width */
    }

    .charge-row .form-group {
        max-width: none; /* Remove max-width */
        margin-bottom: 0.5rem;
    }

    .charge-row .form-group:last-child {
        margin-bottom: 0;
    }

    .delete-button {
        width: 100%;
        margin-top: 0.5rem;
    }
}
