/**
 * Financial Headlines Component Styles
 * 
 * Styles for the financial headlines feed section
 */

/* Headlines Container */
#financial-headlines-standalone {
    display: block;
    clear: both;
    width: 100%;
    margin: 30px 0 40px 0;
    position: relative;
    z-index: 1;
}

#financial-headlines-standalone h2 {
    font-size: 24px;
    margin-bottom: 16px;
    font-weight: 700;
    display: block;
}

/* Feed Container */
.financial-feed-container {
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
    min-height: 450px;
    margin-bottom: 24px;
    display: block;
    margin-top: 0;
}

/* Theme-specific container styles */
.light-mode .financial-feed-container {
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.dark-mode .financial-feed-container {
    background-color: var(--color-background-secondary);
    border: 1px solid var(--color-border-primary);
}

/* Header styling */
.financial-feed-header {
    background-color: var(--color-background-secondary);
    color: var(--color-text-primary);
    padding: 15px 20px;
    border-bottom: 1px solid var(--color-border-medium);
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Title container */
.financial-feed-title-container {
    display: flex;
    align-items: center;
    flex: 1;
}

/* Feed title */
.financial-feed-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
}

/* Theme-specific title styles */
.light-mode .financial-feed-title {
    color: #000000;
}

.dark-mode .financial-feed-title {
    color: #ffffff;
}

/* Control buttons container */
.financial-feed-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Live indicator */
.finance-live-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: var(--color-brand-primary);
    border-radius: 50%;
    margin-right: 10px;
    position: relative;
}

/* Animation for live indicator */
.finance-live-indicator:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-brand-primary);
    opacity: 0.6;
    border-radius: 50%;
    animation: financePulse 2s infinite;
}

@keyframes financePulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Refresh button animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.financial-refresh-button.refreshing svg {
    animation: spin 1s linear infinite;
}

/* Feed list */
.financial-feed-list {
    position: relative;
    padding-left: 20px;
    list-style: none;
    margin: 0;
    max-height: 400px;
    height: 400px;
    overflow-y: auto;
    display: block;
    transition: max-height 0.3s ease, height 0.3s ease;
    padding-right: 15px;
}

/* Theme-specific feed list styles */
.light-mode .financial-feed-list {
    background-color: #f5f7fa;
}

.dark-mode .financial-feed-list {
    background-color: var(--color-background-primary);
}

/* Expanded state */
.financial-feed-list.expanded {
    max-height: 800px;
    height: 800px;
}

/* Individual news item */
.financial-news-item {
    position: relative;
    padding: 15px 15px 15px 0;
    transition: background-color 0.2s ease;
    display: block;
    width: 100%;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dark-mode .financial-news-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Timestamp styling */
.financial-news-time {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
}

/* Theme-specific timestamp color */
.light-mode .financial-news-time {
    color: #0077D8;
}

.dark-mode .financial-news-time {
    color: var(--color-brand-primary);
}

/* News headline container */
.financial-news-headline {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    letter-spacing: 0.01em;
    width: 100%;
}

/* Text styling */
.financial-news-headline .headline-text {
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-block;
    width: 100%;
    padding-right: 15px;
    box-sizing: border-box;
    cursor: default;
}

/* Theme-specific headline colors */
.light-mode .financial-news-headline .headline-text {
    color: #1a2b3c;
}

.dark-mode .financial-news-headline .headline-text {
    color: var(--color-text-primary);
}

/* Highlight for headline that's being read */
.financial-news-item.headline-reading {
    background-color: rgba(252, 208, 10, 0.1);
    animation: headline-reading-pulse 2s infinite ease-in-out;
}

@keyframes headline-reading-pulse {
    0% { background-color: rgba(252, 208, 10, 0.05); }
    50% { background-color: rgba(252, 208, 10, 0.15); }
    100% { background-color: rgba(252, 208, 10, 0.05); }
}

.dark-mode .financial-news-item.headline-reading {
    background-color: rgba(252, 208, 10, 0.15);
}

@keyframes headline-reading-pulse-dark {
    0% { background-color: rgba(252, 208, 10, 0.1); }
    50% { background-color: rgba(252, 208, 10, 0.2); }
    100% { background-color: rgba(252, 208, 10, 0.1); }
}

/* Control buttons */
.financial-refresh-button,
.financial-expand-button,
.timezone-selector-button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-left: 5px;
    padding: 0;
}

/* Timezone selector button - special styling */
.timezone-selector-button {
    width: auto;
    height: 32px;
    border-radius: 16px;
    padding: 0 12px;
    background-color: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 6px;
}

.dark-mode .timezone-selector-button {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.timezone-selector-button svg {
    width: 14px;
    height: 14px;
    fill: var(--color-text-primary);
}

.current-timezone {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-primary);
    white-space: nowrap;
}

/* Button focus states */
.financial-refresh-button:focus,
.financial-expand-button:focus,
.timezone-selector-button:focus {
    outline: none;
    box-shadow: none;
}

.financial-refresh-button:focus-visible,
.financial-expand-button:focus-visible,
.timezone-selector-button:focus-visible {
    outline: 2px solid #fcd00a;
    outline-offset: 2px;
}

/* Hover states for buttons */
.financial-refresh-button:hover,
.financial-expand-button:hover {
    background-color: #fcd00a;
}

.timezone-selector-button:hover {
    background-color: rgba(252, 208, 10, 0.2);
    border-color: rgba(252, 208, 10, 0.3);
}

.financial-refresh-button svg,
.financial-expand-button svg {
    width: 16px;
    height: 16px;
    fill: var(--color-text-primary);
}

