:root {
    --bg-dark: #0f111a;
    --sidebar-bg: #161922;
    --card-bg: rgba(255, 255, 255, 0.03);
    --primary: #00d2ff;
    --accent: #3b82f6;
    --text-main: #f1f5f9;
    --text-dim: #94a3b8;
    --text-blue: #00d2ff;
    --trend-up: #4ade80;
    --trend-flat: #64748b;
    --trend-new: #f472b6;
    --border: rgba(255, 255, 255, 0.08);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
    line-height: 1.5;
}

.glow-bg {
    position: fixed;
    top: -10%;
    right: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.08) 0%, transparent 60%);
    z-index: -1;
    pointer-events: none;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Layout */
.sidebar {
    width: 320px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
}

.logo-area {
    margin-bottom: 3.5rem;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.logo span {
    color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(0, 210, 255, 0.3));
}

.tagline {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 400;
    opacity: 0.8;
}

.category-nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-grow: 1;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-dim);
    text-align: left;
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.nav-item:hover {
    color: var(--primary);
    background: rgba(0, 210, 255, 0.05);
}

.nav-item.active {
    color: var(--primary);
    background: rgba(0, 210, 255, 0.1);
    box-shadow: inset 0 0 0 1px rgba(0, 210, 255, 0.3);
}

.sidebar-footer {
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-dim);
}

.sidebar-footer a {
    color: var(--primary);
    text-decoration: none;
    display: block;
    margin-top: 0.5rem;
}

/* Content Area */
.content-area {
    flex-grow: 1;
    padding: 2.5rem 4rem;
    max-width: 1400px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3.5rem;
    position: sticky;
    top: 2.5rem;
    z-index: 90;
    backdrop-filter: blur(20px);
    background: rgba(15, 17, 26, 0.8);
    padding: 1rem;
    border-radius: 16px;
    margin-top: -1rem;
}

.search-container {
    position: relative;
    width: 450px;
}

#search-input {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    padding-left: 3rem;
    color: white;
    font-size: 0.95rem;
    transition: var(--transition);
}

#search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.6;
}

/* Section Styling */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
}

.results-meta {
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* Keyword Cloud */
.keyword-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 4rem;
}

.keyword-tag {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
}

.keyword-tag:hover {
    background: rgba(0, 210, 255, 0.1);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.keyword-tag.active {
    background: var(--primary);
    color: var(--bg-dark);
    border-color: var(--primary);
}

.keyword-tag .count {
    opacity: 0.6;
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
}

.trend-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.trend-up { background-color: var(--trend-up); }
.trend-flat { background-color: var(--trend-flat); }
.trend-new { background-color: var(--trend-new); }

/* News List */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.news-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    transform: scaleY(0);
    transition: var(--transition);
}

.news-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(10px);
}

.news-card:hover::before {
    transform: scaleY(1);
}

.news-card .card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.news-card .id-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--primary);
    opacity: 0.7;
}

.news-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.4;
    color: var(--text-main);
}

.news-card p {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    max-width: 800px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-tags {
    display: flex;
    gap: 0.5rem;
}

.card-tag {
    font-size: 0.75rem;
    background: rgba(0, 210, 255, 0.08);
    color: var(--primary);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition);
}

.card-tag:hover {
    background: rgba(0, 210, 255, 0.2);
}

.read-more {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.read-more::after {
    content: '→';
    transition: var(--transition);
}

.read-more:hover::after {
    transform: translateX(4px);
}

.theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    white-space: nowrap;
}

.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Light Theme */
body.theme-light {
    --bg-dark: #f1f5f9;
    --sidebar-bg: #ffffff;
    --card-bg: rgba(0, 0, 0, 0.03);
    --text-main: #1e293b;
    --text-dim: #64748b;
    --border: rgba(0, 0, 0, 0.1);
}

body.theme-light .glow-bg {
    background: radial-gradient(circle, rgba(0, 150, 200, 0.06) 0%, transparent 60%);
}

body.theme-light .top-bar {
    background: rgba(241, 245, 249, 0.85);
}

body.theme-light #search-input {
    color: var(--text-main);
}

body.theme-light #search-input::placeholder {
    color: var(--text-dim);
}

body.theme-light .news-card:hover {
    background: rgba(0, 0, 0, 0.04);
}

@media (max-width: 1024px) {
    .sidebar { width: 80px; padding: 1.5rem 0.5rem; text-align: center; }
    .logo-area, .sidebar-footer, .nav-item span { display: none; }
    .nav-item { padding: 1rem; justify-content: center; }
    .content-area { padding: 2rem; }
}
