/* ============================================
   Crypto Trading Platform - Premium Styles
   Stunning Animations & Visual Effects
   ============================================ */

:root {
    /* Colors - Pro Institutional Trading Theme */
    --bg-primary: #0b0e11;
    --bg-secondary: #141921;
    --bg-tertiary: #1c2230;
    --bg-card: rgba(16, 21, 30, 0.92);
    --bg-glass: rgba(11, 14, 17, 0.82);
    --bg-hover: rgba(255, 255, 255, 0.035);
    
    --text-primary: #eaecef;
    --text-secondary: #848e9c;
    --text-muted: #5e6673;
    
    --accent-primary: #007e80;
    --accent-secondary: #00b4b8;
    --accent-gradient: linear-gradient(135deg, #003492 0%, #007e80 100%);
    --accent-glow: rgba(0, 126, 128, 0.25);
    
    --success: #0ecb81;
    --success-dim: #0ba368;
    --success-bg: rgba(14, 203, 129, 0.08);
    --danger: #f6465d;
    --danger-bg: rgba(246, 70, 93, 0.08);
    --warning: #007e80;
    --warning-bg: rgba(0, 126, 128, 0.08);
    --info: #1e9af5;
    --info-bg: rgba(30, 154, 245, 0.08);
    --purple: #003492;
    --purple-bg: rgba(0, 52, 146, 0.08);
    
    --border-color: rgba(37, 44, 56, 0.9);
    --border-glow: rgba(0, 126, 128, 0.15);
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5), 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6), 0 16px 48px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px var(--accent-glow), 0 0 60px rgba(0, 126, 128, 0.08);
    --shadow-neon: 0 0 15px currentColor, 0 0 30px currentColor;
    
    /* Transitions */
    --transition-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================
   Reset & Base Styles
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ============================================
   Premium Scrollbar
   ============================================ */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 126, 128, 0.15);
    border-radius: 3px;
    transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 126, 128, 0.3);
}

::-webkit-scrollbar-corner {
    background: var(--bg-primary);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 126, 128, 0.15) var(--bg-primary);
}

/* ============================================
   Selection Highlight
   ============================================ */

::selection {
    background: rgba(0, 126, 128, 0.25);
    color: #fff;
}

::-moz-selection {
    background: rgba(0, 126, 128, 0.25);
    color: #fff;
}

/* ============================================
   Animated Background (Performance Optimized)
   ============================================ */

.animated-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    contain: strict;
}

/* Radial gradient overlay — pulsing glow like Live page */
.animated-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(0, 126, 128, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(30, 154, 245, 0.10) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 52, 146, 0.08) 0%, transparent 60%);
    animation: bgPulse 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes bgPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.grid-lines {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(30, 154, 245, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30, 154, 245, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridScroll 20s linear infinite;
    will-change: transform;
    transform: translateZ(0);
}

@keyframes gridScroll {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(0, 50px, 0); }
}

.glow-orbs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    contain: layout style;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.12;
    animation: orbFloat 30s ease-in-out infinite;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--accent-primary);
    top: -150px;
    right: -150px;
    animation-delay: 0s;
}

.orb-2 {
    width: 350px;
    height: 350px;
    background: var(--purple);
    bottom: -80px;
    left: -80px;
    animation-delay: -8s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: var(--info);
    top: 50%;
    left: 50%;
    animation-delay: -16s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate3d(0, 0, 0); }
    33% { transform: translate3d(30px, -30px, 0); }
    66% { transform: translate3d(-20px, 20px, 0); }
}

/* Reduced Motion - Disable heavy animations */
@media (prefers-reduced-motion: reduce) {
    .animated-bg::before,
    .grid-lines,
    .orb {
        animation: none;
    }
    
    .grid-lines {
        transform: none;
    }
}

/* ============================================
   Loading Screen
   ============================================ */

.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    overflow: hidden;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Animated background within loading screen */
.loading-screen .animated-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.loading-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.loading-logo {
    margin-bottom: var(--space-xl);
    position: relative;
}

.loading-logo::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 160px;
    height: 160px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    opacity: 0;
    animation: logoAuraPulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes logoAuraPulse {
    0%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    50% { opacity: 0.35; transform: translate(-50%, -50%) scale(1.3); }
}

.loading-logo img {
    width: 160px;
    height: auto;
    position: relative;
    z-index: 1;
    animation: logoFloat 3s ease-in-out infinite, logoShimmer 4s ease-in-out infinite;
    filter: brightness(1.8) drop-shadow(0 0 20px rgba(0, 52, 146, 0.4));
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.03); }
}

@keyframes logoShimmer {
    0%, 100% { filter: brightness(1.8) drop-shadow(0 0 15px rgba(0, 52, 146, 0.4)); }
    25% { filter: brightness(1.9) drop-shadow(0 0 22px rgba(0, 52, 146, 0.5)); }
    50% { filter: brightness(2) drop-shadow(0 0 30px rgba(0, 52, 146, 0.6)); }
    75% { filter: brightness(1.9) drop-shadow(0 0 22px rgba(0, 52, 146, 0.5)); }
}

.logo-3d {
    perspective: 1000px;
    margin-bottom: var(--space-xl);
}

.bitcoin-3d {
    width: 150px;
    height: 150px;
    margin: 0 auto;
    position: relative;
    transform-style: preserve-3d;
    animation: coinSpin 4s ease-in-out infinite;
}

@keyframes coinSpin {
    0%, 100% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
}

.coin-face {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    font-weight: bold;
    border-radius: 50%;
    backface-visibility: hidden;
    background: var(--accent-gradient);
    box-shadow: 
        inset 0 0 30px rgba(255, 255, 255, 0.3),
        0 0 50px var(--accent-glow);
}

.coin-face.back {
    transform: rotateY(180deg);
}

.loading-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-sm);
    letter-spacing: 4px;
    text-shadow: 0 0 30px var(--accent-glow);
}

.loading-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    letter-spacing: 2px;
    margin-bottom: var(--space-xl);
}

.loading-bar {
    width: 300px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
    margin: 0 auto var(--space-xl);
}

.loading-progress {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    animation: loadingProgress 2s ease-in-out infinite;
}

.loading-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: loadingGlow 2s ease-in-out infinite;
}

@keyframes loadingProgress {
    0% { width: 0; }
    50% { width: 70%; }
    100% { width: 100%; }
}

@keyframes loadingGlow {
    0% { transform: translateX(-100px); }
    100% { transform: translateX(400px); }
}

.loading-tagline {
    margin-top: var(--space-lg);
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    animation: taglineFadeIn 1.2s ease-out 0.5s both;
}

@keyframes taglineFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.loading-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-2xl);
}

.loading-stats .stat-item {
    text-align: center;
}

.loading-stats .stat-value {
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.loading-stats .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   App Container
   ============================================ */

.app {
    min-height: 100vh;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.app.hidden {
    opacity: 0;
}

/* ============================================
   Glass Card Effect
   ============================================ */

.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    position: relative;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 126, 128, 0.08), transparent);
    pointer-events: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.glass-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-md), 0 0 20px rgba(0, 126, 128, 0.03);
}

.card-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.card-icon {
    font-size: 1.5rem;
}

.card-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

/* ============================================
   Header
   ============================================ */

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-lg);
    background: rgba(11, 14, 17, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    gap: var(--space-md);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    flex: 1;
    min-width: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.logo-icon {
    position: relative;
    width: 40px;
    height: 40px;
}

.bitcoin-symbol {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    font-weight: bold;
    z-index: 1;
}

.logo-ring {
    position: absolute;
    inset: -4px;
    border: 2px solid var(--accent-primary);
    border-radius: var(--radius-lg);
    opacity: 0.5;
    animation: logoRing 3s ease-in-out infinite;
}

@keyframes logoRing {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.2; }
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-main {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 1px;
}

.logo-sub {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 0.65rem;
    color: var(--accent-primary);
    letter-spacing: 3px;
}

.nav {
    display: flex;
    gap: 2px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: var(--space-xs) 0;
    margin: calc(-1 * var(--space-xs)) 0;
}

.nav::-webkit-scrollbar {
    display: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-fast);
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-icon {
    font-size: 0.9rem;
}

.nav-indicator {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transform: translateX(-50%);
    transition: width var(--transition-normal);
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-item:hover .nav-indicator {
    width: 80%;
}

.nav-item.active {
    color: var(--accent-primary);
    background: rgba(0, 126, 128, 0.1);
}

.nav-item.active .nav-indicator {
    width: 80%;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.live-ticker {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.ticker-chart {
    width: 40px;
    height: 24px;
    background: linear-gradient(180deg, rgba(14, 203, 129, 0.2) 0%, transparent 100%);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.ticker-chart::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--success);
    clip-path: polygon(0 100%, 10% 60%, 25% 80%, 40% 30%, 55% 50%, 70% 20%, 85% 40%, 100% 0%, 100% 100%);
}

.ticker-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ticker-symbol {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.symbol-icon {
    color: var(--accent-primary);
}

.ticker-price {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}

.ticker-change {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: var(--success-bg);
    color: var(--success);
    width: fit-content;
}

.ticker-change.negative {
    background: var(--danger-bg);
    color: var(--danger);
}

.ticker-change.negative .change-arrow {
    transform: rotate(180deg);
}

.account-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.account-balance {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.balance-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-value {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--success);
    white-space: nowrap;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--warning);
    animation: statusPulse 2s infinite;
    flex-shrink: 0;
}

.status-badge.connected .status-dot {
    background: var(--success);
}

.status-badge.connected {
    border-color: rgba(14, 203, 129, 0.3);
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* ============================================
   Main Content
   ============================================ */

.main-content {
    padding: var(--space-xl);
    max-width: 1600px;
    margin: 0 auto;
}

.view {
    display: none;
    animation: viewFadeIn 0.5s ease;
}

.view.active {
    display: block;
}

@keyframes viewFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-lg);
}

.view-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(
        135deg,
        var(--accent-primary) 0%,
        #00e5e8 25%,
        var(--accent-primary) 50%,
        #00e5e8 75%,
        var(--accent-primary) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-sm);
    letter-spacing: 2px;
    position: relative;
    animation: titleShine 4s linear infinite, titleFadeIn 0.8s ease-out both;
}

@keyframes titleShine {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

@keyframes titleFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* Legacy glitch class — now uses shine effect instead */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    display: none;
}

.view-description {
    color: var(--text-secondary);
    font-size: 1rem;
}

.view-stats {
    display: flex;
    gap: var(--space-md);
}

.mini-stat {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.mini-stat-icon {
    font-size: 1.25rem;
}

.mini-stat-value {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-weight: 700;
    color: var(--accent-primary);
}

.mini-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   Strategies Filter Section - Premium Design
   ============================================ */

.strategies-filter-section {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
    padding: var(--space-2xl);
    background: linear-gradient(135deg, 
        rgba(15, 15, 25, 0.95) 0%, 
        rgba(25, 25, 45, 0.9) 50%,
        rgba(15, 15, 25, 0.95) 100%);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(0, 126, 128, 0.2);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 
        0 0 40px rgba(0, 126, 128, 0.1),
        0 20px 60px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: filterSectionFadeIn 0.6s ease-out;
}

@keyframes filterSectionFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animated glow orbs */
.filter-glow-orbs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.filter-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    animation: filterOrbFloat 8s ease-in-out infinite;
}

.filter-orb-1 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
    top: -50px;
    left: -50px;
    animation-delay: 0s;
}

.filter-orb-2 {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, var(--info) 0%, transparent 70%);
    top: 50%;
    right: -30px;
    animation-delay: -3s;
}

.filter-orb-3 {
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, var(--purple) 0%, transparent 70%);
    bottom: -60px;
    left: 30%;
    animation-delay: -5s;
}

@keyframes filterOrbFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(20px, -20px) scale(1.1);
    }
    50% {
        transform: translate(-10px, 10px) scale(0.95);
    }
    75% {
        transform: translate(15px, 15px) scale(1.05);
    }
}

/* Grid overlay */
.filter-grid-overlay {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(0, 126, 128, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 126, 128, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
    opacity: 0.5;
}

/* Filter Header */
.filter-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-lg);
    z-index: 1;
}

.filter-title-section {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.filter-icon-wrapper {
    position: relative;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-main-icon {
    font-size: 2.5rem;
    z-index: 2;
    animation: filterIconBounce 2s ease-in-out infinite;
}

@keyframes filterIconBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.filter-icon-ring {
    position: absolute;
    inset: 0;
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    opacity: 0.5;
    animation: filterRingSpin 10s linear infinite;
}

@keyframes filterRingSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.filter-icon-pulse {
    position: absolute;
    inset: -5px;
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    opacity: 0;
    animation: filterPulse 2s ease-out infinite;
}

@keyframes filterPulse {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

.filter-title-text h3 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.filter-title-text p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: var(--space-xs) 0 0 0;
}

.filter-results-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: linear-gradient(135deg, rgba(0, 126, 128, 0.15) 0%, rgba(0, 126, 128, 0.05) 100%);
    border: 1px solid rgba(0, 126, 128, 0.3);
    border-radius: var(--radius-full);
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.9rem;
    animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 126, 128, 0.2);
    }
    50% {
        box-shadow: 0 0 25px rgba(0, 126, 128, 0.4);
    }
}

.results-icon {
    font-size: 1.1rem;
}

/* Search Box - Premium */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 1;
}

.search-icon-container {
    position: absolute;
    left: var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.search-icon {
    font-size: 1.4rem;
    filter: drop-shadow(0 0 8px rgba(0, 126, 128, 0.5));
    animation: searchIconGlow 2s ease-in-out infinite;
}

@keyframes searchIconGlow {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(0, 126, 128, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 15px rgba(0, 126, 128, 0.6));
    }
}

.search-icon-glow {
    position: absolute;
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, rgba(0, 126, 128, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: searchGlowPulse 2s ease-in-out infinite;
}

@keyframes searchGlowPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.8;
    }
}

.search-box input {
    width: 100%;
    padding: var(--space-lg) var(--space-2xl) var(--space-lg) 65px;
    background: linear-gradient(135deg, rgba(16, 21, 30, 0.9) 0%, rgba(28, 34, 48, 0.8) 100%);
    border: 2px solid rgba(0, 126, 128, 0.2);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        inset 0 2px 10px rgba(0, 0, 0, 0.3),
        0 4px 20px rgba(0, 0, 0, 0.2);
}

.search-box input::placeholder {
    color: var(--text-muted);
    font-size: 1rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 
        0 0 0 4px rgba(0, 126, 128, 0.15),
        0 0 40px rgba(0, 126, 128, 0.2),
        inset 0 2px 10px rgba(0, 0, 0, 0.3);
    transform: scale(1.01);
}

.search-box input:focus + .search-border-animation {
    opacity: 1;
}

.search-border-animation {
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-lg);
    background: linear-gradient(90deg, 
        var(--accent-primary), 
        var(--info), 
        var(--purple), 
        var(--accent-primary));
    background-size: 300% 100%;
    opacity: 0;
    z-index: -1;
    animation: borderGradient 3s linear infinite;
    transition: opacity 0.3s ease;
}

