/* News Layout Container */
.news-layout {
    display: flex;
    flex-direction: column;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

/* Right Sidebar Container */
.right-sidebar {
    display: flex;
    flex-direction: column;
    width: 350px;
    flex-shrink: 0;
}

/* Market Outlook Sidebar */
.market-outlook-sidebar {
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    display: block;
}

.market-outlook-header {
    margin-bottom: 20px;
}

.market-outlook-header h3 {
    color: #caa999;
    font-size: 28px;
    font-weight: 600;
    margin: 0;
}

.market-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Market Charts in Market Overview: 4 in a row */
.market-charts-overview .market-cards-grid {
    grid-template-columns: repeat(4, 1fr);
}

.market-card {
    background: #1c1c1c;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 4px 8px 4px 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.market-card:hover {
    transform: scale(1.02);
    background: #222;
    border-color: #333;
}

.market-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: auto;
}

.market-symbol {
    color: #e5e5e5;
    font-size: 15px;
    font-weight: 500;
}

.market-price {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-top: auto;
    margin-bottom: 0;
}

.market-changes {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.market-change {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-feature-settings: 'tnum';
    font-size: 12px;
    font-weight: 500;
}

.market-change-dollar {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-feature-settings: 'tnum';
    font-size: 11px;
    font-weight: 400;
}

.market-change.positive,
.market-change-dollar.positive {
    color: #7CC3E4 !important;
}

.market-change.negative,
.market-change-dollar.negative {
    color: #FF6B6B !important;
}

.market-chart {
    height: 42px;
    display: flex;
    align-items: end;
    margin-top: 8px;
}

.market-chart svg {
    width: 100%;
    height: 42px;
}

/* Показывать Market Outlook только в режиме новостей */
.news-container[style*="display: flex"] ~ .market-outlook-sidebar {
    display: block;
}

/* Top Gainers Sidebar */
.top-gainers-sidebar {
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-top: 40px;
    box-shadow: none;
    display: block;
}

.top-gainers-header {
    margin-bottom: 20px;
}

.top-gainers-header h3 {
    color: #e5e5e5;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.gainers-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.gainer-item {
    background: #1c1c1c;
    border: 1px solid #2a2a2a;
    border-radius: 0;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border-top: none;
}

.gainer-item:first-child {
    border-radius: 8px 8px 0 0;
    border-top: 1px solid #2a2a2a;
}

.gainer-item:last-child {
    border-radius: 0 0 8px 8px;
}

.gainer-item:hover {
    background: #222;
    border-color: #333;
    transform: translateX(4px);
}

.gainer-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gainer-symbol {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.gainer-name {
    color: #888;
    font-size: 12px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gainer-data {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.gainer-price {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.gainer-change {
    font-size: 12px;
    font-weight: 500;
}

.gainer-change.positive {
    color: #7CC3E4 !important;
}

.gainer-change.negative {
    color: #FF6B6B !important;
}

/* Показывать Top Gainers только в режиме новостей */
.news-container[style*="display: flex"] ~ .market-outlook-sidebar ~ .top-gainers-sidebar {
    display: block;
}
