:root {
    --bg-color: #0d1117;
    --text-color: #c9d1d9;
    --accent-color: #58a6ff;
    --success-color: #3fb950;
    --error-color: #f85149;
    --border-color: #30363d;
    --text-muted: #8b949e;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.6;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

main {
    width: 100%;
    max-width: 1200px;
    padding: 0 8rem;
    box-sizing: border-box;
}

header {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    border-bottom: 2px solid var(--border-color);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.header-content {
    width: 100%;
    max-width: 1200px;
    padding: 0 4rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
}

h1 {
    font-size: 1.5rem;
    letter-spacing: -1px;
    justify-self: start;
    white-space: nowrap;
}

.nav-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    background-color: transparent;
}

.nav-btn {
    padding: 0.5rem 0.5rem;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: color 0.2s ease;
    font-weight: 500;
}

.nav-btn:hover, .nav-btn.active {
    color: var(--text-color);
}

.stock-ticker {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-self: end;
    width: 100%;
    justify-content: flex-end;
}

@media (max-width: 900px) {
    .header-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 1.5rem;
        text-align: center;
        padding: 0 2rem;
    }
    h1, .stock-ticker {
        justify-self: center;
    }
    main {
        padding: 0 2rem;
    }
}

#chart-container {
    height: 60vh;
    min-height: 500px;
    background-color: #0d1117;
    margin-bottom: 2rem;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}

.tradingview-widget-container,
#tradingview_widget {
    height: 100%;
    width: 100%;
}

#company-info {
    margin-bottom: 3rem;
    padding: 1.5rem;
    background-color: #161b22;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

#company-info h2 {
    margin-top: 0;
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

#company-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

h2 {
    font-size: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--accent-color);
    padding-left: 0.5rem;
}

/* Listings */
.filing-item {
    background: #161b22;
    border: 1px solid var(--border-color);
    padding: 1rem;
    margin-bottom: 1rem;
    transition: transform 0.2s;
}

.filing-item:hover {
    border-color: var(--accent-color);
    transform: translateX(4px);
}

.filing-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.filing-type {
    font-weight: bold;
    color: var(--accent-color);
}

.filing-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.filing-summary {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.filing-link {
    font-size: 0.85rem;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
}

.filing-link:hover {
    text-decoration: underline;
}

footer {
    margin-top: 4rem;
    text-align: center;
    font-size: 0.8rem;
    color: #484f58;
}
.loading {
    color: #8b949e;
    font-style: italic;
    margin-bottom: 2rem;
}

/* Modal Styling */
dialog#filing-modal {
    background: transparent;
    border: none;
    padding: 0;
    max-width: 600px;
    width: 90%;
    color: var(--text-color);
    margin: auto;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid var(--border-color);
    padding: 2rem;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    /* Sharp edges */
    border-radius: 0; 
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
}

.close-modal:hover {
    color: var(--text-color);
}

.modal-date {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Modal Sections */
.modal-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.modal-section h3 {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    color: var(--accent-color);
    border-left: none;
    padding-left: 0;
}

/* Context Section */
.context-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.layman-term p, .specific-detail p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin-top: 0.3rem;
    margin-bottom: 0;
}

/* AI Summary Box */
.ai-summary-box {
    background: rgba(45, 212, 191, 0.05); /* Teal tint */
    padding: 1rem;
    border-left: 3px solid var(--accent-color);
}

.placeholder-text {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
    margin: 0;
}

/* Exhibit List */
.exhibit-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.exhibit-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: all 0.2s;
}

.exhibit-link:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--accent-color);
}

.exhibit-type {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.5rem;
    color: var(--text-color);
}

.exhibit-desc {
    flex-grow: 1;
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.open-icon {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.no-exhibits {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
}

.modal-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.btn.primary-btn {
    background: var(--accent-color);
    color: #0d1117;
    padding: 0.6rem 1.2rem;
    font-weight: bold;
    border-radius: 4px; /* Slight round for button */
}

.btn.primary-btn:hover {
    opacity: 0.9;
    text-decoration: none;
}

/* Why Nodules Section */
#why-nodules {
    margin-bottom: 3rem;
}

.nodule-content {
    background-color: #161b22;
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 6px;
}

.nodule-content h3 {
    font-size: 1.1rem;
    color: var(--accent-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.nodule-content h3:first-of-type {
    margin-top: 0;
}

.nodule-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.nodule-content ul {
    list-style: none;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
}

.nodule-content ul li {
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-size: 0.95rem;
    position: relative;
    padding-left: 1rem;
}

.nodule-content ul li::before {
    content: "•";
    color: var(--accent-color);
    position: absolute;
    left: -0.5rem;
}

.risk-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.hidden {
    display: none !important;
}
