/* --- Base CSS Variables & Reset --- */
:root {
    --bg-base: #090b11;
    --bg-surface: rgba(18, 22, 35, 0.75);
    --bg-surface-hover: rgba(26, 32, 51, 0.85);
    --accent: #2e62ff;
    --accent-glow: rgba(46, 98, 255, 0.35);
    --text-primary: #f3f5f9;
    --text-secondary: #8a96ab;
    --text-muted: #576378;
    --border-color: rgba(255, 255, 255, 0.07);
    --border-color-hover: rgba(255, 255, 255, 0.15);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    height: 100vh;
}

/* --- Decorative Blur Elements --- */
.glow-bg {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.25;
    pointer-events: none;
    animation: glow-float 15s infinite alternate ease-in-out;
}
.glow-1 {
    top: -100px;
    left: -100px;
    background: var(--accent);
}
.glow-2 {
    bottom: -150px;
    right: -100px;
    background: #a855f7;
    animation-delay: -5s;
}

@keyframes glow-float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(60px, 40px) scale(1.15); }
}

/* --- Layout Grid --- */
.app-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100vh;
    overflow: hidden;
}

/* --- Sidebar --- */
.sidebar {
    background: rgba(10, 12, 20, 0.85);
    border-right: 1px solid var(--border-color);
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    backdrop-filter: blur(12px);
    z-index: 10;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand-icon {
    font-size: 26px;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.brand-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 24px;
    letter-spacing: -0.5px;
}
.nav-menu {
    margin-top: 50px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.nav-item {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}
.nav-item:hover, .nav-item.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}
.nav-item.active {
    box-shadow: inset 3px 0 0 var(--accent);
}
.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status-indicator.online {
    background-color: #22c55e;
    box-shadow: 0 0 8px #22c55e;
}
.status-text {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- Main Content Area --- */
.main-content {
    overflow-y: auto;
    padding: 40px 48px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* --- Header Section --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.page-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 32px;
    letter-spacing: -0.5px;
}
.page-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
}
.search-box {
    position: relative;
    width: 380px;
}
.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}
.search-box input {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 14px 20px 14px 48px;
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    transition: var(--transition);
    outline: none;
    backdrop-filter: blur(12px);
}
.search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
    background: var(--bg-surface-hover);
}

/* --- Common Sections --- */
.section-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 20px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* --- Asset Discovery Scroll --- */
.assets-scroll-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.assets-container {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 8px 4px;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    width: 100%;
}
.assets-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}
.scroll-nav {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: var(--transition);
    backdrop-filter: blur(8px);
}
.scroll-nav:hover {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}
.scroll-left { left: -18px; }
.scroll-right { right: -18px; }

/* --- Asset Card --- */
.asset-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 250px;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(12px);
    user-select: none;
    box-shadow: var(--shadow);
}
.asset-card:hover, .asset-card.selected {
    transform: translateY(-2px);
    background: var(--bg-surface-hover);
    border-color: var(--border-color-hover);
}
.asset-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 16px var(--accent-glow);
}
.asset-logo-container {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.asset-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}
.asset-logo-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--text-secondary);
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
    font-size: 16px;
}
.asset-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}
.asset-name {
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.asset-isin {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: monospace;
}

/* --- Placeholder Placeholders --- */
.placeholder-card {
    height: 74px;
    min-width: 250px;
    opacity: 0.15;
    background: linear-gradient(90deg, #121623 25%, #1d2338 50%, #121623 75%);
    background-size: 200% 100%;
    animation: shimer 1.5s infinite;
}
@keyframes shimer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Filters Bar --- */
.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 24px;
}
.active-filters {
    display: flex;
    gap: 8px;
}
.filter-tag {
    background: rgba(46, 98, 255, 0.12);
    border: 1px solid rgba(46, 98, 255, 0.35);
    color: #4f80ff;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}
.filter-remove-btn {
    border: none;
    background: transparent;
    color: #4f80ff;
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
}
.filter-remove-btn:hover {
    color: #e11d48;
}

/* --- News Feed --- */
.news-feed {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.news-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
}
.news-card:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-color-hover);
    transform: translateX(4px);
}
.news-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.news-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}
.news-source {
    font-weight: 600;
    color: var(--accent);
}
.news-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--text-muted);
}
.news-date {
    font-weight: 400;
}
.news-card-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 20px;
    letter-spacing: -0.3px;
    color: var(--text-primary);
}
.news-card-summary {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}
.news-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}
.asset-tag {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}
.asset-tag:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

/* --- Empty State --- */
.empty-feed {
    text-align: center;
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--text-secondary);
}
.empty-feed-icon {
    font-size: 48px;
    color: var(--text-muted);
}

/* --- Infinite Scroll Trigger / Spinner --- */
.infinite-scroll-trigger {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    gap: 12px;
    visibility: hidden; /* Only visible when loading */
}
.infinite-scroll-trigger.active {
    visibility: visible;
}
.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.loading-text {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Modal Backdrop --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 6, 10, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(16px);
}
.modal-backdrop.open {
    opacity: 1;
    pointer-events: all;
}
.modal-card {
    background: #0d111d;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 720px;
    max-width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 40px;
    position: relative;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.modal-backdrop.open .modal-card {
    transform: translateY(0);
}
.modal-close {
    position: absolute;
    right: 24px;
    top: 24px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
}
.modal-close:hover {
    color: var(--text-primary);
}
.modal-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}
.modal-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}
.modal-source {
    font-weight: 600;
    color: var(--accent);
}
.modal-date {
    color: var(--text-secondary);
}
.modal-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 26px;
    line-height: 1.3;
    letter-spacing: -0.5px;
}
.modal-assets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.modal-body {
    overflow-y: auto;
    flex-grow: 1;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 24px;
    padding-right: 12px;
}
.modal-body p {
    margin-bottom: 16px;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}
.btn-external {
    background: var(--accent);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}
.btn-external:hover {
    box-shadow: 0 0 16px var(--accent-glow);
    background: #4071ff;
}

/* Badges */
.badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
}
.badge-pending {
    background: rgba(234, 179, 8, 0.12);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.3);
}
.badge-completed {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.news-card-pending {
    border-left: 3px solid #eab308;
}
