/**
 * Styles professionnels pour cryptomonnaies - STYLE CRYPTO.COM
 * Version 4.0 - Thème Bleu Premium avec animations fluides
 */

/* ========== VARIABLES CRYPTO.COM ========== */
:root {
    --crypto-primary: #1199FA;
    --crypto-primary-dark: #0D7FD9;
    --crypto-success: #10b981;
    --crypto-danger: #ef4444;
    --crypto-warning: #f59e0b;
    --crypto-bg-dark: #0A0E17;
    --crypto-bg-card: #131A2A;
    --crypto-border: rgba(255, 255, 255, 0.1);
    --crypto-text: #F7F8FA;
    --crypto-text-muted: #8A94A6;
}

/* ========== CRYPTO GRID ========== */
.crypto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-top: 20px;
    animation: fadeInUp 0.6s ease;
}

@media (max-width: 1400px) {
    .crypto-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 1024px) {
    .crypto-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
}

@media (max-width: 768px) {
    .crypto-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}

@media (max-width: 480px) {
    .crypto-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

/* ========== CRYPTO ITEM - STYLE CRYPTO.COM ========== */
.crypto-item {
    background: linear-gradient(145deg, rgba(19, 26, 42, 0.95), rgba(10, 14, 23, 0.9));
    border: 1px solid var(--crypto-border);
    border-radius: 16px;
    padding: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.crypto-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(17, 153, 250, 0.1), transparent);
    transition: left 0.6s ease;
}

.crypto-item:hover::before {
    left: 100%;
}

.crypto-item:hover {
    border-color: var(--crypto-primary);
    box-shadow:
        0 10px 40px rgba(17, 153, 250, 0.2),
        0 0 0 1px rgba(17, 153, 250, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: translateY(-6px) scale(1.02);
}

.crypto-item.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
}

.crypto-item.scroll-animate.animated {
    animation: slideUpBounce 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ========== CRYPTO ICON - PREMIUM ========== */
.crypto-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--crypto-color, #1199FA), var(--crypto-color-dark, #0D7FD9));
    border-radius: 14px;
    margin-bottom: 12px;
    font-size: 1.4rem;
    color: white;
    box-shadow: 0 8px 20px rgba(17, 153, 250, 0.25);
    animation: iconFloat 4s ease-in-out infinite;
    position: relative;
}

.crypto-icon-box::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--crypto-color, #1199FA), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.crypto-item:hover .crypto-icon-box::after {
    opacity: 0.5;
}

.crypto-icon-box img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-3px) rotate(1deg); }
    50% { transform: translateY(-5px) rotate(0deg); }
    75% { transform: translateY(-3px) rotate(-1deg); }
}

.crypto-item:hover .crypto-icon-box {
    animation: iconPulse 0.6s ease;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 8px 20px rgba(17, 153, 250, 0.25); }
    50% { transform: scale(1.1); box-shadow: 0 12px 30px rgba(17, 153, 250, 0.4); }
}

/* ========== CRYPTO HEADER ========== */
.crypto-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px;
}

.crypto-symbol {
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.5px;
    color: var(--crypto-text);
}