@keyframes borderGradient {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 300% 50%;
    }
}

.search-box .search-clear {
    position: absolute;
    right: var(--space-lg);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(246, 70, 93, 0.2) 0%, rgba(246, 70, 93, 0.1) 100%);
    border: 1px solid rgba(246, 70, 93, 0.3);
    border-radius: 50%;
    color: var(--danger);
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
}

.search-box .search-clear:hover {
    background: linear-gradient(135deg, rgba(246, 70, 93, 0.4) 0%, rgba(246, 70, 93, 0.2) 100%);
    border-color: var(--danger);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 0 20px rgba(246, 70, 93, 0.4);
}

/* Filter Controls */
.filter-controls {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-lg);
    z-index: 1;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(135deg, rgba(28, 34, 48, 0.8) 0%, rgba(20, 20, 40, 0.6) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
}

.filter-group:hover {
    border-color: rgba(0, 126, 128, 0.3);
    box-shadow: 0 0 20px rgba(0, 126, 128, 0.1);
}

.filter-group-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 5px rgba(0, 52, 146, 0.5));
}

.filter-group-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.filter-group-content label {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.select-wrapper select {
    min-width: 180px;
    padding: var(--space-sm) var(--space-xl) var(--space-sm) var(--space-md);
    background: linear-gradient(135deg, rgba(15, 15, 30, 0.9) 0%, rgba(25, 25, 45, 0.8) 100%);
    border: 1px solid rgba(0, 52, 146, 0.3);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
}

.select-wrapper select option,
.select-wrapper select optgroup {
    background-color: #1a1a2e;
    color: #eaecef;
}

.select-wrapper select option:hover,
.select-wrapper select option:checked {
    background-color: #2a2a4e;
    color: #ffffff;
}

.select-wrapper select:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(0, 52, 146, 0.2), 0 0 20px rgba(0, 52, 146, 0.2);
}

.select-arrow {
    position: absolute;
    right: var(--space-md);
    color: var(--purple);
    pointer-events: none;
    transition: transform 0.3s ease;
}

.select-wrapper:hover .select-arrow {
    transform: translateY(2px);
}

/* Quick Filters */
.quick-filters {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.quick-filter-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    margin-right: var(--space-xs);
}

.quick-filter-btn {
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(135deg, rgba(28, 34, 48, 0.6) 0%, rgba(20, 20, 40, 0.4) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.quick-filter-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quick-filter-btn:hover {
    border-color: rgba(0, 126, 128, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 126, 128, 0.2);
}

.quick-filter-btn.active {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
    box-shadow: 0 0 20px rgba(0, 126, 128, 0.4);
    transform: translateY(-2px);
}

.quick-filter-btn.active::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
}

/* No results state */
.no-results-message {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3xl);
    text-align: center;
    animation: noResultsFadeIn 0.5s ease-out;
}

@keyframes noResultsFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.no-results-message .no-results-icon {
    font-size: 5rem;
    margin-bottom: var(--space-lg);
    opacity: 0.6;
    animation: noResultsIconFloat 3s ease-in-out infinite;
}

@keyframes noResultsIconFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.no-results-message h3 {
    color: var(--text-primary);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.no-results-message p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .strategies-filter-section {
        padding: var(--space-lg);
        gap: var(--space-lg);
    }
    
    .filter-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-title-section {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }
    
    .filter-icon-wrapper {
        width: 50px;
        height: 50px;
    }
    
    .filter-main-icon {
        font-size: 1.8rem;
    }
    
    .filter-title-text h3 {
        font-size: 1.4rem;
    }
    
    .filter-results-badge {
        align-self: flex-start;
    }
    
    .search-box input {
        padding: var(--space-md) var(--space-xl) var(--space-md) 55px;
        font-size: 1rem;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .select-wrapper select {
        width: 100%;
    }
    
    .quick-filters {
        justify-content: center;
    }
}

/* ============================================
   Strategies Grid
   ============================================ */

.strategies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: var(--space-lg);
}

/* ============================================
   Pagination
   ============================================ */

.pagination-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: var(--space-xl) 0 var(--space-md);
    flex-wrap: wrap;
}

.pagination-container.hidden {
    display: none;
}

.pagination-info {
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.pagination-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    font-family: inherit;
}

.pagination-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary, #00e5e8));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.pagination-btn:hover:not(:disabled):not(.active) {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 126, 128, 0.2);
}

.pagination-btn:hover:not(:disabled):not(.active)::before {
    opacity: 0.1;
}

.pagination-btn.active {
    background: linear-gradient(135deg, var(--accent-primary), #00b8bb);
    border-color: transparent;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(0, 126, 128, 0.35), 0 0 15px rgba(0, 126, 128, 0.15);
    transform: translateY(-1px);
}

.pagination-btn.active::before {
    opacity: 0;
}

.pagination-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

.pagination-btn:active:not(:disabled):not(.active) {
    transform: translateY(0) scale(0.97);
}

.pagination-btn .arrow {
    font-size: 1rem;
    line-height: 1;
}

.pagination-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 2px;
    user-select: none;
}

@media (max-width: 768px) {
    .pagination-container {
        gap: 6px;
        padding: var(--space-lg) 0 var(--space-sm);
    }
    
    .pagination-btn {
        min-width: 36px;
        height: 36px;
        padding: 0 8px;
        font-size: 0.8rem;
        border-radius: 8px;
    }
    
    .pagination-ellipsis {
        min-width: 30px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .pagination-btn {
        min-width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
}

.strategy-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.strategy-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-normal);
}

.strategy-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(0, 126, 128, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.strategy-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-8px);
    box-shadow: var(--shadow-glow);
}

.strategy-card:hover::before {
    transform: scaleX(1);
}

.strategy-card:hover::after {
    opacity: 1;
}

.strategy-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.strategy-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 2rem;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.strategy-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.strategy-card:hover .strategy-icon::after {
    opacity: 0.2;
}

.strategy-title {
    flex: 1;
}

.strategy-title h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    line-height: 1.2;
}

.strategy-badges {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.category {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid rgba(30, 154, 245, 0.3);
}

.badge.timeframe {
    background: var(--purple-bg);
    color: var(--purple);
    border: 1px solid rgba(0, 52, 146, 0.3);
}

.badge.timeframe::before {
    content: '⏱️';
    font-size: 0.65rem;
}

.badge.market {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(14, 203, 129, 0.3);
}

.strategy-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: var(--space-md);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.strategy-indicators {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-bottom: var(--space-md);
}

.indicator-tag {
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.strategy-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
}

.strategy-stat {
    text-align: center;
    padding: var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.strategy-stat-value {
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.strategy-stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   Backtest Section - Redesigned
   ============================================ */

/* Backtest Header */
.backtest-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-xl);
    gap: var(--space-lg);
}

.backtest-title-section {
    flex: 1;
}

.backtest-quick-actions {
    display: flex;
    gap: var(--space-sm);
}

.btn-icon-only {
    width: 42px;
    height: 42px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.btn-icon-only:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Backtest Layout */
.backtest-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: var(--space-xl);
    align-items: start;
}

/* Configuration Panel */
.backtest-config-panel {
    position: sticky;
    top: 100px;
}

.backtest-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Config Cards */
.config-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.config-card:hover {
    border-color: rgba(0, 126, 128, 0.3);
}

.config-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
}

.config-card-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    color: var(--bg-primary);
}

.config-card-icon svg {
    stroke: var(--bg-primary);
}

.config-card-title {
    font-weight: 600;
    font-size: 0.9rem;
    flex: 1;
}

.config-card-body {
    padding: var(--space-lg);
}

/* Strategy Select */
.strategy-select-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.strategy-select {
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.strategy-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 126, 128, 0.15);
}

.strategy-preview {
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-color);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.strategy-preview-text {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.strategy-preview-content {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
}

.strategy-preview-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.strategy-preview-info {
    flex: 1;
    min-width: 0;
}

.strategy-preview-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.strategy-preview-badges {
    display: flex;
    gap: var(--space-xs);
}

/* Config Grid */
.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.config-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-xs);
}

.select-with-icon {
    position: relative;
}

.select-with-icon .field-icon {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-primary);
    font-weight: bold;
    z-index: 1;
    display: flex;
    align-items: center;
}

.select-with-icon select {
    width: 100%;
    padding: var(--space-sm) var(--space-md) var(--space-sm) 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
}

.select-with-icon select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Date Range */
.date-presets {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.preset-btn {
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.preset-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.preset-btn.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: var(--bg-primary);
}

.date-range-wrapper {
    display: flex;
    align-items: flex-end;
    gap: var(--space-md);
}

.date-field {
    flex: 1;
}

.date-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.date-field input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.date-field input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.date-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    padding-bottom: var(--space-sm);
}

/* Capital & Risk */
.input-with-prefix {
    position: relative;
}

.input-with-prefix .input-prefix {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--success);
    font-weight: 600;
}

.input-with-prefix input {
    width: 100%;
    padding: var(--space-sm) var(--space-md) var(--space-sm) 32px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.input-with-prefix input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.leverage-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.leverage-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    outline: none;
}

.leverage-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-gradient);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-glow);
}

.leverage-value-display {
    display: flex;
    align-items: center;
    gap: 4px;
}

.leverage-value-display input {
    width: 60px;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 0.9rem;
    text-align: center;
}

.leverage-x {
    color: var(--accent-primary);
    font-weight: 700;
    font-size: 0.9rem;
}

/* Strategy Parameters Grid */
.strategy-params-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.strategy-params-grid .config-field {
    background: var(--bg-secondary);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
}

/* Run Backtest Button */
.run-backtest-btn {
    position: relative;
    width: 100%;
    padding: var(--space-lg);
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-lg);
    color: var(--bg-primary);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.run-backtest-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(0, 126, 128, 0.4);
}

.run-backtest-btn .btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.run-backtest-btn .btn-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.run-backtest-btn.loading .btn-content {
    display: none;
}

.run-backtest-btn.loading .btn-loading {
    display: flex;
}

.run-backtest-btn .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: var(--bg-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-glow-effect {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.run-backtest-btn:hover .btn-glow-effect {
    transform: translateX(100%);
}

/* Results Panel */
.backtest-results-panel {
    min-height: 600px;
}

.results-content {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    min-height: 600px;
    overflow: hidden;
}

/* Empty State */
.results-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    min-height: 600px;
    text-align: center;
}

.empty-state-illustration {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-xl);
}

.empty-chart-icon {
    position: relative;
    z-index: 1;
    color: var(--accent-primary);
    opacity: 0.6;
}

.empty-pulse-ring {
    position: absolute;
    inset: 0;
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    opacity: 0;
    animation: pulseRing 3s ease-out infinite;
}

.empty-pulse-ring.delay-1 {
    animation-delay: 1s;
}

.empty-pulse-ring.delay-2 {
    animation-delay: 2s;
}

@keyframes pulseRing {
    0% {
        transform: scale(0.8);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.empty-state-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-state-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 400px;
    margin-bottom: var(--space-xl);
}

.empty-state-hints {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.hint-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.hint-item svg {
    color: var(--success);
    flex-shrink: 0;
}

/* Results Loaded State */
.backtest-result {
    padding: var(--space-xl);
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Result Header */
.result-header-section {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding-bottom: var(--space-lg);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.result-strategy-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 1.75rem;
}

.result-strategy-info h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.result-strategy-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.result-strategy-meta svg {
    width: 14px;
    height: 14px;
    margin-right: 4px;
}

/* Key Metrics Grid */
.key-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.key-metric-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.key-metric-card:hover {
    border-color: var(--border-color);
    transform: translateY(-4px);
}

.key-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--metric-color, var(--accent-gradient));
}

.key-metric-value {
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.key-metric-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.key-metric-card.positive .key-metric-value { color: var(--success); }
.key-metric-card.negative .key-metric-value { color: var(--danger); }
.key-metric-card.neutral .key-metric-value { color: var(--text-primary); }
.key-metric-card.info .key-metric-value { color: var(--info); }
.key-metric-card.purple .key-metric-value { color: var(--purple); }

/* Secondary Metrics */
.secondary-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.secondary-metric {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    text-align: center;
    background: var(--bg-tertiary);
}

.secondary-metric.success-bg { background: var(--success-bg); }
.secondary-metric.danger-bg { background: var(--danger-bg); }
.secondary-metric.info-bg { background: var(--info-bg); }
.secondary-metric.warning-bg { background: var(--warning-bg); }

.secondary-metric-value {
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.secondary-metric-label {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Chart Container */
.equity-chart-wrapper {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    border: 1px solid var(--border-color);
}

.equity-chart-wrapper.positive-trend {
    border-color: rgba(14, 203, 129, 0.2);
    background: linear-gradient(180deg, rgba(14, 203, 129, 0.05) 0%, transparent 100%);
}

.equity-chart-wrapper.negative-trend {
    border-color: rgba(246, 70, 93, 0.2);
    background: linear-gradient(180deg, rgba(246, 70, 93, 0.05) 0%, transparent 100%);
}

.chart-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
}

.chart-title-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.chart-icon {
    color: var(--accent-primary);
}

.chart-title-text {
    font-weight: 600;
    font-size: 0.95rem;
}

.chart-subtitle-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Trade History Section */
.trade-history-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.trade-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
}

.trade-history-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
    font-size: 0.95rem;
}

.trade-count-badge {
    padding: 2px 8px;
    background: var(--accent-gradient);
    color: var(--bg-primary);
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
}

.trade-type-badges {
    display: flex;
    gap: var(--space-sm);
}

.trade-type-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
}

.trade-type-badge.long {
    background: var(--success-bg);
    color: var(--success);
}

.trade-type-badge.short {
    background: var(--danger-bg);
    color: var(--danger);
}

.trade-history-list {
    max-height: 400px;
    overflow-y: auto;
    padding: var(--space-sm);
}

.trade-item {
    display: grid;
    grid-template-columns: 50px 70px 1fr 90px 100px 30px;
    gap: var(--space-md);
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-xs);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.trade-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-gradient);
    transform: scaleY(0);
    transition: transform var(--transition-fast);
}

.trade-item:hover {
    background: rgba(0, 126, 128, 0.1);
    transform: translateX(4px);
}

.trade-item:hover::before {
    transform: scaleY(1);
}

