/* Bloomberg-Style News Aggregator - Unified Feed */

:root {
    --news-accent: #00ff41;
    --news-bg-dark: #0a0a0a;
    --news-bg-main: #0d0d0d;
    --news-card-bg: #161b22;
    --news-border: rgba(255, 255, 255, 0.1);
    --news-text-main: #e0e0e0;
    --news-text-dim: #888888;
    --news-text-muted: #666666;
    --news-hover: rgba(255, 255, 255, 0.05);
}

#portal-wrapper.news-wrapper {
    max-width: 100vw;
    width: 100vw;
    padding: 0;
}

.news-container {
    padding: 0;
    width: 100%;
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--news-text-main);
    background: var(--news-bg-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.news-header-terminal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: #000000;
    border-bottom: 1px solid var(--news-border);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--news-accent);
    margin-right: 10px;
    box-shadow: 0 0 5px var(--news-accent);
}

.pulsate {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.terminal-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.ctrl-btn {
    background: transparent;
    border: none;
    color: var(--news-text-dim);
    cursor: pointer;
    padding: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 4px;
}

.ctrl-btn:hover {
    color: var(--news-accent);
    background: var(--news-hover);
}

/* Main Grid Layout */
.news-grid {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
    background: var(--news-bg-dark);
}

/* Main Feed Area - Bloomberg Style */
.news-feed {
    flex-grow: 1;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
    overflow-y: auto;
    background: var(--news-bg-main);
}

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 32px;
    background: var(--news-bg-main);
    border-bottom: 1px solid var(--news-border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(13, 13, 13, 0.95);
}

.feed-header-left {
    flex: 1;
}

.feed-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--news-text-main);
    margin: 0 0 4px 0;
    letter-spacing: -0.5px;
}

.feed-subtitle {
    font-size: 0.875rem;
    color: var(--news-text-dim);
    margin: 0;
}

.feed-header-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
}

.feed-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.news-search {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--news-border);
    border-radius: 6px;
    color: var(--news-text-main);
    font-size: 0.875rem;
    width: 240px;
    transition: all 0.2s;
    font-family: inherit;
}

.news-search:focus {
    outline: none;
    border-color: var(--news-accent);
    background: rgba(255, 255, 255, 0.08);
}

.news-search::placeholder {
    color: var(--news-text-muted);
}

.source-filter {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--news-border);
    border-radius: 6px;
    color: var(--news-text-main);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.source-filter:focus {
    outline: none;
    border-color: var(--news-accent);
}

.feed-info {
    font-size: 0.75rem;
    color: var(--news-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.fetch-status {
    font-size: 0.7rem;
    color: var(--news-accent);
    font-family: 'JetBrains Mono', monospace;
}

/* Feed Items Container */
.feed-items {
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Time Groups */
.time-group {
    margin-bottom: 32px;
}

.time-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--news-border);
}

.time-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--news-text-main);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.time-count {
    font-size: 0.75rem;
    color: var(--news-text-dim);
}

.time-group-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* News Items - Bloomberg Style */
.news-item {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 20px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.2s;
}

.news-item:hover {
    background: var(--news-hover);
    margin: 0 -16px;
    padding: 16px;
    border-radius: 4px;
}

.news-item-time {
    font-size: 0.75rem;
    color: var(--news-text-dim);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    padding-top: 2px;
}

.news-item-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.news-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.news-source-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: var(--source-color);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.news-source-name {
    font-size: 0.75rem;
    color: var(--news-text-dim);
    font-weight: 500;
}

.news-category {
    font-size: 0.7rem;
    color: var(--news-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.news-heat {
    font-size: 0.7rem;
    color: var(--news-text-muted);
    margin-left: auto;
}

.news-title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 400;
}

.news-title a {
    color: var(--news-text-main);
    text-decoration: none;
    transition: color 0.2s;
}

.news-title a:hover {
    color: var(--news-accent);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--news-text-dim);
}

.empty-state p {
    font-size: 1rem;
    margin: 0;
}

/* Skeleton Loader */
.skeleton-container {
    padding: 24px 32px;
}

.skeleton-item {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 20px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.skeleton-line {
    height: 12px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-line:last-child {
    margin-bottom: 0;
}

.skeleton-line.width-20 { width: 20%; }
.skeleton-line.width-30 { width: 30%; }
.skeleton-line.width-40 { width: 40%; }
.skeleton-line.width-50 { width: 50%; }
.skeleton-line.width-60 { width: 60%; }
.skeleton-line.width-70 { width: 70%; }
.skeleton-line.width-80 { width: 80%; }
.skeleton-line.width-90 { width: 90%; }

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive */
@media (max-width: 1024px) {
    .feed-header {
        flex-direction: column;
        gap: 16px;
        padding: 20px 24px;
    }

    .feed-header-right {
        width: 100%;
        align-items: stretch;
    }

    .feed-controls {
        width: 100%;
    }

    .news-search {
        flex: 1;
    }

    .feed-items {
        padding: 20px 24px;
    }
}

@media (max-width: 768px) {
    .news-item {
        grid-template-columns: 60px 1fr;
        gap: 12px;
        padding: 12px 0;
    }

    .news-item-time {
        font-size: 0.7rem;
    }

    .news-title {
        font-size: 0.9rem;
    }

    .feed-header {
        padding: 16px 20px;
    }

    .feed-title {
        font-size: 1.5rem;
    }

    .feed-items {
        padding: 16px 20px;
    }

    .news-search {
        width: 100%;
    }

    .feed-controls {
        flex-direction: column;
    }

    .source-filter {
        width: 100%;
    }
}
