/**
 * Market Ticker Component Styles
 * 
 * A horizontal scrolling ticker for displaying financial market data
 * with clean styling and proper single-row display.
 */

/* Main ticker container */
.market-ticker-container {
    position: relative;
    width: 100%;
    background-color: rgb(22, 22, 22)
    ;
    overflow: hidden;
    height: 40px;
    display: flex;
    align-items: center;
    z-index: 100; /* Ensure ticker is above other elements */
}

/* Time indicator section */
.ticker-time-indicator {
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    border-right: 2px solid rgba(252, 208, 8, 0.5);
    margin-right: 1px;
    min-width: 180px;
    flex-shrink: 0;
}

.ticker-time-label {
    font-weight: 700;
    font-size: 12px;
    color: #ffffff;
    margin-right: 8px;
    letter-spacing: 0.5px;
}

.ticker-time-value {
    font-size: 12px;
    color: #ffffff;
    font-weight: 500;
}

/* Main ticker area */
.market-ticker {
    position: relative;
    flex-grow: 1;
    height: 100%;
    overflow: hidden;
}

/* Create gradient fades on the edges of the ticker */
.market-ticker::before,
.market-ticker::after {
    content: "";
    position: absolute;
    top: 0;
    width: 30px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.market-ticker::before {
    left: 0;
    background: linear-gradient(to right, #121212ff, transparent);
}

.market-ticker::after {
    right: 0;
    background: linear-gradient(to left, #121212ff, transparent);
}

/* Ticker list */
#market-ticker-list {
    display: flex;
    align-items: center;
    height: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    white-space: nowrap;
    will-change: transform; /* Optimize for animation performance */
    transition: transform 0.1s linear; /* Smooth transition when pausing */
}

/* Ticker items */
.ticker-item {
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: 100%;
    white-space: nowrap;
    margin-right: 8px; /* Add spacing between ticker items */
}

.ticker-symbol {
    font-weight: 700;
    font-size: 13px;
    color: var(--ticker-text, #ffffff);
    margin-right: 10px;
    letter-spacing: 0.2px; /* Slightly improved letter spacing */
}

.ticker-value, .ticker-price {
    font-size: 14px; /* Slightly larger font */
    color: var(--ticker-text, #ffffff);
    margin-right: 10px; /* Increased spacing */
    font-family: 'Roboto Mono', monospace, sans-serif;
    font-feature-settings: "tnum";
    letter-spacing: -0.2px; /* Better letter spacing */
    font-weight: 600; /* Bolder font for better visibility */
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.8); /* Subtle text shadow for better contrast */
}

.ticker-change {
    font-size: 13px;
    font-weight: 600; /* Bolder font */
    padding: 2px 8px; /* Slightly larger padding */
    border-radius: 3px;
    font-feature-settings: "tnum";
    letter-spacing: 0px; /* Standard spacing */
    display: flex;
    align-items: center;
}

/* Triangle icons for price changes (Bloomberg style) */
.ticker-change::before {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    margin-right: 4px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
}

.ticker-change.positive {
    color: var(--color-data-positive, #1AC759);
    text-shadow: 0 0 2px rgba(26, 199, 89, 0.3); /* Subtle glow effect */
}

.ticker-change.positive::before {
    border-bottom: 6px solid var(--color-data-positive, #1AC759);
    border-top: 0;
}

.ticker-change.negative {
    color: var(--color-data-negative, #FF3B30);
    text-shadow: 0 0 2px rgba(255, 59, 48, 0.3); /* Subtle glow effect */
}

.ticker-change.negative::before {
    border-top: 6px solid var(--color-data-negative, #FF3B30);
    border-bottom: 0;
}

.ticker-change.neutral {
    color: var(--ticker-text, #ffffff);
}

.ticker-change.neutral::before {
    display: none; /* No triangle for neutral values */
}

/* Ticker controls */
.ticker-controls {
    display: none; /* Hide the controls section completely */
}

.ticker-pause-button {
    background: none;
    border: none;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--ticker-text, #ffffff);
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.ticker-pause-button:hover {
    opacity: 1;
}

.ticker-pause-button:focus {
    outline: 2px solid var(--ticker-indicator-border, rgba(252, 208, 8, 0.5));
    outline-offset: 2px;
}

.ticker-pause-button svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Responsive styles */
@media (max-width: 768px) {
    .market-ticker-container {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }
    
    .ticker-time-indicator {
        min-width: 120px;
        flex-shrink: 0;
    }
    
    .ticker-item {
        padding: 0 12px; /* Slightly increased */
    }
}

@media (max-width: 480px) {
    .market-ticker-container {
        width: 100vw !important;
        max-width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .ticker-time-indicator {
        min-width: 100px;
        padding: 0 10px;
    }
    
    .ticker-symbol {
        font-size: 12px;
        margin-right: 6px;
    }
    
    .ticker-value, .ticker-price {
        font-size: 12px;
        margin-right: 6px;
    }
    
    .ticker-change {
        font-size: 12px;
        padding: 2px 4px;
    }
    
    .ticker-time-label,
    .ticker-time-value {
        font-size: 11px;
    }
} 