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

body {
    font-family: 'Inter', sans-serif;
    background-color: #13111c;
    color: #c4c0d5;
    min-height: 100vh;
    padding: 40px;
}

.container {
    background-color: #1c1a2e;
    border-radius: 20px;
    padding: 40px;
    max-width: 100%;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #ebe8f4;
    margin-bottom: 30px;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
}

table {
    min-width: 1400px;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
    table-layout: fixed;
}

thead th {
    background: linear-gradient(135deg, #2a2545 0%, #322d50 100%);
    color: #9d97b8;
    font-weight: 500;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 16px 18px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 2px solid #3b3560;
    position: sticky;
    top: 0;
}

thead th .th-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

thead th:first-child {
    border-radius: 12px 0 0 0;
}

thead th:last-child {
    border-radius: 0 12px 0 0;
}

thead th.sorted-asc::after,
thead th.sorted-desc::after {
    margin-left: 8px;
    font-size: 0.75rem;
    color: #c9c4db;
}

thead th.sorted-asc::after {
    content: "▲";
}

thead th.sorted-desc::after {
    content: "▼";
}

tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background-color: rgba(139, 92, 246, 0.08);
}

tbody td {
    padding: 14px 18px;
    border-bottom: 1px solid #2a2545;
    color: #c4c0d5;
    vertical-align: top;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:last-child td:first-child {
    border-radius: 0 0 0 12px;
}

tbody tr:last-child td:last-child {
    border-radius: 0 0 12px 0;
}

/* Column widths and wrapping */
th:nth-child(1),  td:nth-child(1)  { width: 12%; }                           /* Case Name */
th:nth-child(2),  td:nth-child(2)  { width: 5%;  white-space: nowrap; }      /* Court */
th:nth-child(3),  td:nth-child(3)  { width: 5%; }                            /* CourtListener Link */
th:nth-child(4),  td:nth-child(4)  { width: 5%;  white-space: nowrap; }      /* Complaint */
th:nth-child(5),  td:nth-child(5)  { width: 9%;  white-space: nowrap; }      /* Docket Number */
th:nth-child(6),  td:nth-child(6)  { width: 7%;  white-space: nowrap; }      /* Date Filed */
th:nth-child(7),  td:nth-child(7)  { width: 14%; }                           /* Plaintiffs */
th:nth-child(8),  td:nth-child(8)  { width: 14%; }                           /* Defendants */
th:nth-child(9),  td:nth-child(9)  { width: 5%; }                            /* Ticker */
th:nth-child(10), td:nth-child(10) { width: 8%;  white-space: nowrap; }      /* Class Period Start */
th:nth-child(11), td:nth-child(11) { width: 8%;  white-space: nowrap; }      /* Class Period End */
th:nth-child(12), td:nth-child(12) { width: 5%; }                            /* Details */

/* Ticker badge */
.ticker {
    display: inline-block;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.03em;
}

/* Link styling */
.case-link {
    display: inline-block;
    background: linear-gradient(135deg, #6d28d9, #8b5cf6);
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.78rem;
    padding: 5px 14px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.case-link:hover {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.4);
}

/* Causes of action */
.causes {
    white-space: pre-line;
    font-size: 0.8rem;
    line-height: 1.6;
}

/* Case name emphasis */
.case-name {
    color: #ebe8f4;
    font-weight: 500;
}

/* Date styling */
.date {
    white-space: nowrap;
    color: #9d97b8;
}

/* Record count */
.table-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
    font-size: 0.82rem;
    color: #6b6588;
}

/* Scrollbar styling */
.table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: #1c1a2e;
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: #3b3560;
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #4c4575;
}

/* Detail button */
.detail-btn {
    background: linear-gradient(135deg, #6d28d9, #8b5cf6);
    color: #fff;
    border: none;
    font-weight: 500;
    font-size: 0.78rem;
    padding: 5px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.detail-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.4);
}

/* Modal overlay */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

