:root {
    --bg: #0f172a;
    --glass: rgba(30, 41, 59, 0.7);
    --border: rgba(255, 255, 255, 0.1);
    --accent: #7c3aed;
    --accent-hover: #9333ea;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --sidebar-width: 320px;
}

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

body.nebula-dark {
    background-color: var(--bg);
    background-image:
        radial-gradient(at 0% 0%, rgba(124, 58, 237, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(14, 165, 233, 0.15) 0px, transparent 50%);
    font-family: 'Inter', sans-serif;
    color: var(--text);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.glass-container {
    width: 95vw;
    height: 90vh;
    background: var(--glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 24px;
    display: flex;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    border-right: 1px solid var(--border);
    padding: 32px;
    display: flex;
    flex-direction: column;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 800;
}

.logo small {
    background: linear-gradient(to right, #7c3aed, #0ea5e9);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 32px;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
}

.archives h2 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

#archive-list {
    list-style: none;
    overflow-y: auto;
    flex-grow: 1;
}

.archive-item {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    border: 1px solid transparent;
}

.archive-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.archive-item.active {
    background: rgba(124, 58, 237, 0.1);
    border-color: rgba(124, 58, 237, 0.3);
    color: #a78bfa;
}

/* Main Content */
.content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.content-header {
    padding: 32px 40px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#main-title {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    margin-top: 8px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

.badge {
    background: rgba(124, 58, 237, 0.2);
    color: #a78bfa;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

#status-tag {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

#status-tag::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
}

/* Viewer */
.viewer {
    padding: 40px;
    overflow-y: auto;
    flex-grow: 1;
}

.viewer.empty {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.empty-state h3 {
    margin: 20px 0 10px;
    font-size: 20px;
}

.empty-state p {
    color: var(--text-muted);
    max-width: 300px;
}

/* Newsletter Rendering */
.newsletter-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
}

.section-label {
    display: block;
    margin-bottom: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent);
}

.highlight-title {
    font-size: 28px;
    margin-bottom: 16px;
    line-height: 1.3;
}

.desc {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 24px;
}

.so-what {
    background: rgba(124, 58, 237, 0.1);
    border-left: 4px solid var(--accent);
    padding: 16px;
    border-radius: 0 8px 8px 0;
    font-size: 14px;
}

.news-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.sub-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 12px;
}

.sub-card h4 {
    margin-bottom: 10px;
    font-size: 16px;
}

.action-tip {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: #10b981;
}

.takeaway-box {
    margin-top: 40px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(14, 165, 233, 0.1));
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 16px;
    font-style: italic;
    text-align: center;
    line-height: 1.6;
}

/* Toast */
#toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 12px 24px;
    border-radius: 99px;
    font-size: 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 100;
    transition: all 0.3s ease;
}

#toast.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}

.news-link {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.news-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

@media (max-width: 1024px) {
    .news-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        width: 260px;
    }
}