/**
 * Mobil Canlı Piyasalar Bölümü
 * Sadece mobil cihazlarda görünür (max-width: 768px)
 */

/* Global overflow fix for mobile */
html {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100%;
}

body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100%;
}

@media (max-width: 768px) {
    * {
        max-width: 100vw;
    }
    
    body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100vw !important;
    }
    
    .main-content {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100% !important;
    }
    
    .container {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0 auto !important;
        width: 100% !important;
    }
}

/* Desktop'ta gizle */
.mobile-markets-section {
    display: none;
}

/* Mobil cihazlarda göster */
@media (max-width: 768px) {
    .mobile-markets-section {
        display: block;
        background: #ffffff;
        padding: 0 !important;
        margin: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        position: relative;
        overflow-x: hidden !important;
        box-sizing: border-box;
    }

    .mobile-markets-header {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 16px 16px 12px;
        background: #ffffff;
        box-sizing: border-box;
    }

    .mobile-markets-title {
        font-size: 14px;
        font-weight: 700;
        color: #1f2937;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    /* Canlı indicator */
    .mobile-markets-title::before {
        content: '';
        width: 8px;
        height: 8px;
        background: #10B981;
        border-radius: 50%;
        animation: livePulse 2s ease-in-out infinite;
    }
    
    @keyframes livePulse {
        0%, 100% {
            opacity: 1;
            box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
        }
        50% {
            opacity: 0.5;
            box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
        }
    }

    .mobile-menu-btn {
        display: none; /* Menü butonu kaldırıldı */
    }

    .mobile-menu-btn svg {
        width: 24px;
        height: 24px;
        stroke: #1f2937;
        stroke-width: 2;
    }

    /* Grid Layout - 3 kolonlu */
    .mobile-markets-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        padding: 0 12px 12px 12px;
        background: #ffffff;
        box-sizing: border-box;
        max-width: 100vw;
        width: 100%;
        overflow: hidden;
        margin: 0;
    }

    .market-card {
        background: #f9fafb;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 12px 6px;
        text-align: center;
        transition: all 0.2s ease;
        position: relative;
        margin: 0;
        box-sizing: border-box;
        min-width: 0;
    }

    .market-card:hover,
    .market-card:active {
        background: #f3f4f6;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        z-index: 10;
    }
    
    .market-card:active {
        transform: scale(0.98);
    }

    /* Öne çıkan kart (örn: Sterlin) */
    .market-card.featured {
        border: 2px solid #10B981;
        background: rgba(16, 185, 129, 0.05);
    }

    /* Yükselen kartlar - yeşil arka plan */
    .market-card.rising {
        background: #d1fae5;
        border-color: #10B981;
        animation: pulseGreen 2s ease-in-out infinite;
    }

    .market-card.rising:hover,
    .market-card.rising:active {
        background: #a7f3d0;
        animation: none;
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
        z-index: 10;
    }
    
    .market-card.rising:active {
        transform: scale(0.98);
    }

    /* Düşen kartlar - kırmızı arka plan */
    .market-card.falling {
        background: #fee2e2;
        border-color: #EF4444;
        animation: pulseRed 2s ease-in-out infinite;
    }

    .market-card.falling:hover,
    .market-card.falling:active {
        background: #fecaca;
        animation: none;
        box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
        z-index: 10;
    }
    
    .market-card.falling:active {
        transform: scale(0.98);
    }

    /* Yeşil yanıp sönme animasyonu */
    @keyframes pulseGreen {
        0%, 100% {
            background: #d1fae5;
            box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
        }
        50% {
            background: #a7f3d0;
            box-shadow: 0 0 10px 2px rgba(16, 185, 129, 0.6);
        }
    }

    /* Kırmızı yanıp sönme animasyonu */
    @keyframes pulseRed {
        0%, 100% {
            background: #fee2e2;
            box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
        }
        50% {
            background: #fecaca;
            box-shadow: 0 0 10px 2px rgba(239, 68, 68, 0.6);
        }
    }

    .market-label {
        font-size: 11px;
        font-weight: 700;
        color: #6b7280;
        text-transform: uppercase;
        margin-bottom: 6px;
        letter-spacing: 0.3px;
    }

    /* Yükselen kartlarda label */
    .market-card.rising .market-label {
        color: #059669;
    }

    /* Düşen kartlarda label */
    .market-card.falling .market-label {
        color: #dc2626;
    }

    .market-value {
        font-size: 16px;
        font-weight: 700;
        color: #1f2937;
        margin-bottom: 4px;
        font-family: 'Inter', sans-serif;
    }

    .market-change {
        font-size: 11px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 2px;
        color: #1f2937;
    }

    .market-change.positive {
        color: #059669;
    }

    .market-change.negative {
        color: #dc2626;
    }

    .market-change svg {
        width: 12px;
        height: 12px;
    }

    /* Loading skeleton */
    .market-card.loading {
        pointer-events: none;
    }

    .market-card.loading .market-value,
    .market-card.loading .market-change {
        background: rgba(255, 255, 255, 0.1);
        color: transparent;
        border-radius: 4px;
        animation: pulse 1.5s ease-in-out infinite;
    }

    @keyframes pulse {
        0%, 100% {
            opacity: 1;
        }
        50% {
            opacity: 0.5;
        }
    }

    /* Hata durumu */
    .market-card.error {
        opacity: 0.5;
    }

    .market-card.error .market-value {
        color: #EF4444;
    }

    /* Çok küçük ekranlar için (< 375px) */
    @media (max-width: 374px) {
        .mobile-markets-grid {
            padding: 0 8px 12px 8px;
            gap: 4px;
        }
        
        .market-label {
            font-size: 10px;
        }

        .market-value {
            font-size: 14px;
        }

        .market-change {
            font-size: 10px;
        }

        .market-card {
            padding: 10px 4px;
        }
    }

    /* Büyük mobil ekranlar için (> 480px) */
    @media (min-width: 480px) and (max-width: 768px) {
        .market-label {
            font-size: 12px;
        }

        .market-value {
            font-size: 18px;
        }

        .market-change {
            font-size: 12px;
        }

        .market-card {
            padding: 14px 10px;
        }
    }
}

/* Tablet ve üstü için tamamen gizle */
@media (min-width: 769px) {
    .mobile-markets-section {
        display: none !important;
    }
}