.trade-number {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.trade-side-badge {
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 700;
    text-align: center;
}

.trade-side-badge.long {
    background: var(--success-bg);
    color: var(--success);
}

.trade-side-badge.short {
    background: var(--danger-bg);
    color: var(--danger);
}

.trade-prices {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.trade-price-range {
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trade-time {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.trade-pnl {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
}

.trade-pnl.positive { color: var(--success); }
.trade-pnl.negative { color: var(--danger); }

.trade-exit-badge {
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.6rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.trade-exit-badge.tp { background: var(--success-bg); color: var(--success); }
.trade-exit-badge.sl { background: var(--danger-bg); color: var(--danger); }
.trade-exit-badge.signal { background: var(--info-bg); color: var(--info); }

.trade-view-icon {
    color: var(--accent-primary);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.trade-item:hover .trade-view-icon {
    opacity: 1;
}

/* No Trades State */
.no-trades-message {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 1200px) {
    .backtest-layout {
        grid-template-columns: 1fr;
    }
    
    .backtest-config-panel {
        position: static;
    }
    
    .key-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .secondary-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .backtest-header {
        flex-direction: column;
    }
    
    .config-grid {
        grid-template-columns: 1fr;
    }
    
    .date-range-wrapper {
        flex-direction: column;
    }
    
    .date-separator {
        transform: rotate(90deg);
        padding: var(--space-sm) 0;
    }
    
    .key-metrics-grid,
    .secondary-metrics-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .trade-item {
        grid-template-columns: 40px 60px 1fr 70px;
    }
    
    .trade-exit-badge,
    .trade-view-icon {
        display: none;
    }
}

/* ============================================
   Forms
   ============================================ */

.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.label-icon {
    font-size: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 126, 128, 0.15), 0 0 20px rgba(0, 126, 128, 0.1);
}

select {
    cursor: pointer;
}

.slider-input {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.slider-input input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    padding: 0;
}

.slider-input input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-gradient);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-glow);
}

.slider-input input[type="number"] {
    width: 70px;
    text-align: center;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9375rem;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--accent-gradient);
    color: var(--bg-primary);
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-glow {
    animation: btnGlow 2s ease-in-out infinite;
}

@keyframes btnGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 126, 128, 0.3); }
    50% { box-shadow: 0 0 40px rgba(0, 126, 128, 0.5); }
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn:hover .btn-shine {
    left: 100%;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
    width: 100%;
}

/* ============================================
   Logs Section
   ============================================ */

.logs-controls {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    flex-wrap: wrap;
}

.filter-select {
    min-width: 150px;
}

.logs-container {
    padding: 0;
    overflow: hidden;
}

.logs-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--success);
    letter-spacing: 1px;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    animation: pulseDot 1.5s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(14, 203, 129, 0.5); }
    50% { transform: scale(1.2); box-shadow: 0 0 0 10px rgba(14, 203, 129, 0); }
}

.logs-list {
    max-height: 550px;
    overflow-y: auto;
    padding: var(--space-md);
}

.log-entry {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    background: var(--bg-tertiary);
    border-left: 3px solid var(--border-color);
    animation: logSlideIn 0.3s ease;
}

@keyframes logSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.log-entry.signal { border-left-color: var(--purple); }
.log-entry.trade { border-left-color: var(--success); }
.log-entry.warning { border-left-color: var(--warning); }
.log-entry.error { border-left-color: var(--danger); }

.log-time {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.log-level {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    min-width: 70px;
    text-align: center;
}

.log-level.debug { background: var(--bg-hover); color: var(--text-muted); }
.log-level.info { background: var(--info-bg); color: var(--info); }
.log-level.signal { background: var(--purple-bg); color: var(--purple); }
.log-level.trade { background: var(--success-bg); color: var(--success); }
.log-level.warning { background: var(--warning-bg); color: var(--warning); }
.log-level.error { background: var(--danger-bg); color: var(--danger); }

.log-content {
    flex: 1;
}

.log-message {
    font-size: 0.9375rem;
    margin-bottom: var(--space-xs);
}

.log-meta {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.log-meta-item {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.log-meta-item span {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================
   Performance Section
   ============================================ */

.performance-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.metric-card {
    position: relative;
    padding: var(--space-lg);
    overflow: hidden;
}

.metric-bg {
    position: absolute;
    inset: 0;
    opacity: 0.1;
    background: radial-gradient(circle at 100% 0%, currentColor 0%, transparent 50%);
}

.metric-icon-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: var(--space-md);
}

.metric-icon-wrapper .metric-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    border-radius: var(--radius-md);
    z-index: 1;
}

.metric-icon-wrapper.profit { color: var(--success); }
.metric-icon-wrapper.profit .metric-icon { background: var(--success-bg); }
.metric-icon-wrapper.trades { color: var(--info); }
.metric-icon-wrapper.trades .metric-icon { background: var(--info-bg); }
.metric-icon-wrapper.winrate { color: var(--purple); }
.metric-icon-wrapper.winrate .metric-icon { background: var(--purple-bg); }
.metric-icon-wrapper.drawdown { color: var(--danger); }
.metric-icon-wrapper.drawdown .metric-icon { background: var(--danger-bg); }

.metric-ring {
    position: absolute;
    inset: -4px;
    border: 2px solid currentColor;
    border-radius: var(--radius-lg);
    opacity: 0.3;
    animation: metricRing 2s ease-in-out infinite;
}

@keyframes metricRing {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.1); opacity: 0.1; }
}

.metric-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.metric-value {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 2rem;
    font-weight: 700;
}

.metric-chart {
    position: absolute;
    bottom: var(--space-md);
    right: var(--space-md);
    width: 80px;
    height: 30px;
    opacity: 0.5;
}

.sparkline {
    width: 100%;
    height: 100%;
    color: var(--success);
}

.sparkline.danger {
    color: var(--danger);
}

.win-rate-visual {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
}

.progress-ring {
    width: 50px;
    height: 50px;
}

.progress-ring svg {
    transform: rotate(-90deg);
}

.performance-details {
    padding: var(--space-lg);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.data-table td {
    font-variant-numeric: tabular-nums;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.positive { color: var(--success); }
.negative { color: var(--danger); }

/* ============================================
   Modal
   ============================================ */

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    animation: overlayFadeIn 0.3s ease;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
    animation: modalSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 1;
}

.modal-close:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

.modal-header {
    padding: var(--space-xl);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(0, 126, 128, 0.1) 0%, transparent 100%);
}

.strategy-modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-md);
    position: relative;
}

.strategy-modal-icon .icon-inner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    font-size: 2.5rem;
    z-index: 1;
}

.strategy-modal-icon .icon-ring {
    position: absolute;
    inset: -8px;
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    animation: iconRingSpin 10s linear infinite;
    opacity: 0.5;
}

@keyframes iconRingSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.modal-header h2 {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.modal-header p {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.modal-badges {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
}

.modal-body {
    padding: var(--space-xl);
}

.config-section {
    margin-bottom: var(--space-xl);
}

.config-section h4 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.section-icon {
    font-size: 1rem;
}

.mode-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.mode-option input {
    display: none;
}

.mode-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.mode-option input:checked + .mode-card {
    border-color: var(--accent-primary);
    background: rgba(0, 126, 128, 0.1);
}

.mode-card:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.mode-icon-wrapper {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
}

.mode-icon {
    font-size: 1.5rem;
}

.mode-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.mode-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.mode-card.live {
    border-color: var(--danger);
}

.live-pulse {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(246, 70, 93, 0.5); }
    50% { transform: scale(1.2); box-shadow: 0 0 0 8px rgba(246, 70, 93, 0); }
}

.params-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.modal-actions {
    display: flex;
    gap: var(--space-md);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
    margin-top: var(--space-lg);
}

.modal-actions .btn-secondary {
    flex: 0 0 auto;
}

.modal-actions .btn-primary {
    flex: 1;
}

/* ============================================
   Toast Notifications
   ============================================ */

.toast-container {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: toastSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 400px;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.toast.hiding {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideOut {
    to {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
}

.toast-icon {
    font-size: 1.5rem;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--info); }

.toast-message {
    flex: 1;
    font-size: 0.9375rem;
}

/* ============================================
   Scrollbar
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1200px) {
    .backtest-container {
        grid-template-columns: 1fr;
    }
    
    .performance-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1400px) {
    .nav-item {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .nav-icon {
        font-size: 0.85rem;
    }
}

@media (max-width: 1200px) {
    .header {
        padding: var(--space-xs) var(--space-md);
    }
    
    .header-left {
        gap: var(--space-md);
    }
    
    .nav-text {
        display: none;
    }
    
    .nav-item {
        padding: 8px 10px;
        border-radius: var(--radius-sm);
    }
    
    .nav-item[title]::after {
        content: attr(data-tooltip);
    }
    
    .ticker-price {
        font-size: 0.8rem;
    }
    
    .ticker-chart {
        display: none;
    }
    
    .account-balance {
        display: none;
    }
}

@media (max-width: 900px) {
    .logo-text {
        display: none;
    }
    
    .header-left {
        gap: var(--space-sm);
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: var(--space-sm);
        padding: var(--space-sm) var(--space-md);
    }
    
    .header-left {
        flex-direction: row;
        gap: var(--space-sm);
        width: 100%;
        justify-content: space-between;
    }
    
    .logo-text {
        display: flex;
    }
    
    .nav {
        width: 100%;
        justify-content: flex-start;
        order: 3;
        padding-bottom: var(--space-xs);
        mask-image: linear-gradient(to right, black 90%, transparent 100%);
        -webkit-mask-image: linear-gradient(to right, black 90%, transparent 100%);
    }
    
    .nav-text {
        display: inline;
    }
    
    .nav-item {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .header-right {
        flex-shrink: 0;
    }
    
    .account-balance {
        display: none;
    }
    
    .ticker-chart {
        display: none;
    }
    
    .live-ticker {
        min-width: auto;
    }
    
    .main-content {
        padding: var(--space-md);
    }
    
    .view-title {
        font-size: 1.5rem;
    }
    
    .strategies-grid {
        grid-template-columns: 1fr;
    }
    
    .performance-summary {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .mode-selector {
        grid-template-columns: 1fr;
    }
    
    .params-grid {
        grid-template-columns: 1fr;
    }
    
    .logs-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .result-metrics {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ============================================
   Utility Classes
   ============================================ */

.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glow-text {
    text-shadow: 0 0 20px var(--accent-glow);
}

/* ============================================
   Charts
   ============================================ */

.chart-container {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
}

.chart-title {
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.chart-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chart-canvas {
    width: 100%;
    height: 250px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.chart-canvas canvas {
    display: block;
}

/* Equity Chart Specific */
.equity-chart-container {
    background: linear-gradient(180deg, rgba(14, 203, 129, 0.05) 0%, transparent 100%);
    border: 1px solid rgba(14, 203, 129, 0.2);
}

.equity-chart-container.negative {
    background: linear-gradient(180deg, rgba(246, 70, 93, 0.05) 0%, transparent 100%);
    border-color: rgba(246, 70, 93, 0.2);
}

/* ============================================
   Trade Detail Modal
   ============================================ */

.trade-detail-modal {
    max-width: 900px;
    width: 95%;
}

.trade-detail-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.trade-number-badge {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--bg-primary);
}

.trade-detail-info h2 {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.trade-detail-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.trade-summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.trade-summary-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.trade-summary-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.trade-summary-card .summary-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.trade-summary-card .summary-value {
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
}

.trade-summary-card .summary-value.long {
    color: var(--success);
}

.trade-summary-card .summary-value.short {
    color: var(--danger);
}

.trade-chart-container {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--border-color);
}

/* ============================================
   Enhanced Trade Chart Modal
   ============================================ */

.trade-chart-modal {
    max-width: 1000px !important;
    width: 95vw !important;
}

.trade-chart-modal .modal-body {
    padding: var(--space-lg);
    max-height: 80vh;
    overflow-y: auto;
}

/* Trade Modal P&L Badge */
.trade-pnl-badge {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    margin-left: auto;
}

.trade-pnl-badge.profit {
    background: rgba(14, 203, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(14, 203, 129, 0.3);
}

.trade-pnl-badge.loss {
    background: rgba(246, 70, 93, 0.15);
    color: var(--danger);
    border: 1px solid rgba(246, 70, 93, 0.3);
}

/* Trade Modal Summary Cards */
.trade-modal-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.trade-modal-summary .trade-summary-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.trade-modal-summary .trade-summary-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.trade-modal-summary .summary-value.profit {
    color: var(--success) !important;
}

.trade-modal-summary .summary-value.loss {
    color: var(--danger) !important;
}

/* Trade Chart Section */
.trade-chart-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--border-color);
}

.chart-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.chart-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-title svg {
    color: var(--primary);
}

.chart-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 8px;
    padding: 4px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-interval-select {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chart-interval-select:hover,
.chart-interval-select:focus {
    border-color: var(--primary);
    outline: none;
}

.chart-refresh-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chart-refresh-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-primary);
}

.chart-refresh-btn:active {
    transform: rotate(180deg);
}

/* Trade Chart Wrapper */
.trade-chart-wrapper {
    position: relative;
}

#trade-candlestick-chart,
.trade-candlestick-chart {
    height: 400px;
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* Chart Loading State */
.chart-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: var(--bg-secondary);
    z-index: 10;
}

.chart-loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 126, 128, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.chart-loading span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Chart Error State */
.chart-error {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--bg-secondary);
    z-index: 10;
}

.chart-error svg {
    color: var(--danger);
    opacity: 0.7;
}

.chart-error span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.retry-btn {
    background: var(--primary);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 126, 128, 0.4);
}

