/* Court Summons Design System */
:root {
    --ink: #1a1a1a;
    --paper: #f9f7f2;
    --paper-dark: #e8e4d9;
    --accent-red: #b32d2e; /* Stamp Red */
    --font-official: 'EB Garamond', serif;
    --font-typewriter: 'Courier Prime', 'Courier New', monospace;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--paper-dark);
    color: var(--ink);
    font-family: var(--font-official);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(0,0,0,0.02) 0%, transparent 100%),
        url("https://www.transparenttextures.com/patterns/p6.png"); /* Subtle paper texture */
}

.summons-container {
    background: var(--paper);
    width: 100%;
    max-width: 650px;
    padding: 4rem 3rem;
    box-shadow: 
        2px 2px 0 rgba(0,0,0,0.05),
        10px 10px 20px rgba(0,0,0,0.1);
    position: relative;
    border: 1px solid rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Red "OFFICIAL" Stamp */
.stamp {
    position: absolute;
    top: 40px;
    right: 40px;
    border: 4px double var(--accent-red);
    color: var(--accent-red);
    font-family: var(--font-typewriter);
    font-weight: bold;
    padding: 10px 20px;
    transform: rotate(15deg);
    text-transform: uppercase;
    font-size: 1.2rem;
    opacity: 0.8;
    pointer-events: none;
    user-select: none;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    border-bottom: 2px solid var(--ink);
    padding-bottom: 1rem;
}

.court-name {
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

h1 {
    font-size: 3.5rem;
    letter-spacing: 8px;
    text-transform: uppercase;
    font-weight: 900;
    margin: 1rem 0;
}

.case-info {
    font-family: var(--font-typewriter);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.field {
    display: flex;
    margin-bottom: 0.5rem;
}

.label {
    width: 150px;
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: bold;
    color: #666;
}

.value {
    flex: 1;
    border-bottom: 1px dotted var(--ink);
    font-size: 1.1rem;
}

.command-text {
    font-style: italic;
    font-size: 1.2rem;
    margin: 2rem 0;
    line-height: 1.5;
    text-align: justify;
}

.event-table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
}

.event-table td {
    padding: 1rem;
    border: 1px solid #ccc;
}

/* Применяем печатный шрифт к значениям в таблице */
.event-table td:last-child {
    font-family: var(--font-typewriter);
    font-size: 1.1rem;
}

.rsvp-section {
    margin-top: 3rem;
    text-align: center;
    border-top: 2px solid var(--ink);
    padding-top: 2rem;
}

.plea-title {
    font-family: var(--font-typewriter);
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.btn-group {
    display: flex;
    gap: 1.5rem;
}

button {
    flex: 1;
    padding: 1rem;
    font-family: var(--font-typewriter);
    font-size: 1rem;
    text-transform: uppercase;
    cursor: pointer;
    background: transparent;
    border: 2px solid var(--ink);
    transition: var(--transition);
}

.btn-primary {
    background: var(--ink);
    color: var(--paper);
}

.btn-secondary:hover {
    background: rgba(0,0,0,0.05);
}

.btn-selected {
    background: var(--accent-red) !important;
    border-color: var(--accent-red) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-selected-green {
    background: #2e7d32 !important;
    border-color: #2e7d32 !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

#status-badge-container {
    margin-bottom: 2rem;
}

.official-status {
    color: var(--accent-red);
    font-family: var(--font-typewriter);
    font-weight: bold;
    font-size: 1.5rem;
    border: 2px solid var(--accent-red);
    display: inline-block;
    padding: 5px 15px;
    transform: rotate(-5deg);
}

/* NEW: Additional Fields Styling */
.additional-fields {
    text-align: left;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(0,0,0,0.02);
    border: 1px dashed #ccc;
}

.additional-fields .field {
    margin-bottom: 1.5rem;
}

input[type="number"],
input[type="text"],
textarea {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--ink);
    font-family: var(--font-typewriter);
    font-size: 1rem;
    padding: 5px;
    width: 100%;
}

textarea {
    height: 60px;
    resize: none;
}

input:focus, textarea:focus {
    outline: none;
    border-bottom-width: 2px;
}

/* NEW: Witness List Styling */
.witness-list-section {
    text-align: left;
}

.witness-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px dotted #ccc;
    font-family: var(--font-typewriter);
    font-size: 0.9rem;
}

.witness-status {
    text-transform: uppercase;
    font-weight: bold;
    font-size: 0.75rem;
}

.status-pending { color: #888; }
.status-attending { color: #2e7d32; } /* Green */
.status-declined { color: var(--accent-red); }

.seen-indicator {
    font-size: 0.7rem;
    color: #999;
    font-style: italic;
}

#loading-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--paper);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 50px; height: 50px;
    border: 5px solid #ddd;
    border-top-color: var(--ink);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
    .summons-container { padding: 2rem 1.5rem; }
    h1 { font-size: 2.2rem; letter-spacing: 4px; }
    .btn-group { flex-direction: column; }
}
