/* 
   ========================================
   Background Dashboard - Puzzle/Mosaic Style
   Sequential lighting animation with content animations
   ========================================
*/

/* Demo Section Wrapper - Panels overlap with chatbot */
.demo-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 0;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Side Panels - Strong overlap with chatbot */
.side-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 180px;
    flex-shrink: 0;
    margin-top: 30px;
}

.side-panel.left-panel {
    margin-right: 25px;
    z-index: 1;
}

.side-panel.right-panel {
    margin-left: 25px;
    z-index: 1;
}

/* Panel Row (horizontal layout) */
.panel-row {
    display: flex;
    gap: 8px;
}

/* ========================================
   Panel Card Base - Glassmorphism Effect
   ======================================== */
.panel-card {
    /* Glassmorphism base */
    background: rgba(18, 20, 26, 0.55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    /* Premium gradient border */
    border: 1px solid;
    border-image: linear-gradient(135deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0) 50%,
            rgba(239, 198, 9, 0) 100%) 1;
    border-radius: 12px;

    padding: 10px;
    opacity: 1;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;

    /* Premium shadow with inset highlights */
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

/* Fallback for browsers without backdrop-filter support */
@supports not (backdrop-filter: blur(20px)) {
    .panel-card {
        background: rgba(18, 20, 26, 0.9);
    }
}

/* Glass shine/reflection effect on hover */
.panel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.08),
            transparent);
    transform: skewX(-25deg);
    transition: left 0.8s ease;
    z-index: 1;
    pointer-events: none;
}

.panel-card:hover::before {
    left: 150%;
}

/* Ambient glow overlay (bottom) */
.panel-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 40%;
    background: radial-gradient(ellipse at bottom,
            rgba(239, 198, 9, 0.08) 0%,
            transparent 70%);
    filter: blur(15px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.6s ease;
}

.panel-card:hover::after {
    opacity: 0.9;
}

/* Kart içindeki tüm text elementleri her zaman görünsün */
.side-panel .panel-card .feature-icon,
.side-panel .panel-card .feature-label,
.side-panel .panel-card .feature-value,
.side-panel .panel-card .panel-title,
.side-panel .panel-card .panel-value,
.side-panel .panel-card .status-value,
.side-panel .panel-card .rate-value,
.side-panel .panel-card .gauge-value,
.side-panel .panel-card .cor-value {
    opacity: 1 !important;
    filter: none !important;
    color: inherit !important;
    visibility: visible !important;
}

/* Coin logo ve table logo için de aynı ayar */
.side-panel .panel-card .coin-logo-mini,
.side-panel .panel-card .table-logo {
    opacity: 1 !important;
    filter: none !important;
}

/* Card Sizes */
.panel-card.small {
    flex: 1;
    padding: 8px;
}

.panel-card.coin-card {
    padding: 8px 10px;
}

.panel-card.feature-card {
    flex: 1;
    padding: 8px;
    text-align: center;
}

.panel-card.gauge-card {
    padding: 8px 10px;
}

.panel-card.table-card {
    padding: 6px 8px;
}

/* ========================================
   COIN CARD WITH LOGO
   ======================================== */
.coin-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.coin-logo-mini {
    width: 18px;
    height: 18px;
    border-radius: 50%;
}

