:root {
    --primary-bg: #f8fafc;
    --sidebar-bg: #ffffff;
    --header-bg: #1e293b;
    --accent-blue: #3b82f6;
    --text-main: #334155;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}

body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-main);
}

.graph-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    height: 80px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.header-left {
    display: flex;
    flex-direction: column;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.app-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
}

.search-container {
    display: flex;
    gap: 12px;
    align-items: center;
}

.help-tooltip {
    position: relative;
    cursor: help;
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s;
}

.help-tooltip:hover .help-icon {
    border-color: var(--accent);
    color: var(--accent);
}

.tooltip-content {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    width: 320px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-main);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 1000;
}

.tooltip-content ul {
    margin: 8px 0 0 18px;
    padding: 0;
}

.tooltip-content li {
    margin-bottom: 4px;
}

.help-tooltip:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(5px);
}

.search-container input {
    width: 300px;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    outline: none;
}

.search-container input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-container button {
    padding: 0.5rem 1.25rem;
    background: var(--accent-blue);
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.search-container button:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.graph-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.graph-container {
    flex: 1;
    position: relative;
    background: white;
}

.detail-sidebar {
    width: 380px;
    background: var(--sidebar-bg);
    border-left: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 1.5rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

.company-detail-content h3 {
    margin-top: 0;
    font-size: 1.5rem;
    color: var(--header-bg);
    border-bottom: 2px solid var(--accent-blue);
    padding-bottom: 0.5rem;
}

.section-title {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    margin-top: 1.5rem;
    letter-spacing: 0.05em;
}

.article-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.article-list li {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.article-list li:last-child {
    border-bottom: none;
}

.article-list a {
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.article-list a:hover .article-title {
    color: var(--accent-blue);
}

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

.article-title {
    font-weight: 600;
    line-height: 1.4;
}

.article-source {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.sidebar-actions {
    margin-top: 2rem;
}

.expand-btn {
    width: 100%;
    padding: 0.75rem;
    background: white;
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.expand-btn:hover {
    background: var(--accent-blue);
    color: white;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    z-index: 10;
}

.hidden {
    display: none !important;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Footer / Disclaimer integration */
.footer {
    padding: 24px 40px;
    border-top: 1px solid var(--border-color);
    background: #f8fafc;
    flex-shrink: 0;
}

.footer-disclaimer {
    font-size: 10px;
    color: #64748b;
    line-height: 1.7;
}

.footer-disclaimer-title {
    font-weight: 600;
    color: #475569;
    font-size: 11px;
    margin-bottom: 4px;
}

.footer-disclaimer ul {
    margin: 0;
    padding-left: 20px;
}

.footer-disclaimer li {
    margin-bottom: 4px;
}

.footer-copyright {
    margin-top: 12px;
    font-size: 9px;
    color: #94a3b8;
}