/* Chart Legend */
.chart-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: var(--space-md);
    margin-top: var(--space-sm);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.legend-marker {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-marker.entry {
    background: linear-gradient(135deg, #1e9af5, #4a6a7a);
    box-shadow: 0 0 8px rgba(30, 154, 245, 0.4);
}

.legend-marker.exit.profit {
    background: linear-gradient(135deg, #0ecb81, #0ba368);
    box-shadow: 0 0 8px rgba(14, 203, 129, 0.4);
}

.legend-marker.exit.loss {
    background: linear-gradient(135deg, #f6465d, #7a4545);
    box-shadow: 0 0 8px rgba(246, 70, 93, 0.4);
}

/* Trade Details Section */
.trade-details-section {
    margin-bottom: var(--space-lg);
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
}

.detail-value.profit {
    color: var(--success) !important;
}

.detail-value.loss {
    color: var(--danger) !important;
}

/* Price Movement Section */
.price-movement-section {
    margin-bottom: var(--space-lg);
}

.price-movement-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    padding: var(--space-xl);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.price-point {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.price-point .price-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.price-point .price-value {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.price-point.entry .price-value {
    color: #1e9af5;
}

.price-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 150px;
}

.price-arrow svg {
    opacity: 0.9;
}

.price-change {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
}

.price-change.profit {
    color: var(--success);
    background: rgba(14, 203, 129, 0.1);
}

.price-change.loss {
    color: var(--danger);
    background: rgba(246, 70, 93, 0.1);
}

.price-arrow.profit svg line {
    stroke: url(#arrowGradient);
}

.price-arrow.loss svg line {
    stroke: #f6465d;
}

.price-arrow.loss svg polygon {
    fill: #f6465d;
}

.price-point.exit .price-value {
    color: var(--success);
}

.price-arrow.loss + .price-point.exit .price-value,
.price-arrow.loss ~ .price-point.exit .price-value {
    color: var(--danger);
}

.trade-details-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
}

.detail-item {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
}

.detail-item .detail-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.detail-item .detail-value {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ============================================
   Enhanced Trade Detail Modal
   ============================================ */

.trade-detail-modal-enhanced {
    max-width: 1000px;
    max-height: 90vh;
}

.trade-detail-scrollable {
    max-height: calc(90vh - 120px);
    overflow-y: auto;
    padding-right: var(--space-sm);
}

.trade-detail-scrollable::-webkit-scrollbar {
    width: 6px;
}

.trade-detail-scrollable::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.trade-detail-scrollable::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}

/* Copy All Button */
.copy-all-btn {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.copy-all-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

.copy-all-btn.copied {
    background: var(--success);
    border-color: var(--success);
    color: var(--bg-primary);
}

/* Balance & Leverage Section */
.trade-balance-section {
    background: linear-gradient(135deg, rgba(30, 154, 245, 0.1) 0%, rgba(0, 126, 128, 0.1) 100%);
    border-radius: var(--radius-md);
    border: 1px solid rgba(30, 154, 245, 0.3);
    margin-bottom: var(--space-lg);
    overflow: hidden;
}

.balance-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-color);
}

.balance-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
}

.balance-title h4 {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1rem;
    margin-bottom: 2px;
}

.balance-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.balance-content {
    padding: var(--space-md);
}

.balance-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.balance-row.highlight {
    background: rgba(0, 0, 0, 0.2);
    padding: var(--space-md);
    border-radius: var(--radius-sm);
}

.balance-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.balance-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-value {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success);
}

.balance-value.leverage {
    color: var(--info);
}

/* Position Calculation Flow */
.position-calc-flow {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.calc-flow-step {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-primary);
}

.flow-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.flow-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.flow-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.flow-formula {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.flow-formula strong {
    color: var(--accent-secondary);
}

.flow-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.calc-flow-arrow {
    text-align: center;
    font-size: 1.25rem;
    color: var(--accent-primary);
    padding: 4px 0;
}

/* Position Summary Box */
.position-summary-box {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    border: 1px dashed var(--border-color);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row span:first-child {
    color: var(--text-muted);
}

.summary-row span:last-child {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: var(--text-primary);
}

.summary-row.highlight {
    background: rgba(0, 126, 128, 0.1);
    margin: 8px -16px -16px -16px;
    padding: 12px 16px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.summary-row.highlight span:last-child {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-secondary);
}

/* Education Section */
.trade-education-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: var(--space-lg);
    overflow: hidden;
}

.education-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
}

.education-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 1.5rem;
}

.education-icon.opened {
    background: var(--success-bg);
    border: 1px solid rgba(14, 203, 129, 0.3);
}

.education-icon.closed {
    background: var(--info-bg);
    border: 1px solid rgba(30, 154, 245, 0.3);
}

.education-icon.closed.tp {
    background: var(--success-bg);
    border-color: rgba(14, 203, 129, 0.3);
}

.education-icon.closed.sl {
    background: var(--danger-bg);
    border-color: rgba(246, 70, 93, 0.3);
}

.education-title h4 {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1rem;
    margin-bottom: 4px;
}

.education-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.education-badge.opened {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(14, 203, 129, 0.3);
}

.education-badge.closed {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid rgba(30, 154, 245, 0.3);
}

.education-badge.closed.tp {
    background: var(--success-bg);
    color: var(--success);
    border-color: rgba(14, 203, 129, 0.3);
}

.education-badge.closed.sl {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(246, 70, 93, 0.3);
}

.education-content {
    padding: var(--space-md);
}

.education-reason {
    margin-bottom: var(--space-md);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.education-reason strong {
    color: var(--text-primary);
}

.education-explanation {
    background: rgba(0, 126, 128, 0.1);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    border-left: 3px solid var(--accent-primary);
    margin-bottom: var(--space-md);
}

.explanation-title {
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.education-explanation p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.education-indicators {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
}

.indicator-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.indicator-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.indicator-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.indicator-tag .indicator-status {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.indicator-tag .indicator-status.bullish {
    background: var(--success);
}

.indicator-tag .indicator-status.bearish {
    background: var(--danger);
}

/* Calculation Section */
.trade-calculation-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: var(--space-lg);
    overflow: hidden;
}

.calculation-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: linear-gradient(90deg, rgba(0, 126, 128, 0.15) 0%, transparent 100%);
    border-bottom: 1px solid var(--border-color);
}

.calculation-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
}

.calculation-title h4 {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1rem;
    margin-bottom: 2px;
}

.calculation-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.copy-calc-btn {
    margin-left: auto;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.copy-calc-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

.calculation-content {
    padding: var(--space-md);
}

.formula-box {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    border: 1px dashed var(--border-color);
}

.formula-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.formula-label span {
    color: var(--accent-primary);
    font-weight: 600;
}

.formula-text {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 1rem;
    color: var(--accent-secondary);
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    display: inline-block;
}

.calculation-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.calc-step {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--border-color);
    transition: all var(--transition-fast);
}

.calc-step:hover {
    border-left-color: var(--accent-primary);
    background: rgba(0, 126, 128, 0.05);
}

.calc-step.final {
    background: rgba(14, 203, 129, 0.1);
    border-left-color: var(--success);
}

.calc-step.final:hover {
    background: rgba(14, 203, 129, 0.15);
}

.step-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 50%;
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.calc-step.final .step-number {
    background: var(--success);
    color: var(--bg-primary);
}

.step-content {
    flex: 1;
}

.step-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.step-formula {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.step-formula.final-formula {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.step-result {
    color: var(--accent-secondary);
    font-weight: 600;
}

.step-result.positive {
    color: var(--success);
}

.step-result.negative {
    color: var(--danger);
}

.step-explanation {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.step-explanation span {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Copyable Summary */
.trade-copyable-summary {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: var(--space-lg);
    overflow: hidden;
}

.copyable-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
}

.copyable-header span:first-child {
    font-size: 0.9rem;
    font-weight: 500;
}

.copy-summary-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.copy-summary-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

.copy-summary-btn.copied {
    background: var(--success);
    border-color: var(--success);
    color: var(--bg-primary);
}

.copyable-content {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.75rem;
    line-height: 1.6;
    padding: var(--space-md);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 200px;
    overflow-y: auto;
    user-select: all;
}

.copyable-content::-webkit-scrollbar {
    width: 4px;
}

.copyable-content::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 2px;
}

/* Training Tips */
.trade-training-tips {
    background: linear-gradient(135deg, rgba(0, 52, 146, 0.1) 0%, rgba(30, 154, 245, 0.1) 100%);
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 52, 146, 0.3);
    padding: var(--space-md);
    margin-top: var(--space-lg);
}

.tips-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: var(--space-md);
}

.tips-icon {
    font-size: 1.25rem;
}

.tips-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 0.9rem;
    color: var(--purple);
}

.tips-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tip-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.tip-item .tip-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.tip-item.positive {
    border-left: 2px solid var(--success);
}

.tip-item.negative {
    border-left: 2px solid var(--danger);
}

.tip-item.info {
    border-left: 2px solid var(--info);
}

/* Updated Details Grid */
.trade-details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

@media (max-width: 768px) {
    .trade-details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .trade-summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .calculation-steps {
        gap: var(--space-sm);
    }
    
    .calc-step {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .step-number {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }
}

/* ============================================
   Trade Row Click Effect
   ============================================ */

.trade-row {
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.trade-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-gradient);
    transform: scaleY(0);
    transition: transform var(--transition-fast);
}

.trade-row:hover {
    background: rgba(0, 126, 128, 0.1);
    transform: translateX(4px);
}

.trade-row:hover::before {
    transform: scaleY(1);
}

.trade-row .view-icon {
    opacity: 0;
    transition: opacity var(--transition-fast);
    color: var(--accent-primary);
}

.trade-row:hover .view-icon {
    opacity: 1;
}

/* ============================================
   Results Stats Animation
   ============================================ */

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 40%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 60%
    );
    transform: rotate(45deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

/* ============================================
   Responsive Chart
   ============================================ */

@media (max-width: 768px) {
    .trade-summary-cards,
    .trade-modal-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .trade-details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #trade-candlestick-chart,
    .trade-candlestick-chart {
        height: 280px;
    }
    
    .trade-chart-modal {
        width: 98vw !important;
        max-width: 98vw !important;
    }
    
    .chart-section-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .chart-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .chart-interval-select {
        flex: 1;
    }
    
    .price-movement-visual {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .price-arrow {
        transform: rotate(90deg);
        min-width: 100px;
    }
    
    .price-arrow .price-change {
        transform: rotate(-90deg);
        white-space: nowrap;
    }
    
    .chart-legend {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .trade-pnl-badge {
        margin-left: 0;
        margin-top: 8px;
        width: fit-content;
    }
    
    .trade-detail-header {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .trade-modal-summary {
        grid-template-columns: 1fr 1fr;
    }
    
    .trade-details-grid {
        grid-template-columns: 1fr;
    }
    
    #trade-candlestick-chart,
    .trade-candlestick-chart {
        height: 220px;
    }
    
    .price-point .price-value {
        font-size: 1.1rem;
    }
}

/* ============================================
   Backtest Loading Overlay - Beautiful Animation
   ============================================ */

.backtest-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 14, 17, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.backtest-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.backtest-loading-content {
    text-align: center;
    max-width: 450px;
    padding: var(--space-2xl);
}

.backtest-loading-animation {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto var(--space-xl);
}

/* Loading Chart Animation */
.loading-chart-container {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 60px;
    padding: 0 10px;
}

.loading-candle {
    width: 12px;
    border-radius: 3px;
    animation: candleGrow 1.5s ease-in-out infinite;
}

.loading-candle.candle-1 {
    height: 25px;
    background: linear-gradient(180deg, var(--success) 0%, var(--success-dim) 100%);
    animation-delay: 0s;
}

.loading-candle.candle-2 {
    height: 40px;
    background: linear-gradient(180deg, var(--danger) 0%, #cc3344 100%);
    animation-delay: 0.2s;
}

.loading-candle.candle-3 {
    height: 30px;
    background: linear-gradient(180deg, var(--success) 0%, var(--success-dim) 100%);
    animation-delay: 0.4s;
}

.loading-candle.candle-4 {
    height: 50px;
    background: linear-gradient(180deg, var(--success) 0%, var(--success-dim) 100%);
    animation-delay: 0.6s;
}

.loading-candle.candle-5 {
    height: 35px;
    background: linear-gradient(180deg, var(--danger) 0%, #cc3344 100%);
    animation-delay: 0.8s;
}

@keyframes candleGrow {
    0%, 100% { transform: scaleY(1); opacity: 0.7; }
    50% { transform: scaleY(1.3); opacity: 1; }
}

.loading-line {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    animation: linePulse 2s ease-in-out infinite;
}

@keyframes linePulse {
    0%, 100% { opacity: 0.3; transform: scaleX(0.8); }
    50% { opacity: 1; transform: scaleX(1); }
}

/* Orbit Animation */
.loading-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 160px;
    height: 160px;
}

.orbit-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    border: 1px solid transparent;
    transform: translate(-50%, -50%);
}

.orbit-ring.ring-1 {
    width: 100%;
    height: 100%;
    border-color: rgba(0, 126, 128, 0.2);
    animation: orbitRotate 8s linear infinite;
}

.orbit-ring.ring-2 {
    width: 75%;
    height: 75%;
    border-color: rgba(30, 154, 245, 0.2);
    animation: orbitRotate 6s linear infinite reverse;
}

.orbit-ring.ring-3 {
    width: 50%;
    height: 50%;
    border-color: rgba(14, 203, 129, 0.2);
    animation: orbitRotate 4s linear infinite;
}

@keyframes orbitRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.orbit-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
}

.orbit-dot.dot-1 {
    background: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-primary), 0 0 40px var(--accent-primary);
    animation: orbitDot1 8s linear infinite;
}

.orbit-dot.dot-2 {
    background: var(--info);
    box-shadow: 0 0 20px var(--info), 0 0 40px var(--info);
    animation: orbitDot2 6s linear infinite;
}

.orbit-dot.dot-3 {
    background: var(--success);
    box-shadow: 0 0 20px var(--success), 0 0 40px var(--success);
    animation: orbitDot3 4s linear infinite;
}

@keyframes orbitDot1 {
    from { transform: rotate(0deg) translateX(80px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(80px) rotate(-360deg); }
}

@keyframes orbitDot2 {
    from { transform: rotate(120deg) translateX(60px) rotate(-120deg); }
    to { transform: rotate(-240deg) translateX(60px) rotate(240deg); }
}

@keyframes orbitDot3 {
    from { transform: rotate(240deg) translateX(40px) rotate(-240deg); }
    to { transform: rotate(600deg) translateX(40px) rotate(-600deg); }
}

/* Loading Symbol */
.loading-bitcoin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-primary);
    text-shadow: 0 0 30px var(--accent-glow), 0 0 60px var(--accent-glow);
    animation: loadingPulse 2s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        text-shadow: 0 0 30px var(--accent-glow), 0 0 60px var(--accent-glow);
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.1);
        text-shadow: 0 0 50px var(--accent-glow), 0 0 100px var(--accent-glow);
    }
}

/* Loading Title & Subtitle */
.backtest-loading-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    letter-spacing: 2px;
    animation: titleGlow 2s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 0 0 10px rgba(0, 126, 128, 0.3); }
    50% { text-shadow: 0 0 30px rgba(0, 126, 128, 0.6), 0 0 50px rgba(0, 126, 128, 0.3); }
}

.backtest-loading-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    animation: fadeInOut 3s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Progress Bar */
.backtest-progress-container {
    margin-bottom: var(--space-xl);
}

.backtest-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.backtest-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    border-radius: 3px;
    position: relative;
    animation: progressIndeterminate 2s ease-in-out infinite;
}

@keyframes progressIndeterminate {
    0% { width: 0%; margin-left: 0%; }
    50% { width: 50%; margin-left: 25%; }
    100% { width: 0%; margin-left: 100%; }
}

.backtest-progress-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%,
        rgba(0, 126, 128, 0.8) 50%,
        transparent 100%
    );
    animation: progressGlow 2s ease-in-out infinite;
}

@keyframes progressGlow {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.backtest-progress-stats {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-sm);
}