/* Panel Content */
.panel-title {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.panel-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

/* ========================================
   FEATURE CARDS (New Design)
   ======================================== */
.feature-icon {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.feature-label {
    font-size: 0.55rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.feature-value {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 2px;
}

.feature-value.ai-status {
    color: #22c55e;
}

.feature-value.signal-pulse {
    color: #22c55e;
    animation: none;
}

.panel-card.lit .signal-pulse {
    animation: signal-glow 0.5s ease-out;
}

@keyframes signal-glow {

    0%,
    100% {
        text-shadow: none;
    }

    50% {
        text-shadow: 0 0 10px #22c55e;
    }
}

/* ========================================
   ACTIVE/LIT STATE - Enhanced Glow
   ======================================== */
.panel-card.lit {
    opacity: 1;
    background: rgba(18, 20, 26, 0.75);
    border-color: rgba(239, 198, 9, 0.4);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(239, 198, 9, 0.2),
        0 0 60px rgba(239, 198, 9, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Enhanced ambient glow for lit state */
.panel-card.lit::after {
    opacity: 1;
    background: radial-gradient(ellipse at bottom,
            rgba(239, 198, 9, 0.2) 0%,
            transparent 70%);
}

/* Glow sweep animation when lit */
.panel-card.lit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(239, 198, 9, 0.2),
            transparent);
    animation: sweep 1.2s ease-out forwards;
}

@keyframes sweep {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* ========================================
   GAUGE (NEEDLE/METER)
   ======================================== */
.gauge-container {
    position: relative;
    height: 45px;
    margin: 6px 0;
}

.gauge-arc {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 35px;
    border-radius: 70px 70px 0 0;
    background: linear-gradient(90deg, #ef4444 0%, #fbbf24 50%, #22c55e 100%);
    opacity: 0.6;
}

.gauge-arc.alt {
    background: linear-gradient(90deg, #ef4444 0%, #a3a3a3 50%, #22c55e 100%);
}

.gauge-needle {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 3px;
    height: 30px;
    background: var(--primary-color);
    border-radius: 3px 3px 0 0;
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(-30deg);
    transition: transform 0.5s ease;
    box-shadow: 0 0 8px var(--primary-color);
}

.gauge-needle.alt {
    transform: translateX(-50%) rotate(0deg);
}

/* Needle animation when card is lit */
.panel-card.lit .gauge-needle {
    animation: needle-swing 1.2s ease-in-out forwards;
}

.panel-card.lit .gauge-needle.alt {
    animation: needle-swing-alt 1.2s ease-in-out forwards;
}

@keyframes needle-swing {
    0% {
        transform: translateX(-50%) rotate(-60deg);
    }

    50% {
        transform: translateX(-50%) rotate(45deg);
    }

    100% {
        transform: translateX(-50%) rotate(35deg);
    }
}

@keyframes needle-swing-alt {
    0% {
        transform: translateX(-50%) rotate(-45deg);
    }

    50% {
        transform: translateX(-50%) rotate(20deg);
    }

    100% {
        transform: translateX(-50%) rotate(5deg);
    }
}

.gauge-labels {
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    font-size: 0.5rem;
    color: var(--text-muted);
    padding: 0 8px;
}

.gauge-value {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 700;
    margin-top: 2px;
}

/* ========================================
   MINI TABLE (Scanner & Indicators)
   ======================================== */
.mini-table {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.table-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.65rem;
    padding: 3px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
}

.table-row:last-child {
    border-bottom: none;
}

.table-row span:first-child {
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 4px;
}

.table-logo {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

/* Table row shuffle animation */
.table-row.shuffle {
    animation: row-shuffle 0.4s ease-out;
}

@keyframes row-shuffle {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* COR Value Badges (Scanner style) */
.cor-value {
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.6rem;
    transition: all 0.3s ease;
}

.cor-positive {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.cor-negative {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.cor-neutral {
    color: #a3a3a3;
    background: rgba(163, 163, 163, 0.1);
}

/* Value change flash */
.cor-value.flash {
    animation: value-flash 0.5s ease-out;
}

@keyframes value-flash {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
        background: rgba(239, 198, 9, 0.3);
    }

    100% {
        transform: scale(1);
    }
}

/* ========================================
   LONG/SHORT BAR
   ======================================== */
.ls-bar {
    display: flex;
    border-radius: 4px;
    overflow: hidden;
    font-size: 0.6rem;
    font-weight: 700;
    height: 18px;
}

.ls-long {
    background: rgba(34, 197, 94, 0.8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 1s ease-out;
}

.ls-short {
    background: rgba(239, 68, 68, 0.8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

/* Animate bar when lit */
.panel-card.lit .ls-long.anim-bar {
    width: 72% !important;
}

/* ========================================
   PRICE ANIMATION
   ======================================== */
.panel-card.lit .anim-price {
    animation: price-flash 0.8s ease-out;
}

@keyframes price-flash {
    0% {
        transform: scale(1);
        text-shadow: none;
    }

    50% {
        transform: scale(1.15);
        text-shadow: 0 0 12px var(--primary-color);
    }

    100% {
        transform: scale(1);
        text-shadow: none;
    }
}

/* ========================================
   VOLUME COUNTER
   ======================================== */
.volume-counter {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    letter-spacing: -0.5px;
}

/* ========================================
   RESPONSIVE - Desktop Default State
   ======================================== */
@media (min-width: 1101px) {

    /* Desktop'ta kartlar her zaman tam görünür olsun - filter tamamen kaldırıldı */
    .side-panel .panel-card {
        opacity: 1 !important;
        filter: none !important;
        background: rgba(18, 20, 26, 0.8) !important;
    }

    .side-panel .panel-card.lit {
        opacity: 1 !important;
        filter: none !important;
        background: rgba(18, 20, 26, 0.95) !important;
        border-color: rgba(239, 198, 9, 0.5) !important;
        box-shadow:
            0 0 30px rgba(239, 198, 9, 0.2),
            0 0 60px rgba(239, 198, 9, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }

    /* Tüm text elementleri garanti görünür */
    .side-panel .panel-card * {
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Problemli kartları masaüstünde gizle */
    #signalCard,
    #winRateCard,
    #botCard,
    #tradeCard {
        display: none !important;
    }
}

/* ========================================
   RESPONSIVE - Mobile Layout with Auto-Scroll
   ======================================== */
@media (max-width: 1100px) {

    /* Reduce glassmorphism blur on mobile for performance */
    .panel-card {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        background: rgba(18, 20, 26, 0.75);
    }

    /* Change flex direction to column for mobile */
    .demo-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 0 10px;
        overflow-x: hidden;
    }

    /* Side panels become horizontal auto-scrolling strips */
    .side-panel {
        display: flex;
        flex-direction: row;
        width: fit-content;
        min-width: 200%;
        overflow: visible;
        gap: 10px;
        margin: 0 !important;
        padding: 10px 0;
    }

    /* Inner wrapper for animation */
    .side-panel>* {
        flex-shrink: 0;
    }

    /* Left panel goes above chatbot - scrolls left (cards move left to right) */
    .side-panel.left-panel {
        order: 1;
        animation: scrollMarquee 25s linear infinite;
    }

    /* Chatbot in the middle */
    .chat-interface {
        order: 2;
    }

    /* Right panel goes below chatbot - scrolls right (cards move right to left) */
    .side-panel.right-panel {
        order: 3;
        animation: scrollMarquee 25s linear infinite reverse;
    }

    /* Pause animation on hover for debugging */
    .side-panel:hover {
        animation-play-state: paused;
    }

    /* Panel rows become inline */
    .panel-row {
        display: flex;
        flex-direction: row;
        flex-shrink: 0;
        gap: 10px;
    }

    /* Cards in horizontal layout */
    .panel-card {
        flex-shrink: 0;
        min-width: 120px;
        max-width: 140px;
    }

    .panel-card.coin-card {
        min-width: 90px;
        max-width: 110px;
    }

    .panel-card.feature-card {
        min-width: 75px;
        max-width: 90px;
    }

    .panel-card.gauge-card {
        min-width: 110px;
    }

    .panel-card.table-card {
        min-width: 130px;
    }

    /* Mobilde lit kartlarda sadece border olsun, dış gölge olmasın */
    .panel-card.lit {
        box-shadow: none;
        border-color: rgba(239, 198, 9, 0.6);
    }

    .panel-card.lit::before {
        display: none;
    }

    /* Mobilde de tüm yazılar ve logolar her zaman görünsün */
    .panel-card .feature-icon,
    .panel-card .feature-label,
    .panel-card .feature-value,
    .panel-card .panel-title,
    .panel-card .panel-value,
    .panel-card .status-value,
    .panel-card .rate-value,
    .panel-card .gauge-value,
    .panel-card .cor-value {
        opacity: 1 !important;
        filter: none !important;
        visibility: visible !important;
    }

    .panel-card .coin-logo-mini,
    .panel-card .table-logo {
        opacity: 1 !important;
        filter: none !important;
    }
}

/* Marquee Animations for Mobile - Seamless infinite loop */
/* İçerik 3x klonlandı, 1/3 kaydırma = kesintisiz döngü */
@keyframes scrollMarquee {
    0% {
        transform: translateX(0%);
    }

    100% {
        transform: translateX(-33.33%);
    }
}