.financial-refresh-button:hover svg,
.financial-expand-button:hover svg {
    fill: #ffffff;
}

/* Light mode hover colors */
.timezone-selector-button:hover svg {
    fill: #000000;
}

.timezone-selector-button:hover .current-timezone {
    color: #000000;
    text-decoration: none;
}

.dark-mode .timezone-selector-button:hover {
    background-color: rgba(252, 208, 10, 0.2);
}

.dark-mode .timezone-selector-button:hover svg,
.dark-mode .timezone-selector-button:hover .current-timezone {
    color: #ffffff !important;
    fill: #ffffff !important;
    text-decoration: none;
}

/* Timezone dropdown styling */
.timezone-dropdown {
    position: absolute;
    z-index: 1000;
    min-width: 220px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.dark-mode .timezone-dropdown {
    background: var(--color-background-secondary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.timezone-option {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text-primary);
    transition: background-color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timezone-option:hover {
    background-color: rgba(252, 208, 10, 0.15);
}

.timezone-option.active {
    background-color: rgba(252, 208, 10, 0.25);
    font-weight: 600;
}

.dark-mode .timezone-option {
    color: var(--color-text-primary);
}

.dark-mode .timezone-option:hover {
    background-color: rgba(252, 208, 10, 0.2);
}

.dark-mode .timezone-option.active {
    background-color: rgba(252, 208, 10, 0.3);
}

.timezone-separator {
    height: 1px;
    background-color: rgba(0, 0, 0, 0.1);
    margin: 4px 0;
}

.dark-mode .timezone-separator {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Status indicator */
.feed-status-indicator {
    position: absolute;
    bottom: 15px;
    right: 15px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

/* Theme-specific status indicator */
.light-mode .feed-status-indicator {
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
}

.dark-mode .feed-status-indicator {
    background-color: var(--color-brand-primary);
    color: #000000;
}

.feed-status-indicator:hover {
    opacity: 1;
}

/* Custom scrollbar styling */
/* WebKit browsers */
.financial-feed-list::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.light-mode .financial-feed-list::-webkit-scrollbar-track {
    background: #eaeef2;
    border-radius: 4px;
}

.dark-mode .financial-feed-list::-webkit-scrollbar-track {
    background: var(--color-background-tertiary);
    border-radius: 4px;
}

.light-mode .financial-feed-list::-webkit-scrollbar-thumb {
    background: #c1c5cb;
    border-radius: 4px;
    border: 2px solid #eaeef2;
}

.dark-mode .financial-feed-list::-webkit-scrollbar-thumb {
    background: var(--color-border-medium);
    border-radius: 4px;
    border: 2px solid var(--color-background-tertiary);
}

.light-mode .financial-feed-list::-webkit-scrollbar-thumb:hover {
    background: #a8acb5;
}

.dark-mode .financial-feed-list::-webkit-scrollbar-thumb:hover {
    background: var(--color-brand-primary);
}

/* Firefox */
.financial-feed-list {
    scrollbar-width: thin;
}

.light-mode .financial-feed-list {
    scrollbar-color: #c1c5cb #eaeef2;
}

.dark-mode .financial-feed-list {
    scrollbar-color: var(--color-border-medium) var(--color-background-tertiary);
}

/* Dropdown scrollbar - WebKit browsers */
.timezone-dropdown::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.light-mode .timezone-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.dark-mode .timezone-dropdown::-webkit-scrollbar-track {
    background: var(--color-background-tertiary);
    border-radius: 3px;
}

.light-mode .timezone-dropdown::-webkit-scrollbar-thumb {
    background: #c1c5cb;
    border-radius: 3px;
}

.dark-mode .timezone-dropdown::-webkit-scrollbar-thumb {
    background: var(--color-border-medium);
    border-radius: 3px;
}

/* Firefox */
.timezone-dropdown {
    scrollbar-width: thin;
}

.light-mode .timezone-dropdown {
    scrollbar-color: #c1c5cb #f1f1f1;
}

.dark-mode .timezone-dropdown {
    scrollbar-color: var(--color-border-medium) var(--color-background-tertiary);
}

/* Remove underlines on hover for buttons */
.timezone-selector-button,
.timezone-selector-button *,
.timezone-selector-button:hover,
.timezone-selector-button:hover * {
    text-decoration: none !important;
}

/* Ensure span has no underline */
.timezone-selector-button .current-timezone,
.timezone-selector-button:hover .current-timezone {
    text-decoration: none !important;
    border-bottom: none !important;
}

/* Target any anchors that might be inside */
.timezone-selector-button a,
.timezone-selector-button a:hover,
.financial-feed-controls a,
.financial-feed-controls a:hover {
    text-decoration: none !important;
    border-bottom: none !important;
}

/* Responsive styles for mobile devices */
@media (max-width: 767px) {
    /* Adjust header layout for mobile screens */
    .financial-feed-header {
        padding: 12px 15px;
        flex-wrap: wrap;
    }
    
    /* Ensure controls are visible and properly sized on mobile */
    .financial-feed-controls {
        display: flex;
        margin-left: auto; /* Push to the right side */
    }
    
    /* Slightly smaller buttons on mobile for better touch targets */
    .financial-refresh-button,
    .financial-expand-button {
        width: 36px;
        height: 36px;
    }
    
    /* Adjust feed list padding for mobile */
    .financial-feed-list {
        padding-left: 15px;
        padding-right: 10px;
    }
    
    /* Make the feed status indicator smaller and more out of the way */
    .feed-status-indicator {
        bottom: 10px;
        right: 10px;
        font-size: 11px;
        padding: 4px 10px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .financial-feed-title {
        font-size: 16px;
    }
} 