.progress-stat {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.progress-stat:first-child {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Loading Tips */
.loading-tips {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tip-icon {
    font-size: 1.2rem;
    animation: tipBounce 2s ease-in-out infinite;
}

@keyframes tipBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.tip-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: left;
    margin: 0;
}

/* Loading Overlay Entry Animation */
.backtest-loading-overlay.active .backtest-loading-content {
    animation: loadingContentEntry 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes loadingContentEntry {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ============================================
   Trade History Pagination
   ============================================ */

.trade-pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg) 0;
    margin-top: var(--space-md);
    border-top: 1px solid var(--border-color);
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--space-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(0, 126, 128, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: var(--accent-gradient);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
    font-weight: 700;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.pagination-btn svg {
    width: 16px;
    height: 16px;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.pagination-ellipsis {
    color: var(--text-muted);
    padding: 0 var(--space-xs);
    user-select: none;
}

.pagination-first,
.pagination-last {
    background: rgba(255, 255, 255, 0.03);
}

.pagination-prev,
.pagination-next {
    background: rgba(255, 255, 255, 0.05);
}

/* Trade item entry animation */
.trade-item {
    animation: tradeItemSlide 0.3s ease-out forwards;
    opacity: 0;
}

@keyframes tradeItemSlide {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   STRATEGY MANAGER VIEW
   ============================================ */

/* Manager Actions */
.manager-actions {
    display: flex;
    gap: var(--space-md);
}

/* Portfolio Overview Cards */
.portfolio-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.portfolio-card {
    position: relative;
    padding: var(--space-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.portfolio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.portfolio-card-bg {
    position: absolute;
    inset: 0;
    opacity: 0.1;
    background: radial-gradient(circle at 100% 0%, var(--accent-primary) 0%, transparent 50%);
}

.portfolio-card-icon {
    position: relative;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 126, 128, 0.15);
    border-radius: var(--radius-md);
    font-size: 1.75rem;
    margin-bottom: var(--space-md);
}

.portfolio-card-icon.active { background: rgba(30, 154, 245, 0.15); }
.portfolio-card-icon.trades { background: rgba(0, 52, 146, 0.15); }
.portfolio-card-icon.drawdown { background: rgba(246, 70, 93, 0.15); }

.icon-pulse {
    position: absolute;
    inset: -4px;
    border-radius: var(--radius-lg);
    border: 2px solid currentColor;
    opacity: 0;
    animation: iconPulse 2s ease-out infinite;
}

@keyframes iconPulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    100% { transform: scale(1.3); opacity: 0; }
}

.portfolio-card-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.portfolio-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.portfolio-value {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
}

.total-pnl-card .portfolio-value { color: var(--success); }
.active-card .portfolio-value { color: var(--info); }
.trades-card .portfolio-value { color: var(--purple); }
.drawdown-card .portfolio-value { color: var(--danger); }

.portfolio-change {
    font-size: 0.85rem;
    font-weight: 600;
}

.portfolio-change.positive { color: var(--success); }
.portfolio-change.negative { color: var(--danger); }

.portfolio-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.portfolio-sparkline {
    position: absolute;
    bottom: var(--space-md);
    right: var(--space-md);
    width: 80px;
    height: 30px;
    opacity: 0.5;
    color: var(--success);
}

.active-indicator {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
}

.active-dot {
    width: 12px;
    height: 12px;
    background: var(--success);
    border-radius: 50%;
    animation: activeDotPulse 2s ease-in-out infinite;
}

@keyframes activeDotPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(14, 203, 129, 0.5); }
    50% { transform: scale(1.2); box-shadow: 0 0 0 10px rgba(14, 203, 129, 0); }
}

/* Manager Grid */
.manager-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

/* Control Panel */
.strategies-control-panel,
.running-strategies-panel {
    min-height: 400px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.panel-icon {
    font-size: 1.25rem;
}

.panel-title h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.panel-actions {
    display: flex;
    gap: var(--space-xs);
}

.select-all-btn,
.deselect-all-btn {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.select-all-btn:hover,
.deselect-all-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

/* Strategy Control List */
.strategies-control-list {
    padding: var(--space-md);
    max-height: 350px;
    overflow-y: auto;
}

.strategy-control-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.strategy-control-item:hover {
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

.strategy-control-item.selected {
    background: rgba(0, 126, 128, 0.1);
    border-color: var(--accent-primary);
}

.strategy-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    cursor: pointer;
}

.strategy-checkbox:hover {
    border-color: var(--accent-primary);
    background: rgba(0, 126, 128, 0.1);
}

.strategy-control-item.selected .strategy-checkbox {
    background: var(--accent-gradient);
    border-color: var(--accent-primary);
}

.strategy-checkbox svg {
    width: 14px;
    height: 14px;
    stroke: var(--bg-primary);
    stroke-width: 3;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.strategy-control-item.selected .strategy-checkbox svg {
    opacity: 1;
}

.strategy-control-content {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex: 1;
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.strategy-control-content:hover {
    background: rgba(0, 126, 128, 0.1);
}

.strategy-control-info {
    flex: 1;
}

.strategy-control-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.strategy-control-meta {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.strategy-control-toggle {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 600;
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(14, 203, 129, 0.3);
}

.strategy-control-toggle.disabled {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(246, 70, 93, 0.3);
}

/* Running Strategies List */
.running-strategies-list {
    padding: var(--space-md);
    max-height: 350px;
    overflow-y: auto;
}

.running-count-badge {
    padding: 2px 8px;
    background: var(--accent-gradient);
    color: var(--bg-primary);
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: var(--space-sm);
}

.no-running-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    text-align: center;
    color: var(--text-muted);
}

.no-running-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.no-running-state p {
    font-size: 1rem;
    margin-bottom: var(--space-xs);
}

.no-running-state span {
    font-size: 0.85rem;
    opacity: 0.7;
}

.running-strategy-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: rgba(14, 203, 129, 0.05);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    border: 1px solid rgba(14, 203, 129, 0.2);
    animation: runningItemEnter 0.3s ease-out;
}

@keyframes runningItemEnter {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.running-strategy-status {
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

.running-strategy-info {
    flex: 1;
}

.running-strategy-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.running-strategy-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.running-strategy-pnl {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
}

.running-strategy-pnl.positive { color: var(--success); }
.running-strategy-pnl.negative { color: var(--danger); }

.running-strategy-stop {
    padding: 6px 12px;
    background: var(--danger-bg);
    border: 1px solid rgba(246, 70, 93, 0.3);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.running-strategy-stop:hover {
    background: var(--danger);
    color: var(--bg-primary);
}

/* Activities Panel */
.activities-panel {
    margin-bottom: var(--space-xl);
}

.activities-list {
    padding: var(--space-md);
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-xs);
    animation: activityEnter 0.2s ease-out;
}

@keyframes activityEnter {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.activity-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-message {
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.activity-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.activity-item.trade { background: rgba(14, 203, 129, 0.1); }
.activity-item.signal { background: rgba(0, 52, 146, 0.1); }
.activity-item.status { background: rgba(30, 154, 245, 0.1); }
.activity-item.error { background: rgba(246, 70, 93, 0.1); }

.no-activities-state {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-muted);
}

.refresh-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.refresh-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* ============================================
   MULTI-BACKTEST VIEW
   ============================================ */

.multi-backtest-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: var(--space-xl);
    align-items: start;
}

.multi-backtest-config {
    padding: var(--space-lg);
    position: sticky;
    top: 100px;
}

.strategy-checkboxes {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-height: 250px;
    overflow-y: auto;
    padding-right: var(--space-sm);
}

.strategy-checkbox-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.strategy-checkbox-item:hover {
    border-color: var(--accent-primary);
}

.strategy-checkbox-item.checked {
    background: rgba(0, 126, 128, 0.15);
    border-color: var(--accent-primary);
}

.strategy-checkbox-item input {
    display: none;
}

.checkbox-indicator {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.strategy-checkbox-item.checked .checkbox-indicator {
    background: var(--accent-gradient);
    border-color: var(--accent-primary);
}

.checkbox-indicator svg {
    width: 12px;
    height: 12px;
    stroke: var(--bg-primary);
    stroke-width: 3;
    opacity: 0;
}

.strategy-checkbox-item.checked .checkbox-indicator svg {
    opacity: 1;
}

.checkbox-label {
    flex: 1;
}

.checkbox-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.checkbox-category {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.quick-select-btns {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.quick-btn {
    flex: 1;
    padding: var(--space-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quick-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

.multi-presets {
    margin-bottom: var(--space-md);
}

.run-multi-btn {
    margin-top: var(--space-lg);
}

/* Multi-Backtest Results */
.multi-backtest-results {
    min-height: 600px;
}

.multi-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 600px;
    text-align: center;
    padding: var(--space-2xl);
    background: var(--bg-glass);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
}

.empty-illustration {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: var(--space-xl);
}

.compare-icon {
    position: relative;
    z-index: 1;
    color: var(--accent-primary);
    opacity: 0.6;
}

.pulse-ring {
    position: absolute;
    inset: 0;
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    animation: pulseRing 3s ease-out infinite;
}

.pulse-ring.delay-1 {
    animation-delay: 1s;
}

.multi-empty-state h3 {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.multi-empty-state p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Multi-Backtest Results Content */
.multi-results-content {
    background: var(--bg-glass);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    padding: var(--space-xl);
    animation: fadeInUp 0.5s ease;
}

.multi-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.multi-results-title {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.multi-results-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
}

.multi-results-info h3 {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.multi-results-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.multi-results-export {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.multi-results-export:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

/* Aggregated Metrics */
.aggregated-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.agg-metric-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    text-align: center;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.agg-metric-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-3px);
}

.agg-metric-value {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
}

.agg-metric-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.agg-metric-card.positive .agg-metric-value { color: var(--success); }
.agg-metric-card.negative .agg-metric-value { color: var(--danger); }
.agg-metric-card.info .agg-metric-value { color: var(--info); }
.agg-metric-card.purple .agg-metric-value { color: var(--purple); }

/* Strategy Rankings */
.rankings-section {
    margin-bottom: var(--space-xl);
}

.rankings-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.rankings-header h4 {
    font-size: 1rem;
    font-weight: 600;
}

.rankings-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.ranking-item {
    display: grid;
    grid-template-columns: 50px 2fr 1fr 1fr 1fr 1fr 1fr;
    gap: var(--space-md);
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.ranking-item:hover {
    transform: translateX(4px);
    background: rgba(0, 126, 128, 0.1);
}

.ranking-position {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
}

.ranking-position.gold {
    background: linear-gradient(135deg, #b0a880 0%, #9a9070 100%);
    color: #000;
}

.ranking-position.silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #a8a8a8 100%);
    color: #000;
}

.ranking-position.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #b8722d 100%);
    color: #000;
}

.ranking-position.default {
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.ranking-strategy {
    font-weight: 600;
}

.ranking-metric {
    text-align: center;
}

.ranking-metric-value {
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
}

.ranking-metric-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.ranking-metric-value.positive { color: var(--success); }
.ranking-metric-value.negative { color: var(--danger); }

/* Combined Equity Chart */
.combined-chart-section {
    margin-bottom: var(--space-xl);
}

.combined-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.combined-chart-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.combined-chart-title h4 {
    font-size: 1rem;
    font-weight: 600;
}

.combined-chart-container {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    min-height: 300px;
}

/* Strategy Results Grid */
.strategy-results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.strategy-result-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.strategy-result-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-3px);
}

.strategy-result-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.strategy-result-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
}

.strategy-result-name {
    font-weight: 600;
    font-size: 1rem;
}

.strategy-result-return {
    margin-left: auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
}

.strategy-result-return.positive { color: var(--success); }
.strategy-result-return.negative { color: var(--danger); }

.strategy-result-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.strategy-result-metric {
    text-align: center;
    padding: var(--space-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.strategy-result-metric .metric-value {
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1rem;
    font-weight: 600;
}

.strategy-result-metric .metric-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Manager & Multi-Backtest Responsive */
@media (max-width: 1200px) {
    .portfolio-overview {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .manager-grid {
        grid-template-columns: 1fr;
    }
    
    .multi-backtest-layout {
        grid-template-columns: 1fr;
    }
    
    .multi-backtest-config {
        position: static;
    }
    
    .ranking-item {
        grid-template-columns: 50px 2fr 1fr 1fr 1fr;
    }
    
    .ranking-item .ranking-metric:nth-child(5),
    .ranking-item .ranking-metric:nth-child(6) {
        display: none;
    }
    
    .strategy-results-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .portfolio-overview {
        grid-template-columns: 1fr;
    }
    
    .portfolio-card {
        padding: var(--space-md);
    }
    
    .portfolio-value {
        font-size: 1.5rem;
    }
    
    .aggregated-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ranking-item {
        grid-template-columns: 40px 1fr 1fr;
        gap: var(--space-sm);
        padding: var(--space-sm);
    }
    
    .ranking-item .ranking-metric:nth-child(n+4) {
        display: none;
    }
    
    .ranking-strategy {
        font-size: 0.85rem;
    }
    
    .strategy-result-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .multi-results-header {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .manager-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .manager-actions .btn {
        width: 100%;
    }
}

/* Responsive pagination */
@media (max-width: 600px) {
    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination-pages {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: var(--space-sm);
    }
    
    .pagination-btn {
        min-width: 32px;
        height: 32px;
    }
    
    .pagination-btn.pagination-num {
        display: none;
    }
    
    .pagination-btn.pagination-num.active,
    .pagination-btn.pagination-num:first-child,
    .pagination-btn.pagination-num:last-child {
        display: flex;
    }
}

/* ============================================
   Auto Ranking Page Styles
   ============================================ */

/* Header Actions */
.ranking-header-actions {
    display: flex;
    gap: var(--space-md);
}

/* Ranking Config Panel */
.ranking-config-panel {
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    background: linear-gradient(135deg, rgba(30, 154, 245, 0.05) 0%, rgba(0, 126, 128, 0.05) 100%);
    border: 1px solid var(--border-color);
}

.ranking-config-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.ranking-config-icon {
    font-size: 2.5rem;
}

.ranking-config-title h3 {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.ranking-config-title p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0.25rem 0 0 0;
}

.ranking-config-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.ranking-date-presets {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.date-preset-btn {
    padding: 0.75rem 1.25rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.date-preset-btn:hover {
    background: rgba(30, 154, 245, 0.1);
    border-color: var(--accent-secondary);
    color: var(--text-primary);
}

.date-preset-btn.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-color: transparent;
    color: var(--bg-primary);
    font-weight: 600;
}

.ranking-date-custom {
    display: flex;
    align-items: flex-end;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.date-input-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.date-input {
    padding: 0.75rem 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 0.95rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    min-width: 160px;
}

.date-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 126, 128, 0.1);
}

.date-range-arrow {
    font-size: 1.5rem;
    color: var(--text-secondary);
    padding-bottom: 0.75rem;
}

.ranking-estimate-panel {
    display: flex;
    gap: var(--space-xl);
    padding: var(--space-md) var(--space-lg);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.estimate-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.estimate-icon {
    font-size: 1.25rem;
}

.estimate-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.estimate-value {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.ranking-start-btn {
    align-self: center;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    margin-top: var(--space-sm);
}

/* Timer Display */
.ranking-timer-display {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    border: 1px solid var(--accent-primary);
}

.timer-icon {
    font-size: 1.25rem;
}

.timer-value {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    min-width: 70px;
    text-align: center;
}

/* Status Bar */
.ranking-status-bar {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    background: linear-gradient(135deg, rgba(0, 126, 128, 0.1) 0%, rgba(30, 154, 245, 0.1) 100%);
    border: 1px solid var(--accent-primary);
}

.ranking-status-content {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.ranking-status-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ranking-loader {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ranking-status-text {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.ranking-status-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ranking-status-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.ranking-progress-bar {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.ranking-progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
    box-shadow: 0 0 20px var(--accent-glow);
}

/* Podium */
.ranking-podium {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-2xl) var(--space-lg);
    margin-bottom: var(--space-xl);
}

.podium-position {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-lg);
    padding-bottom: 70px;
    border-radius: var(--radius-lg);
    position: relative;
    transition: all var(--transition-normal);
    width: 280px;
    min-width: 280px;
}

.podium-position:hover {
    transform: translateY(-10px);
}

.podium-position.gold {
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.05) 100%);
    border: 2px solid rgba(255, 215, 0, 0.5);
    min-height: 430px;
    height: 430px;
    order: 2;
}

.podium-position.silver {
    background: linear-gradient(180deg, rgba(192, 192, 192, 0.2) 0%, rgba(192, 192, 192, 0.05) 100%);
    border: 2px solid rgba(192, 192, 192, 0.5);
    min-height: 430px;
    height: 430px;
    order: 1;
}

.podium-position.bronze {
    background: linear-gradient(180deg, rgba(205, 127, 50, 0.2) 0%, rgba(205, 127, 50, 0.05) 100%);
    border: 2px solid rgba(205, 127, 50, 0.5);
    min-height: 430px;
    height: 430px;
    order: 3;
}

.podium-crown {
    font-size: 2rem;
    position: absolute;
    top: -30px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.podium-medal {
    font-size: 3rem;
    margin-bottom: var(--space-sm);
}

.podium-icon {
    font-size: 2.5rem;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
}

.podium-name {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    max-width: 180px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.podium-return {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.podium-return.positive { color: var(--success); }
.podium-return.negative { color: var(--danger); }

.podium-stats {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.podium-base {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.podium-position.gold .podium-base {
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.3) 0%, rgba(255, 215, 0, 0.6) 100%);
}

.podium-position.silver .podium-base {
    background: linear-gradient(180deg, rgba(192, 192, 192, 0.3) 0%, rgba(192, 192, 192, 0.6) 100%);
}

.podium-position.bronze .podium-base {
    background: linear-gradient(180deg, rgba(205, 127, 50, 0.3) 0%, rgba(205, 127, 50, 0.6) 100%);
}

/* Summary Stats */
.ranking-summary-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.ranking-stat-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
}

.ranking-stat-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.ranking-stat-info {
    display: flex;
    flex-direction: column;
}

.ranking-stat-value {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ranking-stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Ranking Table Section */
.ranking-table-section {
    margin-bottom: var(--space-xl);
    overflow: hidden;
}

.ranking-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.ranking-table-title {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.ranking-table-title h3 {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.1rem;
}

.ranking-table-icon {
    font-size: 1.5rem;
}

.ranking-table-container {
    overflow-x: auto;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
}

.ranking-table thead th {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.ranking-table tbody .ranking-row {
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.ranking-table tbody .ranking-row:hover {
    background: var(--bg-hover);
}

.ranking-table tbody .ranking-row.gold {
    background: rgba(255, 215, 0, 0.05);
}

.ranking-table tbody .ranking-row.gold:hover {
    background: rgba(255, 215, 0, 0.1);
}

.ranking-table tbody .ranking-row.silver {
    background: rgba(192, 192, 192, 0.05);
}

.ranking-table tbody .ranking-row.silver:hover {
    background: rgba(192, 192, 192, 0.1);
}

.ranking-table tbody .ranking-row.bronze {
    background: rgba(205, 127, 50, 0.05);
}

.ranking-table tbody .ranking-row.bronze:hover {
    background: rgba(205, 127, 50, 0.1);
}

.ranking-table td {
    padding: var(--space-md) var(--space-lg);
    font-size: 0.95rem;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    background: var(--bg-secondary);
}

.rank-badge.gold {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3) 0%, rgba(255, 215, 0, 0.1) 100%);
    border: 1px solid rgba(255, 215, 0, 0.5);
    font-size: 1.25rem;
}

.rank-badge.silver {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.3) 0%, rgba(192, 192, 192, 0.1) 100%);
    border: 1px solid rgba(192, 192, 192, 0.5);
    font-size: 1.25rem;
}

.rank-badge.bronze {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.3) 0%, rgba(205, 127, 50, 0.1) 100%);
    border: 1px solid rgba(205, 127, 50, 0.5);
    font-size: 1.25rem;
}

.strategy-cell {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.strategy-icon-small {
    font-size: 1.5rem;
}

.strategy-name {
    font-weight: 500;
}

.score-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 120px;
}

.score-fill {
    height: 8px;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.score-value {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-primary);
    min-width: 36px;
}

.return-col.positive { color: var(--success); font-weight: 600; }
.return-col.negative { color: var(--danger); font-weight: 600; }
.drawdown-col.negative { color: var(--danger); }

/* Ranking Chart Section */
.ranking-chart-section {
    margin-bottom: var(--space-xl);
}

.ranking-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.ranking-chart-title {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.ranking-chart-title h3 {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.1rem;
}

.ranking-chart-tabs {
    display: flex;
    gap: var(--space-sm);
}

.chart-tab {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chart-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.chart-tab.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
    font-weight: 600;
}

.ranking-bar-chart {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.ranking-bar-row {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.ranking-bar-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 200px;
}

.bar-icon {
    font-size: 1.5rem;
}

.bar-name {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ranking-bar-container {
    flex: 1;
    height: 32px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.ranking-bar {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: var(--space-md);
    border-radius: var(--radius-sm);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 60px;
}

.ranking-bar.negative {
    background: var(--danger) !important;
}

.ranking-bar-value {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bg-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Details Section */
.ranking-details-section {
    margin-bottom: var(--space-xl);
}

.ranking-details-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.ranking-details-icon {
    font-size: 1.5rem;
}

.ranking-details-header h3 {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.1rem;
}

.ranking-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-lg);
}

.ranking-detail-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.ranking-detail-card:hover {
    border-color: var(--card-accent, var(--accent-primary));
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.ranking-detail-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: linear-gradient(135deg, rgba(var(--card-accent), 0.1) 0%, transparent 100%);
    border-bottom: 1px solid var(--border-color);
}

.ranking-detail-rank {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    min-width: 50px;
    text-align: center;
}

.ranking-detail-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex: 1;
}

.ranking-detail-icon {
    font-size: 1.5rem;
}

.ranking-detail-name {
    font-weight: 600;
    font-size: 1rem;
}

.ranking-detail-return {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
}

.ranking-detail-return.positive { color: var(--success); }
.ranking-detail-return.negative { color: var(--danger); }

.ranking-detail-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    padding: var(--space-lg);
}

.detail-metric {
    text-align: center;
    padding: var(--space-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.detail-metric-value {
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1rem;
    font-weight: 600;
}

.detail-metric-value.positive { color: var(--success); }
.detail-metric-value.negative { color: var(--danger); }

.detail-metric-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.ranking-detail-bar {
    height: 4px;
    background: var(--bg-secondary);
}

.detail-bar-fill {
    height: 100%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Empty State */
.ranking-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    text-align: center;
    min-height: 400px;
}

.ranking-empty-illustration {
    position: relative;
    margin-bottom: var(--space-xl);
}

.empty-trophy {
    font-size: 5rem;
    opacity: 0.3;
}

.empty-pulse {
    position: absolute;
    inset: -20px;
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    opacity: 0;
    animation: pulseOut 2s ease-out infinite;
}

@keyframes pulseOut {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.ranking-empty-state h3 {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
}

.ranking-empty-state p {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

/* Auto Ranking Responsive */
@media (max-width: 1200px) {
    .ranking-summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ranking-podium {
        gap: var(--space-md);
    }
    
    .podium-position {
        padding: var(--space-md);
        padding-bottom: 65px;
        width: 240px;
        min-width: 240px;
    }
    
    .podium-position.gold { min-height: 390px; height: 390px; }
    .podium-position.silver { min-height: 390px; height: 390px; }
    .podium-position.bronze { min-height: 390px; height: 390px; }
    
    .podium-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .podium-name {
        font-size: 0.85rem;
        max-width: 140px;
        min-height: 40px;
    }
    
    .podium-return {
        font-size: 1.25rem;
    }
}

@media (max-width: 768px) {
    .ranking-config-panel {
        padding: var(--space-md);
    }
    
    .ranking-config-header {
        flex-direction: column;
        text-align: center;
    }
    
    .ranking-date-presets {
        justify-content: center;
    }
    
    .date-preset-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .ranking-date-custom {
        flex-direction: column;
        align-items: stretch;
    }
    
    .date-range-arrow {
        text-align: center;
        padding: 0;
        transform: rotate(90deg);
    }
    
    .date-input {
        width: 100%;
    }
    
    .ranking-estimate-panel {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .ranking-start-btn {
        width: 100%;
    }
    
    .ranking-timer-display {
        margin-left: 0;
        margin-top: var(--space-md);
    }
    
    .ranking-status-content {
        flex-direction: column;
        text-align: center;
    }
    
    .ranking-header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .ranking-header-actions .btn {
        width: 100%;
    }
    
    .ranking-summary-stats {
        grid-template-columns: 1fr;
    }
    
    .ranking-podium {
        flex-direction: column;
        align-items: center;
    }
    
    .podium-position {
        order: unset !important;
        min-height: auto !important;
        height: auto !important;
        width: 100%;
        min-width: unset;
        max-width: 300px;
        border-radius: var(--radius-lg);
        border: 2px solid;
        padding-bottom: var(--space-lg);
    }
    
    .podium-position.gold { border-color: rgba(255, 215, 0, 0.5); }
    .podium-position.silver { border-color: rgba(192, 192, 192, 0.5); }
    .podium-position.bronze { border-color: rgba(205, 127, 50, 0.5); }
    
    .podium-crown {
        position: static;
        margin-bottom: var(--space-sm);
    }
    
    .podium-name {
        min-height: auto;
    }
    
    .podium-base {
        position: static;
        height: auto;
        padding: var(--space-sm);
        border-radius: var(--radius-sm);
        margin-top: var(--space-md);
    }
    
    .ranking-chart-header {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .ranking-chart-tabs {
        width: 100%;
        justify-content: center;
    }
    
    .ranking-bar-label {
        min-width: 120px;
    }
    
    .bar-name {
        font-size: 0.8rem;
    }
    
    .ranking-details-grid {
        grid-template-columns: 1fr;
    }
    
    .ranking-detail-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ranking-table-header {
        flex-direction: column;
        gap: var(--space-md);
    }
}

/* ============================================
   Manual Trading Test Page Styles
   ============================================ */

.manual-trading-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
    padding: var(--space-lg);
}

.connection-test-card,
.trading-settings-card,
.trading-buttons-card,
.trade-results-card,
.current-position-card {
    padding: var(--space-lg);
}

.connection-test-card {
    grid-column: span 2;
}

.connection-status-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.connection-status-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.connection-status-item .status-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.connection-status-item .status-value {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.status-connected {
    color: var(--success) !important;
}

.status-disconnected {
    color: var(--danger) !important;
}

.status-value-highlight {
    color: var(--accent-primary) !important;
}

.status-error {
    color: var(--danger) !important;
    font-size: 0.8rem !important;
}

.connection-error {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: rgba(246, 70, 93, 0.1);
    border: 1px solid rgba(246, 70, 93, 0.3);
    border-radius: var(--radius-md);
    color: var(--danger);
}

.error-icon {
    font-size: 1.25rem;
}

.error-text {
    font-size: 0.85rem;
}

.settings-form {
    margin-top: var(--space-md);
}

.settings-form .form-row {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.settings-form .form-group {
    flex: 1;
}

.settings-form label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.settings-form input,
.settings-form select {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 0.9rem;
}

.settings-form input:focus,
.settings-form select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(30, 154, 245, 0.2);
}

.trading-buttons-card {
    grid-column: span 2;
}

.trading-buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
    margin-top: var(--space-lg);
}

.trading-button-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.trading-button-section h4 {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.long-section h4 {
    color: var(--success);
}

.short-section h4 {
    color: var(--danger);
}

.button-group {
    display: flex;
    gap: var(--space-md);
}

.trade-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: var(--space-lg) var(--space-md);
    min-height: 100px;
    transition: all 0.3s ease;
}

.trade-btn .btn-icon {
    font-size: 1.5rem;
}

.trade-btn .btn-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
}

.trade-btn .btn-desc {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
}

.trade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.trade-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #00a896);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #c41e3a);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #f39c12);
    border: none;
    color: #000;
}

.btn-warning .btn-desc {
    color: rgba(0, 0, 0, 0.6);
}

.trade-results-card {
    grid-column: span 2;
}

.trade-log-content {
    margin-top: var(--space-md);
    max-height: 400px;
    overflow-y: auto;
}

.empty-log-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    color: var(--text-muted);
}

.empty-log-state .empty-icon {
    font-size: 2rem;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.trade-log-entry {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid var(--border-color);
}

.trade-log-entry.log-success {
    border-left-color: var(--success);
    background: rgba(14, 203, 129, 0.05);
}

.trade-log-entry.log-error {
    border-left-color: var(--danger);
    background: rgba(246, 70, 93, 0.05);
}

.trade-log-entry.log-warning {
    border-left-color: var(--warning);
    background: rgba(255, 159, 67, 0.05);
}

.trade-log-entry.log-info {
    border-left-color: var(--info);
    background: rgba(30, 154, 245, 0.05);
}

.log-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.log-message {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.log-details {
    margin-top: var(--space-sm);
}

.toggle-details-btn {
    font-size: 0.7rem;
    padding: 4px 8px;
    background: rgba(30, 154, 245, 0.1);
    border: 1px solid rgba(30, 154, 245, 0.3);
    color: var(--accent-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-details-btn:hover {
    background: rgba(30, 154, 245, 0.2);
}

.log-data {
    margin-top: var(--space-sm);
    padding: var(--space-sm);
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-secondary);
    overflow-x: auto;
    max-height: 200px;
    overflow-y: auto;
}

.position-display {
    margin-top: var(--space-md);
}

.no-position-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
}

.no-position-state .no-position-icon {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

.position-info {
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    border: 2px solid;
}

.position-info.long {
    background: rgba(14, 203, 129, 0.05);
    border-color: rgba(14, 203, 129, 0.3);
}

.position-info.short {
    background: rgba(246, 70, 93, 0.05);
    border-color: rgba(246, 70, 93, 0.3);
}

.position-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.position-side {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
}

.position-info.long .position-side {
    color: var(--success);
}

.position-info.short .position-side {
    color: var(--danger);
}

.position-symbol {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.position-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.position-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.position-detail-item .label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.position-detail-item .value {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.position-detail-item .value.positive {
    color: var(--success);
}

.position-detail-item .value.negative {
    color: var(--danger);
}

.position-detail-item .value.liq-price {
    color: var(--warning);
}

.position-error {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: rgba(246, 70, 93, 0.1);
    border: 1px solid rgba(246, 70, 93, 0.3);
    border-radius: var(--radius-md);
    color: var(--danger);
}

/* Manual Trading Responsive */
@media (max-width: 1200px) {
    .manual-trading-container {
        grid-template-columns: 1fr;
    }
    
    .connection-test-card,
    .trading-buttons-card,
    .trade-results-card {
        grid-column: span 1;
    }
    
    .connection-status-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .trading-buttons-grid {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .trade-btn {
        flex-direction: row;
        justify-content: center;
        min-height: auto;
        padding: var(--space-md);
    }
    
    .position-details {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   Live Execution Dashboard Styles
   Game-like UI with Rich Animations
   ============================================ */

/* Navigation Live Badge */
.nav-item .live-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 2px 4px;
    background: linear-gradient(135deg, #f6465d 0%, #9a6565 100%);
    color: white;
    border-radius: 4px;
    animation: liveBadgePulse 2s infinite;
}

@keyframes liveBadgePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

/* Empty State */
.le-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: var(--space-2xl);
}

.le-empty-illustration {
    margin-bottom: var(--space-xl);
}

.le-empty-icon {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.le-empty-icon .empty-rocket {
    font-size: 4rem;
    animation: rocketFloat 3s ease-in-out infinite;
}

@keyframes rocketFloat {
    0%, 100% { transform: translateY(0) rotate(-15deg); }
    50% { transform: translateY(-15px) rotate(-15deg); }
}

.pulse-ring-outer, .pulse-ring-inner {
    position: absolute;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
    opacity: 0.3;
    animation: pulseRingExpand 2s ease-out infinite;
}

.pulse-ring-outer {
    width: 100%;
    height: 100%;
}

.pulse-ring-inner {
    width: 80%;
    height: 80%;
    animation-delay: 0.5s;
}

@keyframes pulseRingExpand {
    0% { transform: scale(1); opacity: 0.3; }
    100% { transform: scale(1.5); opacity: 0; }
}

.le-empty-state h3 {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.le-empty-state p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

/* Dashboard Layout */
.le-dashboard {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* Strategy Header Card */
.le-strategy-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    background: linear-gradient(135deg, rgba(0, 126, 128, 0.1) 0%, rgba(255, 205, 0, 0.05) 100%);
    border: 1px solid rgba(0, 126, 128, 0.3);
    animation: headerGlow 3s ease-in-out infinite;
}

@keyframes headerGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 126, 128, 0.1); }
    50% { box-shadow: 0 0 40px rgba(0, 126, 128, 0.2); }
}

.le-strategy-info {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.le-strategy-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.le-strategy-details h2 {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.3rem;
    margin-bottom: var(--space-sm);
}

.le-strategy-meta {
    display: flex;
    gap: var(--space-sm);
}

.le-badge {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.le-badge.symbol {
    background: rgba(30, 154, 245, 0.2);
    color: var(--info);
}

.le-badge.mode.live {
    background: linear-gradient(135deg, rgba(246, 70, 93, 0.3), rgba(154, 101, 101, 0.3));
    color: #9a6565;
    animation: liveModeGlow 1.5s ease-in-out infinite;
}

@keyframes liveModeGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(246, 70, 93, 0.5); }
    50% { box-shadow: 0 0 15px rgba(246, 70, 93, 0.7); }
}

.le-badge.status {
    background: rgba(14, 203, 129, 0.2);
    color: var(--success);
}

.le-strategy-stats {
    display: flex;
    gap: var(--space-xl);
}

.le-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.le-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.le-stat-value {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
}

.le-stat-value.pnl.positive {
    color: var(--success);
}

.le-stat-value.pnl.negative {
    color: var(--danger);
}

.le-stop-btn {
    padding: var(--space-md) var(--space-lg);
}

/* Main Grid Layout */
.le-main-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: var(--space-lg);
}

/* Price Column */
.le-price-column {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* Price Card */
.le-price-card {
    padding: var(--space-lg);
    text-align: center;
    background: linear-gradient(180deg, rgba(0, 126, 128, 0.05) 0%, transparent 100%);
}

.le-price-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.le-price-icon {
    font-size: 1.5rem;
    color: var(--accent-primary);
}

.le-price-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.le-current-price {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    text-shadow: 0 0 20px rgba(0, 126, 128, 0.3);
}

.le-price-change {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    font-size: 0.9rem;
}

.le-price-change.positive {
    color: var(--success);
}

.le-price-change.negative {
    color: var(--danger);
}

.le-mini-chart {
    height: 60px;
    margin-top: var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

/* Position Card */
.le-position-card {
    padding: var(--space-lg);
}

.le-position-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.le-position-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.le-position-title h3 {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1rem;
}

.le-position-badge {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.le-position-badge.no-position {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.le-position-badge.long {
    background: linear-gradient(135deg, var(--success), #0ba368);
    color: white;
}

.le-position-badge.short {
    background: linear-gradient(135deg, var(--danger), #9a6565);
    color: white;
}

/* No Position State */
.le-no-position {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-xl);
    color: var(--text-secondary);
}

.waiting-animation {
    display: flex;
    gap: var(--space-sm);
}

.waiting-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-primary);
    animation: waitingDotPulse 1.4s ease-in-out infinite;
}

.waiting-dot:nth-child(2) { animation-delay: 0.2s; }
.waiting-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes waitingDotPulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Active Position State */
.le-active-position {
    animation: positionFadeIn 0.5s ease-out;
}

@keyframes positionFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.le-position-side-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
}

.le-position-side-indicator.long {
    background: linear-gradient(135deg, rgba(14, 203, 129, 0.2), rgba(14, 203, 129, 0.05));
    border: 1px solid rgba(14, 203, 129, 0.3);
}

.le-position-side-indicator.short {
    background: linear-gradient(135deg, rgba(246, 70, 93, 0.2), rgba(246, 70, 93, 0.05));
    border: 1px solid rgba(246, 70, 93, 0.3);
}

.side-icon {
    font-size: 1.5rem;
}

.side-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
}

.le-position-side-indicator.long .side-text {
    color: var(--success);
}

.le-position-side-indicator.short .side-text {
    color: var(--danger);
}

/* PnL Display */
.le-pnl-display {
    text-align: center;
    padding: var(--space-lg);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
}

.le-pnl-value {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: var(--space-xs);
}

.le-pnl-value.positive {
    color: var(--success);
    text-shadow: 0 0 30px rgba(14, 203, 129, 0.5);
}

.le-pnl-value.negative {
    color: var(--danger);
    text-shadow: 0 0 30px rgba(246, 70, 93, 0.5);
}

.le-pnl-percent {
    font-size: 0.9rem;
    margin-bottom: var(--space-md);
}

.le-pnl-percent.positive { color: var(--success); }
.le-pnl-percent.negative { color: var(--danger); }

.le-pnl-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.pnl-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.3s ease, background 0.3s ease;
}

.pnl-bar-fill.positive {
    background: linear-gradient(90deg, var(--success), #00ffaa);
}

.pnl-bar-fill.negative {
    background: linear-gradient(90deg, var(--danger), #9a6565);
}

/* Position Details */
.le-position-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.le-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.le-detail-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.le-detail-value {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 0.85rem;
}

.le-distance {
    font-size: 0.75rem;
    margin-left: var(--space-sm);
    padding: 2px 6px;
    border-radius: 4px;
}

.tp-row .le-distance {
    background: rgba(14, 203, 129, 0.2);
    color: var(--success);
}

.sl-row .le-distance {
    background: rgba(246, 70, 93, 0.2);
    color: var(--danger);
}

/* Exit Analysis */
.le-exit-analysis {
    margin-top: var(--space-lg);
    padding: var(--space-md);
    background: rgba(30, 154, 245, 0.1);
    border: 1px solid rgba(30, 154, 245, 0.2);
    border-radius: var(--radius-md);
}

.le-exit-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--info);
}

.le-exit-content {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Signal Column */
.le-signal-column {
    min-width: 0;
}

.le-signal-card {
    padding: var(--space-lg);
    height: 100%;
}

.le-signal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.le-signal-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.le-signal-title h3 {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1rem;
}

/* Timeframe Tabs */
.le-timeframe-tabs {
    display: flex;
    gap: var(--space-xs);
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: var(--radius-md);
}

.tf-tab {
    padding: 6px 14px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tf-tab:hover {
    color: var(--text-primary);
}

.tf-tab.active {
    background: var(--accent-gradient);
    color: white;
}

/* Signal Overview */
.le-signal-overview {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    margin-bottom: var(--space-lg);
    padding: var(--space-lg);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
}

.le-signal-gauge {
    flex-shrink: 0;
}

.gauge-svg {
    width: 120px;
    height: 60px;
}

.gauge-label {
    text-align: center;
    margin-top: -25px;
}

.gauge-value {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.gauge-text {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.le-signal-type {
    flex: 1;
}

.signal-text {
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.signal-text.buy { color: var(--success); }
.signal-text.sell { color: var(--danger); }
.signal-text.hold { color: var(--warning); }

.signal-confidence {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Signal Reason */
.le-signal-reason {
    padding: var(--space-md);
    background: rgba(0, 126, 128, 0.1);
    border: 1px solid rgba(0, 126, 128, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
}

.le-reason-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    font-weight: 600;
    color: var(--warning);
}

.reason-summary {
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.missing-conditions {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.missing-conditions li {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding-left: var(--space-md);
    position: relative;
}

.missing-conditions li::before {
    content: '✗';
    position: absolute;
    left: 0;
    color: var(--danger);
}

/* Indicators Section */
.le-indicators-section {
    margin-bottom: var(--space-lg);
}

.le-indicators-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    font-weight: 600;
}

.le-indicators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}

.le-indicator-item {
    padding: var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    border-left: 3px solid;
    transition: all var(--transition-fast);
}

.le-indicator-item.bullish {
    border-color: var(--success);
}

.le-indicator-item.bearish {
    border-color: var(--danger);
}

.le-indicator-item.neutral {
    border-color: var(--text-muted);
}

.le-indicator-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: var(--space-xs);
}

.le-indicator-value {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.le-indicator-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-xs);
}

.le-indicator-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

.le-indicator-explanation {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Factors Section */
.le-factors-section {
    margin-top: var(--space-lg);
}

.le-factors-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.le-factors-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    font-size: 0.85rem;
    font-weight: 600;
}

.le-factors-header.bullish { color: var(--success); }
.le-factors-header.bearish { color: var(--danger); }

.le-factors-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.le-factor-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    font-size: 0.8rem;
    padding: var(--space-sm);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
}

.le-factor-icon {
    flex-shrink: 0;
}

.le-factor-text {
    color: var(--text-secondary);
}

/* Bottom Grid */
.le-bottom-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-lg);
}

/* Positions Panel */
.le-positions-panel {
    padding: var(--space-lg);
}

.le-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.le-panel-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.le-panel-title h3 {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 1rem;
}

.le-positions-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-height: 300px;
    overflow-y: auto;
}

.le-position-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-left: 3px solid;
}

.le-position-item:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: translateX(5px);
}

.le-position-item.profit {
    border-color: var(--success);
}

.le-position-item.loss {
    border-color: var(--danger);
}

.le-position-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.le-position-side-small {
    font-weight: 700;
    font-size: 0.8rem;
}

.le-position-side-small.long { color: var(--success); }
.le-position-side-small.short { color: var(--danger); }

.le-position-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.le-position-right {
    text-align: right;
}

.le-position-pnl {
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-weight: 700;
}

.le-position-pnl.positive { color: var(--success); }
.le-position-pnl.negative { color: var(--danger); }

.le-position-pnl-pct {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Errors Panel */
.le-errors-panel {
    padding: var(--space-lg);
}

.le-error-count {
    font-size: 0.75rem;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
}

.le-error-count.has-errors {
    background: rgba(246, 70, 93, 0.2);
    color: var(--danger);
}

.le-errors-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-height: 300px;
    overflow-y: auto;
}

.le-no-errors {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-xl);
    color: var(--success);
}

.le-error-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: rgba(246, 70, 93, 0.1);
    border: 1px solid rgba(246, 70, 93, 0.2);
    border-radius: var(--radius-md);
}

.le-error-icon {
    flex-shrink: 0;
    color: var(--danger);
}

.le-error-content {
    flex: 1;
}

.le-error-message {
    font-size: 0.85rem;
    color: var(--danger);
    margin-bottom: 2px;
}

.le-error-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* No Data State */
.le-no-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-xl);
    color: var(--text-secondary);
}

.le-no-data-icon {
    font-size: 2rem;
    opacity: 0.5;
}

/* Loss Modal */
.le-loss-modal-content {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.le-loss-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.le-loss-icon {
    font-size: 2rem;
}

.le-loss-body {
    padding: var(--space-lg);
}

/* ============================================
   Strategy Decision Logs Panel
   ============================================ */
.le-decision-logs-section {
    margin-top: var(--space-lg);
}

.le-decision-logs-panel {
    padding: var(--space-lg);
}

.le-decision-logs-panel .le-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.le-decision-logs-panel .le-panel-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.le-live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    background: rgba(14, 203, 129, 0.15);
    border: 1px solid rgba(14, 203, 129, 0.3);
    border-radius: var(--radius-full);
    color: var(--success);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.le-decision-controls {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Decision Summary Cards */
.le-decision-summaries {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.le-no-decisions {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-xl);
    color: var(--text-secondary);
    text-align: center;
}

.le-no-decisions-icon {
    font-size: 2.5rem;
    opacity: 0.5;
}

/* Individual Decision Card */
.le-decision-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s ease;
}

.le-decision-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(0, 126, 128, 0.15);
}

.le-decision-card.has-signal {
    border-color: var(--success);
    box-shadow: 0 0 20px rgba(14, 203, 129, 0.2);
}

.le-decision-card.has-signal.short {
    border-color: var(--danger);
    box-shadow: 0 0 20px rgba(246, 70, 93, 0.2);
}

.le-decision-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-color);
}

.le-decision-strategy-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.le-decision-strategy-icon {
    font-size: 1.5rem;
}

.le-decision-strategy-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.le-decision-strategy-symbol {
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
}

.le-decision-phase-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.le-decision-phase-badge.waiting {
    background: rgba(0, 126, 128, 0.15);
    color: var(--warning);
}

.le-decision-phase-badge.analyzing {
    background: rgba(30, 154, 245, 0.15);
    color: var(--info);
}

.le-decision-phase-badge.signal {
    background: rgba(14, 203, 129, 0.15);
    color: var(--success);
}

.le-decision-phase-badge.no-signal {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.le-decision-phase-badge.position {
    background: rgba(0, 52, 146, 0.15);
    color: var(--purple);
}

.le-decision-phase-badge.risk {
    background: rgba(246, 70, 93, 0.15);
    color: var(--danger);
}

.le-decision-card-body {
    padding: var(--space-md);
}

.le-decision-summary-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--accent-primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Conditions Grid */
.le-decision-conditions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.le-condition-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
}

.le-condition-item.met {
    background: rgba(14, 203, 129, 0.1);
    color: var(--success);
}

.le-condition-item.unmet {
    background: rgba(246, 70, 93, 0.1);
    color: var(--danger);
}

.le-condition-icon {
    font-size: 0.8rem;
}

.le-condition-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Indicators Row */
.le-decision-indicators {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.le-indicator-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.le-indicator-chip.bullish {
    background: rgba(14, 203, 129, 0.1);
    border-color: rgba(14, 203, 129, 0.3);
    color: var(--success);
}

.le-indicator-chip.bearish {
    background: rgba(246, 70, 93, 0.1);
    border-color: rgba(246, 70, 93, 0.3);
    color: var(--danger);
}

.le-indicator-chip.neutral {
    color: var(--text-secondary);
}

/* Waiting Progress */
.le-decision-waiting {
    margin-bottom: var(--space-md);
}

.le-waiting-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: rgba(0, 126, 128, 0.1);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-xs);
}

.le-waiting-icon {
    animation: pulse 1.5s infinite;
}

.le-waiting-text {
    flex: 1;
    font-size: 0.8rem;
    color: var(--warning);
}

.le-waiting-progress {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* No Position Reasons */
.le-decision-reasons {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.le-reason-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    font-size: 0.75rem;
    padding: var(--space-sm);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--text-muted);
}

.le-reason-item.blocking {
    border-left-color: var(--danger);
    background: rgba(246, 70, 93, 0.05);
}

.le-reason-item.warning {
    border-left-color: var(--warning);
    background: rgba(0, 126, 128, 0.05);
}

.le-reason-icon {
    flex-shrink: 0;
}

.le-reason-text {
    flex: 1;
    color: var(--text-secondary);
}

.le-reason-needed {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Confidence Score */
.le-decision-confidence {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    margin-top: var(--space-md);
}

.le-confidence-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.le-confidence-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.le-confidence-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
    background: linear-gradient(90deg, var(--danger) 0%, var(--warning) 50%, var(--success) 100%);
}

.le-confidence-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 40px;
    text-align: right;
}

/* Decision Log Stream */
.le-decision-log-stream {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.75rem;
}

.le-log-entry {
    padding: var(--space-sm) var(--space-md);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--border-color);
    animation: slideIn 0.3s ease;
}

.le-log-entry.signal-buy {
    border-left-color: var(--success);
    background: rgba(14, 203, 129, 0.05);
}

.le-log-entry.signal-sell {
    border-left-color: var(--danger);
    background: rgba(246, 70, 93, 0.05);
}

.le-log-entry.waiting {
    border-left-color: var(--warning);
}

.le-log-entry.no-signal {
    border-left-color: var(--text-muted);
}

.le-log-entry.position {
    border-left-color: var(--purple);
    background: rgba(0, 52, 146, 0.05);
}

.le-log-entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.le-log-entry-strategy {
    font-weight: 600;
    color: var(--accent-primary);
}

.le-log-entry-time {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.le-log-entry-summary {
    color: var(--text-primary);
    line-height: 1.4;
}

.le-log-entry-details {
    margin-top: var(--space-xs);
    padding-top: var(--space-xs);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    white-space: pre-wrap;
    color: var(--text-secondary);
    font-size: 0.7rem;
    max-height: 100px;
    overflow-y: auto;
    display: none;
}

.le-log-entry.expanded .le-log-entry-details {
    display: block;
}

.le-log-entry-toggle {
    font-size: 0.65rem;
    color: var(--info);
    cursor: pointer;
    margin-top: 4px;
}

.le-log-entry-toggle:hover {
    text-decoration: underline;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Position Card in Decision */
.le-decision-position {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: rgba(0, 52, 146, 0.1);
    border: 1px solid rgba(0, 52, 146, 0.3);
    border-radius: var(--radius-md);
}

.le-decision-position-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.le-decision-position-side {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-weight: 600;
}

.le-decision-position-side.long {
    color: var(--success);
}

.le-decision-position-side.short {
    color: var(--danger);
}

.le-decision-position-pnl {
    font-size: 1.1rem;
    font-weight: 700;
}

.le-decision-position-pnl.profit {
    color: var(--success);
}

.le-decision-position-pnl.loss {
    color: var(--danger);
}

.le-decision-position-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xs);
    font-size: 0.75rem;
}

.le-decision-position-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
}

.le-decision-position-label {
    color: var(--text-secondary);
}

.le-decision-position-value {
    color: var(--text-primary);
    font-weight: 500;
}

/* Responsive */
@media (max-width: 1200px) {
    .le-main-grid {
        grid-template-columns: 1fr;
    }
    
    .le-bottom-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .le-strategy-header {
        flex-direction: column;
        gap: var(--space-lg);
        text-align: center;
    }
    
    .le-strategy-info {
        flex-direction: column;
    }
    
    .le-strategy-stats {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .le-signal-overview {
        flex-direction: column;
    }
    
    .le-factors-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Enhanced Dark Theme Animations & Effects
   ============================================ */

/* --- Card Entrance Animation (staggered) --- */
.glass-card,
.strategy-card,
.stat-card,
.settings-card,
.metric-card {
    animation: cardReveal 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.glass-card:nth-child(1) { animation-delay: 0.05s; }
.glass-card:nth-child(2) { animation-delay: 0.1s; }
.glass-card:nth-child(3) { animation-delay: 0.15s; }
.glass-card:nth-child(4) { animation-delay: 0.2s; }
.glass-card:nth-child(5) { animation-delay: 0.25s; }
.glass-card:nth-child(6) { animation-delay: 0.3s; }

.strategy-card:nth-child(1) { animation-delay: 0.05s; }
.strategy-card:nth-child(2) { animation-delay: 0.1s; }
.strategy-card:nth-child(3) { animation-delay: 0.15s; }
.strategy-card:nth-child(4) { animation-delay: 0.2s; }
.strategy-card:nth-child(5) { animation-delay: 0.25s; }
.strategy-card:nth-child(6) { animation-delay: 0.3s; }
.strategy-card:nth-child(7) { animation-delay: 0.35s; }
.strategy-card:nth-child(8) { animation-delay: 0.4s; }

@keyframes cardReveal {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* --- Card Hover Lift with Glow --- */
.glass-card,
.strategy-card,
.stat-card {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.35s ease;
}

.glass-card:hover,
.strategy-card:hover,
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 0 25px rgba(0, 126, 128, 0.06);
    border-color: rgba(0, 126, 128, 0.15);
}

/* --- Breathing Glow on Active Elements --- */
.strategy-card.active,
.strategy-card.running {
    animation: breatheGlow 3s ease-in-out infinite alternate;
}

@keyframes breatheGlow {
    from {
        box-shadow: 0 0 15px rgba(0, 126, 128, 0.05),
                    0 8px 30px rgba(0, 0, 0, 0.4);
    }
    to {
        box-shadow: 0 0 30px rgba(0, 126, 128, 0.12),
                    0 12px 40px rgba(0, 0, 0, 0.5);
    }
}

/* --- Button Ripple Effect --- */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease, opacity 0.5s ease;
    opacity: 0;
}

.btn:active::after {
    width: 300px;
    height: 300px;
    opacity: 1;
    transition: 0s;
}

/* --- Animated Border Gradient --- */
.auth-card {
    position: relative;
}

.auth-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 21px;
    background: linear-gradient(
        var(--border-angle, 0deg),
        rgba(0, 126, 128, 0.15),
        transparent 40%,
        transparent 60%,
        rgba(0, 126, 128, 0.1)
    );
    z-index: -1;
    animation: rotateBorder 12s linear infinite;
}

@property --border-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

@keyframes rotateBorder {
    to { --border-angle: 360deg; }
}

/* --- Floating Particles Background --- */
.animated-bg .floating-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(0, 126, 128, 0.4) !important;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(0, 126, 128, 0.2);
    opacity: 0.6;
    animation: particleRise 15s infinite;
}

@keyframes particleRise {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { transform: translateY(-100vh) translateX(50px); opacity: 0; }
}

/* --- Data Stream Lines --- */
/* Grid lines are now defined in the animated-bg section above */

/* --- Shimmer Effect for Loading States --- */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.loading-shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.02) 25%,
        rgba(255, 255, 255, 0.06) 50%,
        rgba(255, 255, 255, 0.02) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
}

/* --- Pulse Ring for Status Indicators --- */
.status-indicator,
.live-badge-pulse {
    position: relative;
}

.status-indicator::before,
.live-badge-pulse::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid currentColor;
    opacity: 0;
    animation: pulseRing 2s ease-out infinite;
}

@keyframes pulseRing {
    0% {
        transform: scale(0.8);
        opacity: 0.6;
    }
    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

/* --- Smooth Number Counter Effect --- */
.stat-value,
.ticker-price-row,
.balance-amount {
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.stat-value:hover,
.ticker-price-row:hover {
    text-shadow: 0 0 12px rgba(0, 126, 128, 0.2);
}

/* Nav link hover effects are now in navigation.css */

/* --- Subtle Vignette Overlay --- */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(
        ellipse at center,
        transparent 50%,
        rgba(0, 0, 0, 0.4) 100%
    );
    pointer-events: none;
    z-index: 0;
}

/* --- Noise Texture Overlay --- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* --- Typewriter Title Animation for Auth --- */
@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blinkCursor {
    0%, 100% { border-right-color: rgba(0, 126, 128, 0.6); }
    50% { border-right-color: transparent; }
}

.auth-title {
    overflow: hidden;
    white-space: nowrap;
    animation: typewriter 1.2s steps(14) 0.3s both,
               blinkCursor 0.8s step-end 3;
    border-right: 2px solid rgba(0, 126, 128, 0.6);
    display: inline-block;
}

/* --- Floating Icon Animation --- */
@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.logo-icon-wrapper {
    animation: floatY 4s ease-in-out infinite;
}

.logo-icon-wrapper.large {
    animation: floatY 3s ease-in-out infinite;
}

/* --- Smooth Page Transition --- */
.main-content,
.auth-container,
.settings-view {
    animation: pageSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes pageSlideIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Tooltip Hover Glow --- */
[data-tooltip]:hover::before {
    animation: tooltipFade 0.25s ease both;
}

@keyframes tooltipFade {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Focus Glow Animation --- */
input:focus,
select:focus,
textarea:focus {
    animation: focusGlow 0.3s ease both;
}

@keyframes focusGlow {
    from {
        box-shadow: 0 0 0 0 rgba(0, 126, 128, 0);
    }
    to {
        box-shadow: 0 0 0 3px rgba(0, 126, 128, 0.1),
                    0 0 15px rgba(0, 126, 128, 0.05);
    }
}

/* --- Subtle Table Row Hover --- */
tr {
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

tr:hover {
    background: rgba(0, 126, 128, 0.03);
}

/* --- Smooth Scrollbar Styling --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 126, 128, 0.15);
    border-radius: 3px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 126, 128, 0.3);
}

/* --- Orb colors override for dark theme --- */
.orb-1 {
    background: rgba(0, 126, 128, 0.15) !important;
    opacity: 0.12 !important;
}

.orb-2 {
    background: rgba(0, 52, 146, 0.15) !important;
    opacity: 0.1 !important;
}

.orb-3 {
    background: rgba(30, 154, 245, 0.15) !important;
    opacity: 0.08 !important;
}

/* --- Hexagonal Grid Pattern (subtle) --- */
.animated-bg .grid-lines::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(
        circle at 1px 1px,
        rgba(0, 126, 128, 0.03) 1px,
        transparent 0
    );
    background-size: 40px 40px;
    animation: gridMove 30s linear infinite;
}

/* --- Selection Highlight --- */
::selection {
    background: rgba(0, 126, 128, 0.25);
    color: #ffffff;
}

/* ============================================
   Pair Selector Component Styles
   ============================================ */

/* Enhanced select input for pair selectors on config panels */
.pair-select-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(20, 25, 33, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23848e9c' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.pair-select-input:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px var(--accent-glow);
}

.pair-select-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.pair-select-input optgroup {
    background: var(--bg-secondary);
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 4px 0;
}

.pair-select-input option {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 0.9rem;
}

/* Pair Selector - Custom Dropdown Component */
.pair-selector {
    position: relative;
    width: 100%;
}

.pair-selector-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.9rem;
    background: rgba(20, 25, 33, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
}

.pair-selector-trigger:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px var(--accent-glow);
}

.pair-selector-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pair-selector-display .pair-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.pair-selector-display .pair-symbol {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    letter-spacing: 0.5px;
}

.pair-selector-display .pair-name {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.pair-selector-arrow {
    color: var(--text-secondary);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.pair-selector-dropdown.open ~ .pair-selector-trigger .pair-selector-arrow,
.pair-selector-dropdown.open + .pair-selector-trigger .pair-selector-arrow {
    transform: rotate(180deg);
}

/* Dropdown Panel */
.pair-selector-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.pair-selector-dropdown.open {
    max-height: 420px;
    opacity: 1;
    pointer-events: auto;
    overflow: visible;
}

/* Search Box */
.pair-search-box {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.pair-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: rgba(11, 14, 17, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.pair-search-input:focus {
    border-color: var(--accent-primary);
}

.pair-search-input::placeholder {
    color: var(--text-muted);
}

/* Category Tabs */
.pair-category-tabs {
    display: flex;
    gap: 0;
    padding: 0.25rem 0.5rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--border-color);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.pair-category-tabs::-webkit-scrollbar {
    display: none;
}

.pair-cat-btn {
    flex-shrink: 0;
    padding: 0.35rem 0.6rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.7rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
}

.pair-cat-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.pair-cat-btn.active {
    background: rgba(0, 126, 128, 0.15);
    color: var(--accent-primary);
    font-weight: 600;
}

/* Options List */
.pair-options-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 0.25rem;
}

.pair-options-list::-webkit-scrollbar {
    width: 4px;
}

.pair-options-list::-webkit-scrollbar-track {
    background: transparent;
}

.pair-options-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.pair-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}

.pair-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.pair-option.selected {
    background: rgba(0, 126, 128, 0.1);
    border: 1px solid rgba(0, 126, 128, 0.2);
}

.pair-option-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.pair-option-info {
    flex: 1;
    min-width: 0;
}

.pair-option-symbol {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    letter-spacing: 0.5px;
}

.pair-option-name {
    color: var(--text-secondary);
    font-size: 0.72rem;
    display: block;
}

.pair-option-category {
    font-size: 0.65rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Ranking Pair Selector Section */
.ranking-pair-selector-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.pair-selector-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.pair-selector-header .pair-selector-icon {
    font-size: 1.2rem;
}

.pair-selector-header label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* Manager Pair Section */
.manager-pair-section {
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.5rem;
}

.manager-pair-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.manager-pair-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.manager-pair-title .manager-pair-icon {
    font-size: 1.5rem;
}

.manager-pair-title h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.manager-pair-title p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.manager-pair-selector {
    min-width: 280px;
    max-width: 350px;
    flex: 1;
}

/* Futures Pair Section */
.futures-pair-section {
    margin-bottom: 1.5rem;
}

.futures-pair-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.futures-pair-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Current Pair Badge - displayed on backtest/live/performance pages */
.current-pair-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: rgba(0, 126, 128, 0.1);
    border: 1px solid rgba(0, 126, 128, 0.2);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.current-pair-badge .badge-icon {
    font-size: 0.9rem;
}

.current-pair-badge .badge-symbol {
    color: var(--accent-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    letter-spacing: 0.5px;
}

.current-pair-badge .badge-name {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
    .pair-selector-dropdown.open {
        max-height: 350px;
    }
    
    .manager-pair-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .manager-pair-selector {
        max-width: 100%;
    }
    
    .pair-category-tabs {
        padding: 0.2rem 0.3rem;
    }
    
    .pair-cat-btn {
        font-size: 0.65rem;
        padding: 0.3rem 0.45rem;
    }
}

/* --- Reduced Motion Override --- */
@media (prefers-reduced-motion: reduce) {
    .auth-title {
        animation: none;
        border-right: none;
        width: auto;
    }
    
    .glass-card,
    .strategy-card,
    .stat-card,
    .settings-card,
    .metric-card {
        animation: none;
    }
    
    .animated-bg::after {
        animation: none;
    }
    
    .logo-icon-wrapper {
        animation: none;
    }
}