/* Effet Neon Premium */
.neon-text {
    background: linear-gradient(135deg, var(--crypto-primary), #00D4AA);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px var(--crypto-primary));
}

/* ========== CRYPTO CHANGE BADGE ========== */
.crypto-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.crypto-change.positive {
    color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.crypto-change.negative {
    color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
}

.change-arrow {
    font-size: 0.9rem;
    font-weight: 900;
}

.crypto-change.positive .change-arrow {
    animation: arrowUp 1s ease-in-out infinite;
}

.crypto-change.negative .change-arrow {
    animation: arrowDown 1s ease-in-out infinite;
}

@keyframes arrowUp {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

@keyframes arrowDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

/* ========== CRYPTO NAME ========== */
.crypto-name {
    font-size: 0.8rem;
    color: var(--crypto-text-muted);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

/* ========== CRYPTO PRICE ========== */
.crypto-price {
    display: flex;
    align-items: baseline;
    gap: 3px;
    margin-bottom: 10px;
    font-weight: 800;
    color: var(--crypto-text);
}

.price-currency {
    font-size: 0.85rem;
    opacity: 0.6;
    font-weight: 600;
}

.price-value {
    font-size: 1.15rem;
    transition: all 0.3s ease;
}

.price-value.updating {
    animation: priceFlash 0.5s ease;
}

@keyframes priceFlash {
    0% { color: var(--crypto-text); transform: scale(1); }
    50% { color: var(--crypto-primary); transform: scale(1.08); }
    100% { color: var(--crypto-text); transform: scale(1); }
}

/* ========== TREND BAR - PREMIUM ========== */
.crypto-trend-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.trend-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.trend-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5));
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

.trend-fill.positive {
    background: linear-gradient(90deg, #10b981, #34d399, #6ee7b7);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
}

.trend-fill.negative {
    background: linear-gradient(90deg, #ef4444, #f87171, #fca5a5);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}

/* ========== ANIMATIONS ========== */
@keyframes slideUpBounce {
    0% { opacity: 0; transform: translateY(30px) scale(0.95); }
    60% { transform: translateY(-5px) scale(1.02); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== LIVE INDICATOR - CRYPTO.COM STYLE ========== */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #10b981;
    letter-spacing: 0.5px;
    padding: 6px 14px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 20px;
}

.live-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: livePulse 1.5s infinite;
    box-shadow: 0 0 10px #10b981;
}

@keyframes livePulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.2);
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
}

/* ========== MARKET STATS CARDS ========== */
.market-stat-card {
    background: linear-gradient(145deg, rgba(19, 26, 42, 0.9), rgba(10, 14, 23, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.4s ease;
}

.market-stat-card:hover {
    border-color: var(--crypto-primary);
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(17, 153, 250, 0.15);
}

.market-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.4rem;
    background: linear-gradient(135deg, rgba(17, 153, 250, 0.2), rgba(17, 153, 250, 0.1));
    color: var(--crypto-primary);
}

.market-stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--crypto-text);
    margin-bottom: 5px;
}

.market-stat-label {
    font-size: 0.85rem;
    color: var(--crypto-text-muted);
    margin-bottom: 8px;
}

.market-stat-change {
    font-size: 0.85rem;
    font-weight: 700;
}

.market-stat-change.positive {
    color: #10b981;
}

.market-stat-change.negative {
    color: #ef4444;
}

/* ========== CRYPTO TICKER TAPE ========== */
.crypto-ticker {
    background: linear-gradient(90deg, var(--crypto-bg-dark), var(--crypto-bg-card), var(--crypto-bg-dark));
    border-top: 1px solid var(--crypto-border);
    border-bottom: 1px solid var(--crypto-border);
    padding: 12px 0;
    overflow: hidden;
}

.ticker-content {
    display: flex;
    gap: 40px;
    animation: ticker 30s linear infinite;
}

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.ticker-item img {
    width: 24px;
    height: 24px;
}

.ticker-symbol {
    font-weight: 700;
    color: var(--crypto-text);
}

.ticker-price {
    color: var(--crypto-text-muted);
}

.ticker-change {
    font-weight: 600;
}

.ticker-change.positive { color: #10b981; }
.ticker-change.negative { color: #ef4444; }

/* ========== RESPONSIVE IMPROVEMENTS ========== */
@media (max-width: 768px) {
    .crypto-item {
        padding: 12px;
    }

    .crypto-icon-box {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .price-value {
        font-size: 1rem;
    }

    .market-stat-value {
        font-size: 1.4rem;
    }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
    .crypto-item,
    .crypto-icon-box,
    .trend-fill,
    .price-value,
    .ticker-content {
        animation: none !important;
        transition: opacity 0.3s ease !important;
    }
}
