/**
 * Crypto Ticker Public Styles
 */

/* Ticker Container */
.crypto-ticker-wrapper {
    /* Default speed removed to avoid conflicts with hero and footer settings */
    --ticker-bg: #ffffff;
    --ticker-text: #333333;
    --ticker-positive: #4caf50;
    --ticker-negative: #f44336;
    --ticker-border: #e0e0e0;
    --ticker-shadow: rgba(0, 0, 0, 0.1);
    
    position: relative;
    width: 100%;
    overflow: hidden;
    margin: 20px 0;
    border-radius: 6px;
    border: 1px solid var(--ticker-border);
    background-color: var(--ticker-bg);
    box-shadow: 0 2px 4px var(--ticker-shadow);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.5;
    transition: opacity 0.3s ease-in-out;
}

/* Dark Theme */
.crypto-ticker-wrapper.theme-dark {
    --ticker-bg: #1e1e1e;
    --ticker-text: #ffffff;
    --ticker-border: #333333;
    --ticker-shadow: rgba(0, 0, 0, 0.3);
}

/* Gradient Theme */
.crypto-ticker-wrapper.theme-gradient {
    --ticker-bg: linear-gradient(to right, #2b5876, #4e4376);
    --ticker-text: #ffffff;
    --ticker-border: transparent;
}

.crypto-ticker-container {
    position: relative;
    width: 100%;
    min-height: 50px;
    overflow: hidden;
}

/* Scrolling Track */
.crypto-ticker-track {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    animation: ticker-scroll var(--ticker-speed) linear infinite;
    padding: 0 10px;
    white-space: nowrap;
    will-change: transform;
    transform: translateX(0);
}

/* Stop animation on hover */
.crypto-ticker-wrapper:hover .crypto-ticker-track {
    animation-play-state: paused;
}

/* Ticker Items */
.ticker-item {
    display: flex;
    align-items: center;
    min-height: 50px;
    padding: 0 15px;
    color: var(--ticker-text);
    white-space: nowrap;
}

/* Symbol Section */
.ticker-symbol {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

/* Enhanced crypto icon styling */
.crypto-symbol-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    position: relative;
    line-height: 1;
}

/* Ensure consistent image display */
.crypto-symbol-icon img.token-logo {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    border-radius: 50%;
    object-fit: contain;
    vertical-align: middle;
    display: block;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.1);
    /* Add subtle border */
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.symbol-name {
    font-weight: 600;
}

/* Price Section */
.ticker-price {
    font-weight: 700;
    margin-right: 15px;
}

/* Change Section */
.ticker-change {
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
    margin-right: 15px;
}

/* Theme Colors for Ticker Changes */
.ticker-change.positive {
    color: #fff;
    background-color: var(--ticker-positive);
}

.ticker-change.negative {
    color: #fff;
    background-color: var(--ticker-negative);
}

/* Theme-specific colors for compatibility */
.ticker-change.positive {
    background: rgba(0, 255, 136, 0.1);
    color: var(--accent-color, #00FF88);
}

.ticker-change.negative {
    background: rgba(255, 0, 138, 0.1);
    color: var(--primary-color, #FF008A);
}

/* Volume and Liquidity */
.ticker-volume,
.ticker-liquidity {
    margin-right: 15px;
    font-size: 0.9em;
}

/* Skeleton Loading */
.crypto-ticker-skeleton {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 50px;
    padding: 0 10px;
    overflow: hidden;
}

.ticker-item-skeleton {
    display: flex;
    align-items: center;
    min-height: 50px;
    padding: 0 15px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.ticker-symbol-skeleton {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

.ticker-logo-skeleton {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #e0e0e0;
    margin-right: 8px;
}

.ticker-name-skeleton {
    width: 70px;
    height: 16px;
    border-radius: 4px;
    background-color: #e0e0e0;
}

.ticker-price-skeleton {
    width: 60px;
    height: 16px;
    border-radius: 4px;
    background-color: #e0e0e0;
    margin-right: 15px;
}

/* No Symbols Message */
.no-symbols-message {
    padding: 15px;
    text-align: center;
    color: var(--ticker-text);
    font-weight: 500;
}

/* Ready State - Hide Skeleton */
.crypto-ticker-wrapper.ready .crypto-ticker-skeleton {
    display: none;
}

/* Animations */
@keyframes ticker-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

@keyframes skeleton-pulse {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.6;
    }
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .crypto-ticker-wrapper {
        margin: 10px 0;
    }
    
    .ticker-item {
        padding: 0 10px;
    }
    
    .token-logo {
        margin-right: 0;
    }
}

/* Featured Symbols Container - From Theme */
.featured-symbols {
    background: transparent;
    padding: 20px 0;
    overflow: hidden;
    width: 100%;
}

/* Hero Crypto Ticker - Big logos, transparent background */
.hero-crypto-ticker {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Remove container styling for the hero ticker */
.hero-crypto-ticker .crypto-ticker-wrapper {
    --ticker-speed: 40s; /* Slower speed for larger ticker */
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

/* Make the container taller for larger logos */
.hero-crypto-ticker .crypto-ticker-container {
    min-height: 200px; /* Increased to fit 4x larger logos */
}

/* Style the ticker items with proper spacing */
.hero-crypto-ticker .ticker-item {
    min-height: 200px; /* Increased to fit 4x larger logos */
    padding: 0 40px; /* Larger padding for hero */
    color: var(--ticker-text, #ffffff);
}

/* Style the symbol container */
.hero-crypto-ticker .ticker-symbol {
    margin-right: 40px; /* Larger margin for hero */
    display: flex;
    align-items: center;
}

/* Make the logo 4x larger (8x the original 24px) */
.hero-crypto-ticker .token-logo,
.hero-crypto-ticker img.token-logo {
    width: 88px; /* 8x the original 24px */
    height: 88px; /* 8x the original 24px */
    margin-right: 0px; /* 3x margin */
}

/* Match container height to logo size */
.hero-crypto-ticker .crypto-symbol-icon {
    height: 192px; /* Match logo height */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Larger text for all elements */
.hero-crypto-ticker .symbol-name {
    font-size: 32px; /* Larger font */
    font-weight: 700;
    margin-left: 30px;
}

.hero-crypto-ticker .ticker-price {
    font-size: 32px; /* Larger font */
    font-weight: 700;
    margin-right: 30px;
}

.hero-crypto-ticker .ticker-change {
    font-size: 24px; /* Larger font */
    padding: 6px 16px;
    border-radius: 8px;
}

/* Hide skeleton loader in hero ticker for immediate display */
.hero-crypto-ticker .crypto-ticker-skeleton {
    display: none;
}

/* Theme-specific ticker styles integrated from theme - Preserved for compatibility */
.ticker-wrapper {
    width: 100%;
    overflow: hidden;
}

.ticker-container {
    width: 100%;
    overflow: hidden;
}

/* Theme-specific animation timing */
@keyframes ticker {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Theme-specific hover behavior */
.ticker-wrapper:hover .ticker-track {
    animation-play-state: paused;
}

/* Ensure animations run smoothly */
@keyframes tickerAnimation {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

@-webkit-keyframes tickerAnimation {
    0% {
        -webkit-transform: translateX(0);
    }
    100% {
        -webkit-transform: translateX(-50%);
    }
}

/* Footer optimization - prevent delayed loading */
.crypto-ticker-wrapper,
.crypto-ticker-track,
.ticker-item {
    opacity: 1 !important;
    visibility: visible !important;
    transition: none !important;
    animation-delay: 0s !important;
}

.crypto-ticker-wrapper.loading::after {
    display: none !important;
}

/* Ticker animation should begin immediately */
.crypto-ticker-track {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    animation: tickerAnimation var(--ticker-speed, 30s) linear infinite !important;
    -webkit-animation: tickerAnimation var(--ticker-speed, 30s) linear infinite !important;
    will-change: transform !important;
    animation-delay: 0s !important;
    grid-template-columns: none !important;
    grid-auto-flow: unset !important;
    width: auto !important;
    transform: translateX(0);
}

/* Fix ticker items horizontal layout */
.crypto-ticker-track .ticker-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    white-space: nowrap !important;
    grid-template-columns: none !important;
} 