/* Modal */
.modal {
    background: #1c1a2e;
    border: 1px solid #3b3560;
    border-radius: 16px;
    padding: 32px;
    max-width: none;
    width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.modal h2 {
    color: #ebe8f4;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 24px;
    padding-right: 32px;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #6b6588;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #ebe8f4;
}

.modal-section {
    margin-bottom: 24px;
}

.modal-section h3 {
    color: #9d97b8;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.modal-section p {
    color: #c4c0d5;
    font-size: 0.88rem;
    line-height: 1.6;
}

/* Modal summary box */
.modal-summary-content {
    background: #232040;
    border-radius: 10px;
    padding: 16px 20px;
    border-left: 3px solid #7c3aed;
    text-align: justify;
}

/* Modal COA table */
.modal-table-wrapper {
    border-radius: 10px;
    overflow: hidden;
}

.modal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.modal-table thead th {
    background: #232040;
    color: #9d97b8;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 16px;
    text-align: left;
    position: static;
}

.modal-table tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid #2a2545;
    color: #c4c0d5;
}

.modal-table tbody td:last-child {
    text-align: center;
    font-weight: 600;
    color: #a78bfa;
    width: 80px;
}

.modal-table tbody tr:last-child td {
    border-bottom: none;
}

/* 4-column grid for purchaser/seller */
.modal-grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 12px;
}

.modal-card {
    background: #232040;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-card-label {
    color: #6b6588;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.modal-card-value {
    color: #ebe8f4;
    font-size: 0.92rem;
    font-weight: 500;
}

/* Holdings analysis tabs */
.holdings-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.holdings-tab {
    background: #232040;
    color: #9d97b8;
    border: 1px solid #3b3560;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.holdings-tab:hover {
    background: #2a2545;
    color: #ebe8f4;
}

.holdings-tab.active {
    background: linear-gradient(135deg, #6d28d9, #8b5cf6);
    color: #fff;
    border-color: transparent;
}

.holdings-tab-count {
    font-size: 0.75rem;
    color: #6b6588;
    margin-bottom: 10px;
}

/* Modal footer with close button */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #2a2545;
}

.modal-close-btn {
    background: #2a2545;
    color: #c4c0d5;
    border: 1px solid #3b3560;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 8px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: #3b3560;
    color: #ebe8f4;
}

/* Modal scrollbar */
.modal::-webkit-scrollbar {
    width: 6px;
}

.modal::-webkit-scrollbar-track {
    background: transparent;
}

.modal::-webkit-scrollbar-thumb {
    background: #3b3560;
    border-radius: 3px;
}

.modal::-webkit-scrollbar-thumb:hover {
    background: #4c4575;
}

/* Site footer */
.site-footer {
    text-align: center;
    padding: 24px 0 12px;
    font-size: 0.8rem;
    color: #6b6588;
}

.site-footer a {
    color: #9d97b8;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer a:hover {
    color: #ebe8f4;
}

.footer-sep {
    margin: 0 10px;
    color: #3b3560;
}

/* Content / markdown pages */
.content-page {
    max-width: 800px;
    margin: 0 auto;
}

.back-link {
    display: inline-block;
    color: #9d97b8;
    text-decoration: none;
    font-size: 0.85rem;
    margin-bottom: 24px;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #ebe8f4;
}

.markdown-body {
    color: #c4c0d5;
    font-size: 0.92rem;
    line-height: 1.7;
}

.markdown-body h1 {
    color: #ebe8f4;
    font-size: 1.6rem;
    margin-bottom: 20px;
}

.markdown-body h2 {
    color: #ebe8f4;
    font-size: 1.2rem;
    margin-top: 28px;
    margin-bottom: 12px;
}

.markdown-body h3 {
    color: #ebe8f4;
    font-size: 1rem;
    margin-top: 20px;
    margin-bottom: 8px;
}

.markdown-body p {
    margin-bottom: 14px;
}

.markdown-body ul, .markdown-body ol {
    margin-bottom: 14px;
    padding-left: 24px;
}

.markdown-body li {
    margin-bottom: 6px;
}

.markdown-body a {
    color: #a78bfa;
    text-decoration: none;
}

.markdown-body a:hover {
    color: #c4b5fd;
    text-decoration: underline;
}

.markdown-body strong {
    color: #ebe8f4;
}
