/* ===== CSS Variables ===== */
:root {
    --bg-primary: rgba(13, 17, 23, 0.85);
    --bg-secondary: rgba(22, 27, 34, 0.9);
    --bg-tertiary: rgba(33, 38, 45, 0.9);
    --bg-card: rgba(28, 33, 40, 0.9);
    --border-color: rgba(48, 54, 61, 0.8);
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent-blue: #58a6ff;
    --accent-green: #3fb950;
    --accent-red: #f85149;
    --accent-yellow: #d29922;
    --accent-purple: #a371f7;
    --buy-color: #00c853;
    --sell-color: #ff1744;
    --hold-color: #ffc107;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --radius-sm: 8px;
    --sidebar-width: 240px;

/* ===== Video Background ===== */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.video-background video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    opacity: 1;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(13, 17, 23, 0.5) 0%,
        rgba(22, 27, 34, 0.4) 50%,
        rgba(13, 17, 23, 0.5) 100%
    );
    pointer-events: none;
}
    --sidebar-collapsed: 60px;
}

/* App Container with Sidebar */
.app-container {
    display: flex;
    min-height: 100vh;
    background: transparent;
    position: relative;
    z-index: 1;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, rgba(10, 14, 20, 0.95) 0%, rgba(13, 17, 23, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 100;
    transition: width 0.3s ease, transform 0.3s ease;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .status-text {
    display: none;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    font-size: 28px;
    min-width: 28px;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.sidebar-toggle {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.sidebar-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 8px 12px 4px;
    white-space: nowrap;
}

.nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.nav-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-btn.active {
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.2), rgba(88, 166, 255, 0.1));
    color: var(--accent-blue);
    border-left: 3px solid var(--accent-blue);
}

.nav-btn.platform-nav.active {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(255, 107, 53, 0.1));
    border-left-color: #ff6b35;
}

.nav-btn.mt5-nav.active {
    background: linear-gradient(135deg, rgba(41, 98, 255, 0.2), rgba(41, 98, 255, 0.1));
    border-left-color: #2962ff;
}

.nav-btn.home-link {
    text-decoration: none;
    margin-top: 8px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.nav-btn.home-link:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.1));
    color: #8b5cf6;
}

.nav-icon {
    font-size: 18px;
    min-width: 24px;
    text-align: center;
}

.nav-text {
    white-space: nowrap;
}

.sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid var(--border-color);
}

.sidebar-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: statusPulse 2s infinite;
}

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

/* Main App Area */
.app {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
    height: 100vh;
    overflow-y: auto;
    position: relative;
}

.sidebar.collapsed + .app {
    margin-left: var(--sidebar-collapsed);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .app {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
    }
    
    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

/* ===== Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

/* PWA standalone mode */
@media (display-mode: standalone) {
    .app {
        max-width: 600px;
        margin: 0 auto;
        min-height: 100vh;
    }
}

/* ===== Header ===== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 32px;
}

.logo-text h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-text .version {
    font-size: 12px;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Price Source Indicator */
.price-source {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(88, 166, 255, 0.15);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    color: var(--accent-blue);
    cursor: help;
}

.price-source.live {
    background: rgba(63, 185, 80, 0.15);
    color: var(--accent-green);
}

.price-source.offline {
    background: rgba(210, 153, 34, 0.15);
    color: var(--accent-yellow);
}

.price-disclaimer {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    color: #ffc107;
    cursor: pointer;
    transition: all 0.2s ease;
}

.price-disclaimer:hover {
    background: rgba(255, 193, 7, 0.25);
    transform: scale(1.05);
}

.source-dot {
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    animation: sourcePulse 2s infinite;
}

@keyframes sourcePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.source-text {
    white-space: nowrap;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(63, 185, 80, 0.15);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-green);
}

.pulse {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.icon-button {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: 10px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-button:hover {
    background: var(--border-color);
}

/* ===== Main Content ===== */
.main-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: rgba(13, 17, 23, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ===== Pocket Option Button ===== */
/* Platform Selection Section */
.platform-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.platform-toggle {
    display: flex;
    gap: 8px;
    padding: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
}

.platform-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: calc(var(--radius) - 4px);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.platform-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.platform-btn.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.platform-btn[data-platform="pocketOption"].active {
    background: linear-gradient(135deg, #ff6b35, #f7931a);
    color: white;
}

.platform-btn[data-platform="mt5"].active {
    background: linear-gradient(135deg, #2962ff, #1e88e5);
    color: white;
}

.platform-icon {
    font-size: 18px;
}

.quick-trade-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931a 50%, #ff6b35 100%);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.quick-trade-btn.mt5 {
    background: linear-gradient(135deg, #2962ff 0%, #1e88e5 50%, #2962ff 100%);
    box-shadow: 0 4px 15px rgba(41, 98, 255, 0.4);
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.quick-trade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.5);
}

.pocket-option-btn:active {
    transform: translateY(0);
}

.po-icon {
    font-size: 24px;
}

.po-arrow {
    font-size: 20px;
    transition: transform 0.3s;
}

.pocket-option-btn:hover .po-arrow {
    transform: translateX(5px);
}

/* ===== Live Market Ticker ===== */
.market-ticker-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.market-ticker-section .section-header {
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
}

.ticker-controls {
    display: flex;
    gap: 4px;
}

.ticker-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.ticker-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.market-ticker {
    overflow: hidden;
    position: relative;
    height: 50px;
}

.ticker-track {
    display: flex;
    gap: 20px;
    animation: tickerScroll 30s linear infinite;
    padding: 10px 0;
}

.ticker-track.paused {
    animation-play-state: paused;
}

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

.ticker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.ticker-item .flags {
    display: flex;
}

.ticker-item .flags img {
    width: 18px;
    height: 14px;
    border-radius: 2px;
}

.ticker-item .flags img:last-child {
    margin-left: -4px;
}

.ticker-item .pair-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.ticker-item .price {
    font-size: 12px;
    font-family: 'SF Mono', Monaco, monospace;
    color: var(--text-secondary);
}

.ticker-item .change {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.ticker-item .change.up {
    color: var(--buy-color);
    background: rgba(0, 200, 83, 0.15);
}

.ticker-item .change.down {
    color: var(--sell-color);
    background: rgba(255, 23, 68, 0.15);
}

/* ===== Multi-Select Controls ===== */
.multi-select-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    flex-wrap: wrap;
}

.multi-select-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
}

.multi-select-toggle input {
    display: none;
}

.toggle-slider {
    width: 40px;
    height: 22px;
    background: var(--bg-tertiary);
    border-radius: 11px;
    position: relative;
    transition: background 0.2s;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.2s;
}

.multi-select-toggle input:checked + .toggle-slider {
    background: var(--accent-blue);
}

.multi-select-toggle input:checked + .toggle-slider::after {
    left: 21px;
    background: white;
}

.selected-count {
    font-size: 12px;
    color: var(--text-muted);
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 12px;
}

.analyze-selected-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--accent-purple);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: auto;
}

.analyze-selected-btn:hover:not(:disabled) {
    background: #b388ff;
    transform: translateY(-1px);
}

.analyze-selected-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Multi-select mode pair cards */
.pair-card.multi-mode {
    position: relative;
}

.pair-card.multi-mode::before {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-tertiary);
    transition: all 0.2s;
}

.pair-card.multi-mode.multi-selected::before {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.pair-card.multi-mode.multi-selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* ===== Multi-Pair Analysis Section ===== */
.multi-analysis-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.multi-analysis-section .section-header {
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
}

.close-analysis-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
}

.multi-analysis-results {
    max-height: 400px;
    overflow-y: auto;
}

.analysis-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.analysis-card:last-child {
    border-bottom: none;
}

.analysis-card:hover {
    background: var(--bg-secondary);
}

.analysis-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.analysis-flags {
    display: flex;
}

.analysis-flags img {
    width: 24px;
    height: 18px;
    border-radius: 2px;
}

.analysis-flags img:last-child {
    margin-left: -6px;
}

.analysis-info {
    display: flex;
    flex-direction: column;
}

.analysis-pair {
    font-weight: 600;
    font-size: 14px;
}

.analysis-price {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'SF Mono', Monaco, monospace;
}

.analysis-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.analysis-signal {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

.analysis-signal.buy {
    background: rgba(0, 200, 83, 0.2);
    color: var(--buy-color);
}

.analysis-signal.sell {
    background: rgba(255, 23, 68, 0.2);
    color: var(--sell-color);
}

.analysis-signal.hold {
    background: rgba(255, 193, 7, 0.15);
    color: var(--hold-color);
}

.analysis-confidence {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: right;
}

.analysis-trade-btn {
    padding: 6px 12px;
    background: linear-gradient(135deg, #ff6b35, #f7931a);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.analysis-trade-btn:hover {
    transform: scale(1.05);
}

/* ===== Signal Card ===== */
.signal-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.signal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.pair-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pair-flags {
    display: flex;
    align-items: center;
}

.pair-flags .flag {
    width: 28px;
    height: 20px;
    border-radius: 3px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.pair-flags .flag:last-child {
    margin-left: -8px;
}

.pair-details {
    display: flex;
    flex-direction: column;
}

.pair-name {
    font-size: 18px;
    font-weight: 700;
}

.pair-price {
    font-size: 14px;
    color: var(--text-secondary);
    font-family: 'SF Mono', Monaco, monospace;
}

.signal-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.signal-badge.buy {
    background: rgba(0, 200, 83, 0.2);
    color: var(--buy-color);
}

.signal-badge.sell {
    background: rgba(255, 23, 68, 0.2);
    color: var(--sell-color);
}

.signal-badge.hold {
    background: rgba(255, 193, 7, 0.2);
    color: var(--hold-color);
}

.signal-body {
    padding: 20px;
}

.signal-direction {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 0;
    margin-bottom: 20px;
}

.direction-icon {
    font-size: 64px;
    margin-bottom: 12px;
}

.direction-text {
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
}

.signal-direction.buy .direction-icon::after { content: '📈'; }
.signal-direction.buy .direction-text { color: var(--buy-color); }

.signal-direction.sell .direction-icon::after { content: '📉'; }
.signal-direction.sell .direction-text { color: var(--sell-color); }

.entry-points {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 20px;
}

.entry-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.entry-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.entry-value {
    font-family: 'SF Mono', Monaco, monospace;
    font-weight: 600;
    font-size: 16px;
}

.entry-value.profit {
    color: var(--accent-green);
}

.entry-value.loss {
    color: var(--accent-red);
}

.confidence-meter {
    margin-top: 16px;
}

.meter-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.meter-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-red) 0%, var(--accent-yellow) 50%, var(--accent-green) 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.signal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.timestamp {
    font-size: 12px;
    color: var(--text-muted);
}

.refresh-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.4);
}

.refresh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.refresh-icon {
    font-size: 16px;
}

/* ===== Pairs Section ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.pair-filter {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.pairs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.pair-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.pair-card:hover {
    border-color: var(--accent-blue);
    background: var(--bg-secondary);
}

.pair-card.selected {
    border-color: var(--accent-blue);
    background: rgba(88, 166, 255, 0.1);
}

.pair-card .flags {
    display: flex;
    margin-bottom: 8px;
}

.pair-card .flags img {
    width: 24px;
    height: 18px;
    border-radius: 2px;
    object-fit: cover;
}

.pair-card .flags img:last-child {
    margin-left: -6px;
}

.pair-card .name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.pair-card .price {
    font-size: 11px;
    color: var(--text-secondary);
    font-family: 'SF Mono', Monaco, monospace;
    transition: color 0.3s;
}

.pair-card .price.up {
    color: var(--buy-color);
}

.pair-card .price.down {
    color: var(--sell-color);
}

/* ===== Scan Section ===== */
.scan-btn {
    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-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.scan-btn:hover {
    background: var(--border-color);
}

.scan-results {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.scan-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    color: var(--text-muted);
    text-align: center;
}

.placeholder-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.scan-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.scan-item:hover {
    background: var(--bg-secondary);
}

.scan-item:last-child {
    border-bottom: none;
}

.scan-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.scan-item-flags {
    display: flex;
}

.scan-item-flags img {
    width: 22px;
    height: 16px;
    border-radius: 2px;
    object-fit: cover;
}

.scan-item-flags img:last-child {
    margin-left: -5px;
}

.scan-item-name {
    font-weight: 600;
    font-size: 14px;
}

.scan-item-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.scan-item-confidence {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'SF Mono', Monaco, monospace;
}

.scan-item-signal {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    min-width: 50px;
    text-align: center;
}

.scan-item-signal.buy {
    background: rgba(0, 200, 83, 0.2);
    color: var(--buy-color);
}

.scan-item-signal.sell {
    background: rgba(255, 23, 68, 0.2);
    color: var(--sell-color);
}

.scan-item-signal.hold {
    background: rgba(255, 193, 7, 0.15);
    color: var(--hold-color);
}

/* ===== Strategy Section ===== */
.strategy-indicators {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 500px) {
    .strategy-indicators {
        grid-template-columns: repeat(2, 1fr);
    }
}

.indicator-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.indicator-icon {
    font-size: 24px;
}

.indicator-info {
    display: flex;
    flex-direction: column;
}

.indicator-name {
    font-size: 12px;
    color: var(--text-secondary);
}

.indicator-value {
    font-size: 16px;
    font-weight: 600;
    font-family: 'SF Mono', Monaco, monospace;
}

.indicator-value.bullish {
    color: var(--accent-green);
}

.indicator-value.bearish {
    color: var(--accent-red);
}

/* ===== History Section ===== */
.history-actions {
    display: flex;
    gap: 8px;
}

.export-btn {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-blue);
    border-radius: 6px;
    color: var(--accent-blue);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.export-btn:hover {
    background: rgba(88, 166, 255, 0.15);
}

.clear-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
}

.clear-btn:hover {
    background: var(--bg-tertiary);
}

.history-list {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    max-height: 300px;
    overflow-y: auto;
}

.history-placeholder {
    display: flex;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.history-item:last-child {
    border-bottom: none;
}

.history-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-signal {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.history-signal.buy {
    background: rgba(0, 200, 83, 0.2);
}

.history-signal.sell {
    background: rgba(255, 23, 68, 0.2);
}

.history-info {
    display: flex;
    flex-direction: column;
}

.history-pair {
    font-weight: 600;
    font-size: 14px;
}

.history-time {
    font-size: 12px;
    color: var(--text-muted);
}

.history-right {
    text-align: right;
}

.history-price {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 14px;
}

.history-confidence {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    background: var(--bg-primary);
    border-radius: 0;
    border: none;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.modal-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.close-btn {
    width: 40px;
    height: 40px;
    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-primary);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.close-btn:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
}

.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-group label {
    font-size: 14px;
    color: var(--text-secondary);
}

.setting-group select {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
}

.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-wrapper input[type="checkbox"] {
    display: none;
}

.toggle {
    width: 48px;
    height: 26px;
    background: var(--bg-tertiary);
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.2s;
}

input[type="checkbox"]:checked + .toggle {
    background: var(--accent-green);
}

input[type="checkbox"]:checked + .toggle::after {
    left: 25px;
    background: white;
}

.setting-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.setting-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.save-settings-btn {
    width: 100%;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 16px;
}

.save-settings-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(88, 166, 255, 0.5);
}

.save-settings-btn:active {
    transform: translateY(0);
}

/* Setting group improvements */
.setting-group {
    margin-bottom: 24px;
}

.setting-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
}

.setting-group select {
    width: 100%;
    padding: 16px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 15px;
    cursor: pointer;
}

.setting-group select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.setting-hint {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 13px;
}

.setting-actions {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 17, 23, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-overlay.active {
    display: flex;
}

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader span {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===== Notification Toast ===== */
.notification-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--accent-green);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow);
    z-index: 3000;
    opacity: 0;
    transition: all 0.3s ease;
}

.notification-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.notification-toast .toast-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-green);
    border-radius: 50%;
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.notification-toast.error {
    border-color: var(--accent-red);
}

.notification-toast.error .toast-icon {
    background: var(--accent-red);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* ===== Responsive ===== */
@media (max-width: 400px) {
    .pairs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .strategy-indicators {
        grid-template-columns: 1fr;
    }
    
    .pair-filter {
        display: none;
    }
}

/* ===== Calculator Modal Styles ===== */
.calc-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.calc-tab {
    flex: 1;
    padding: 16px 20px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.calc-tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.calc-tab.active {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    box-shadow: 0 4px 15px rgba(88, 166, 255, 0.3);
}

.calc-panel {
    display: none;
}

.calc-panel.active {
    display: block;
}

.calc-group {
    margin-bottom: 24px;
}

.calc-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

.calc-group input,
.calc-group select {
    width: 100%;
    padding: 16px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 500;
}

.calc-group input:focus,
.calc-group select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

.calc-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 24px;
}

.calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 166, 255, 0.4);
}

.calc-result {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 24px;
    border: 2px solid var(--border-color);
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.result-row span:first-child {
    color: var(--text-secondary);
    font-size: 15px;
}

.result-row span:last-child {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 20px;
}

.result-row.highlight span:last-child {
    color: var(--accent-green);
    font-size: 28px;
}

/* ===== Risk Manager Modal Styles ===== */
.risk-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.risk-card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    border: 2px solid var(--border-color);
}

.risk-label {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
}

.risk-value-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.risk-value-group input {
    width: 80px;
    padding: 12px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--accent-blue);
    font-size: 24px;
    font-weight: 700;
    text-align: center;
}

.risk-value-group input:focus {
    border-color: var(--accent-blue);
    outline: none;
}

.risk-value-group span {
    color: var(--text-muted);
    font-size: 18px;
    font-weight: 600;
}

.risk-rules {
    margin-bottom: 32px;
}

.risk-rules h3 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.rule-item:hover {
    border-color: var(--accent-blue);
}

.rule-item input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--accent-green);
}

.rule-item label {
    color: var(--text-primary);
    font-size: 15px;
    cursor: pointer;
    flex: 1;
}

.risk-stats {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    border: 2px solid var(--border-color);
}

.risk-stats h3 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.stat-row span:first-child {
    color: var(--text-secondary);
    font-size: 15px;
}

.stat-row span:last-child {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 18px;
}

@media (max-width: 600px) {
    .risk-summary {
        grid-template-columns: 1fr;
    }
    
    .calc-tabs {
        flex-wrap: wrap;
    }
    
    .calc-tab {
        flex: 1 1 45%;
    }
}

/* ===== Live Trading Chart ===== */
.chart-section {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    flex-wrap: wrap;
    gap: 16px;
}

.chart-pair-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.chart-pair-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.chart-current-price {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.chart-price-change {
    font-size: 14px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    background: rgba(0, 200, 83, 0.2);
    color: var(--accent-green);
}

.chart-price-change.negative {
    background: rgba(255, 23, 68, 0.2);
    color: var(--accent-red);
}

.chart-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.timeframe-selector,
.chart-type-selector {
    display: flex;
    gap: 6px;
    background: var(--bg-primary);
    padding: 6px;
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
}

.tf-btn,
.chart-type-btn {
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 40px;
    text-align: center;
}

.tf-btn:hover,
.chart-type-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.tf-btn.active,
.chart-type-btn.active {
    background: var(--accent-blue);
    color: white;
}

.chart-container {
    height: 550px;
    min-height: 450px;
    background: #0a0e14;
    position: relative;
}

.chart-indicators {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    flex-wrap: wrap;
    gap: 12px;
}

.indicator-toggle {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.indicator-toggle label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 6px 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.indicator-toggle label:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.indicator-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-blue);
}

.chart-legend {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.legend-item {
    font-size: 13px;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
    padding: 4px 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
}

.legend-item.ema {
    color: var(--accent-blue);
}

/* Chart Signal Display */
.chart-signal-display {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
}

.chart-signal-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
}

.chart-signal-badge.buy {
    background: rgba(0, 200, 83, 0.2);
    color: var(--buy-color);
    border: 2px solid var(--buy-color);
}

.chart-signal-badge.sell {
    background: rgba(255, 23, 68, 0.2);
    color: var(--sell-color);
    border: 2px solid var(--sell-color);
}

.chart-signal-badge.hold {
    background: rgba(255, 193, 7, 0.15);
    color: var(--hold-color);
    border: 1px solid var(--hold-color);
}

.signal-arrow {
    font-size: 16px;
}

.chart-entry-info {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

.entry-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'Courier New', monospace;
}

.entry-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.entry-dot.entry {
    background: var(--accent-blue);
}

.entry-dot.tp {
    background: var(--accent-green);
}

.entry-dot.sl {
    background: var(--accent-red);
}

/* Chart loading state */
.chart-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
}

.chart-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .chart-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .chart-pair-info {
        width: 100%;
        justify-content: center;
    }
    
    .chart-controls {
        width: 100%;
        justify-content: center;
    }
    
    .chart-container {
        height: 400px;
    }
    
    .chart-indicators {
        flex-direction: column;
        gap: 12px;
    }
    
    .tf-btn,
    .chart-type-btn {
        padding: 8px 10px;
        font-size: 11px;
    }
}

/* ===== Quick Actions Bar ===== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.action-btn.buy-action {
    border-color: rgba(0, 200, 83, 0.3);
    background: rgba(0, 200, 83, 0.1);
}

.action-btn.buy-action:hover {
    background: rgba(0, 200, 83, 0.2);
    border-color: var(--buy-color);
}

.action-btn.sell-action {
    border-color: rgba(255, 23, 68, 0.3);
    background: rgba(255, 23, 68, 0.1);
}

.action-btn.sell-action:hover {
    background: rgba(255, 23, 68, 0.2);
    border-color: var(--sell-color);
}

.action-btn.calc-action {
    border-color: rgba(88, 166, 255, 0.3);
    background: rgba(88, 166, 255, 0.1);
}

.action-btn.calc-action:hover {
    background: rgba(88, 166, 255, 0.2);
    border-color: var(--accent-blue);
}

.action-btn.risk-action {
    border-color: rgba(163, 113, 247, 0.3);
    background: rgba(163, 113, 247, 0.1);
}

.action-btn.risk-action:hover {
    background: rgba(163, 113, 247, 0.2);
    border-color: var(--accent-purple);
}

.action-icon {
    font-size: 24px;
}

.action-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ===== Performance Stats ===== */
.performance-section {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.performance-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.perf-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.perf-card.win .perf-value {
    color: var(--accent-green);
}

.perf-card.loss .perf-value {
    color: var(--accent-red);
}

.perf-card.profit .perf-value {
    color: var(--accent-blue);
}

.perf-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.perf-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reset-stats-btn {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.reset-stats-btn:hover {
    background: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
}

/* Performance Chart */
.perf-chart {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 16px;
    border: 1px solid var(--border-color);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.chart-header span {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.chart-legend {
    display: flex;
    gap: 16px;
    font-size: 12px;
}

.legend-win {
    color: var(--accent-green);
}

.legend-loss {
    color: var(--accent-red);
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 60px;
}

.chart-bar {
    flex: 1;
    min-width: 8px;
    max-width: 20px;
    border-radius: 3px 3px 0 0;
    transition: all 0.3s;
}

.chart-bar.win {
    background: linear-gradient(180deg, var(--accent-green), rgba(0, 200, 83, 0.5));
}

.chart-bar.loss {
    background: linear-gradient(180deg, var(--accent-red), rgba(255, 23, 68, 0.5));
}

.chart-bar:hover {
    opacity: 0.8;
    transform: scaleY(1.1);
    transform-origin: bottom;
}

@media (max-width: 768px) {
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .performance-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .performance-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Trading Mode Styles ===== */
.trade-mode-section {
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    background: var(--bg-tertiary);
}

.mode-info {
    margin-top: 16px;
}

.mode-desc {
    display: none;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--border-color);
}

.mode-desc.active {
    display: block;
}

.mode-desc h4 {
    margin: 8px 0 12px;
    color: var(--text-primary);
    font-size: 18px;
}

.mode-desc p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.mode-desc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mode-desc ul li {
    padding: 6px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.mode-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.mode-badge.safe {
    background: rgba(0, 200, 83, 0.2);
    color: var(--accent-green);
    border: 1px solid var(--accent-green);
}

.mode-badge.balanced {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid #ffc107;
}

.mode-badge.risky {
    background: rgba(255, 23, 68, 0.2);
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
}

.manual-desc {
    border-left-color: var(--accent-green);
}

.semi-desc {
    border-left-color: #ffc107;
}

.auto-desc {
    border-left-color: var(--accent-red);
}

.risk-warning {
    margin-top: 16px;
    padding: 12px;
    background: rgba(255, 23, 68, 0.1);
    border: 1px solid var(--accent-red);
    border-radius: var(--radius-sm);
    color: var(--accent-red);
    font-size: 13px;
    line-height: 1.5;
}

.risk-warning .warning-icon {
    font-size: 16px;
    margin-right: 6px;
}

/* Auto Trade Settings */
.auto-settings {
    border: 2px solid var(--accent-red);
    border-radius: var(--radius);
    padding: 20px;
    background: rgba(255, 23, 68, 0.05);
}

.auto-setting-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.auto-setting-row span:first-child {
    flex: 1;
    min-width: 150px;
    color: var(--text-primary);
    font-size: 14px;
}

.auto-setting-row input[type="number"] {
    width: 100px;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
}

.auto-setting-row .setting-hint {
    flex-basis: 100%;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.auto-confirm {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 20px;
    padding: 16px;
    background: rgba(255, 23, 68, 0.1);
    border-radius: var(--radius-sm);
}

.auto-confirm input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--accent-red);
}

.auto-confirm label {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
}

/* Trade Status Indicator */
.trade-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
}

.trade-status.manual {
    background: rgba(0, 200, 83, 0.1);
    color: var(--accent-green);
}

.trade-status.semi-auto {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.trade-status.auto {
    background: rgba(255, 23, 68, 0.1);
    color: var(--accent-red);
}

.trade-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

/* ===== AI Chatbot ===== */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 25px rgba(99, 102, 241, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

.chat-icon {
    font-size: 28px;
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    background: var(--accent-red);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.chat-badge.hidden {
    display: none;
}

.chatbot-window {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 380px;
    height: 520px;
    background: var(--bg-primary);
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.chatbot-window.open {
    display: flex;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-lang-selector {
    display: flex;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.chat-lang-btn {
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-lang-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.chat-lang-btn.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-color: #6366f1;
    color: white;
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bot-avatar {
    font-size: 28px;
}

.chatbot-title h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.bot-status {
    font-size: 12px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 5px;
}

.bot-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
}

.close-chat {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.close-chat:hover {
    background: rgba(255,255,255,0.3);
}

.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bot-message, .user-message {
    display: flex;
    gap: 10px;
    max-width: 90%;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.bot-message .msg-avatar {
    background: rgba(99, 102, 241, 0.2);
}

.user-message .msg-avatar {
    background: rgba(16, 185, 129, 0.2);
}

.msg-content {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.bot-message .msg-content {
    background: var(--bg-secondary);
    border-bottom-left-radius: 4px;
}

.user-message .msg-content {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border-bottom-right-radius: 4px;
}

.msg-content p {
    margin: 0 0 10px;
}

.msg-content p:last-child {
    margin-bottom: 0;
}

.msg-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.msg-content li {
    margin-bottom: 5px;
}

.quick-replies {
    padding: 10px 20px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    border-top: 1px solid var(--border-color);
}

.quick-reply {
    padding: 8px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-reply:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.chatbot-input {
    padding: 16px 20px;
    display: flex;
    gap: 10px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.chatbot-input input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    color: var(--text-primary);
    font-size: 14px;
}

.chatbot-input input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.chatbot-input button {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s;
}

.chatbot-input button:hover {
    transform: scale(1.1);
}

/* User Menu */
.user-menu {
    position: absolute;
    top: 10px;
    right: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100;
    transition: opacity 0.3s, transform 0.3s;
}

.user-menu.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.subscription-badge {
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-blue);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.subscription-badge.pro {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

.subscription-badge.expired {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

.subscription-badge.expiring {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    animation: pulse-warning 1.5s infinite;
}

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

.logout-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

@media (max-width: 768px) {
    /* Chatbot mobile fixes */
    .chatbot-container {
        bottom: 15px;
        right: 15px;
        z-index: 9999;
    }
    
    .chat-badge {
        width: 55px;
        height: 55px;
        font-size: 24px;
    }
    
    .chatbot-window {
        width: calc(100vw - 20px);
        max-width: 380px;
        height: 70vh;
        max-height: 500px;
        bottom: 70px;
        right: 0;
    }
    
    .chatbot-window.open {
        display: flex !important;
    }
    
    /* User menu mobile - inside header */
    .user-menu {
        position: relative;
        top: auto;
        right: auto;
        padding: 8px 12px;
        gap: 8px;
        font-size: 12px;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
    }
    
    .user-name {
        font-size: 12px;
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .subscription-badge {
        font-size: 10px;
        padding: 3px 8px;
    }
    
    #logoutBtn {
        padding: 6px 10px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .chatbot-window {
        width: 100%;
        height: 100%;
        max-height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
        position: fixed;
    }
    
    .chatbot-container {
        bottom: 10px;
        right: 10px;
    }
    
    .user-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ===== Enhanced Mobile Responsive ===== */
@media (max-width: 768px) {
    /* App Container */
    .app-container {
        flex-direction: column;
    }
    
    /* Header adjustments */
    .app-header {
        padding: 12px 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .header-title {
        font-size: 14px;
        order: 1;
        width: 100%;
        text-align: center;
    }
    
    .header-info {
        font-size: 11px;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    /* Main Content */
    .main-content {
        padding: 12px;
        gap: 15px;
    }
    
    /* Signal card mobile */
    .signal-grid {
        grid-template-columns: 1fr;
    }
    
    .signal-card {
        padding: 15px;
    }
    
    /* Chart container mobile */
    .chart-container {
        height: 300px;
        min-height: 250px;
    }
    
    .chart-controls {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
    }
    
    .chart-controls label {
        font-size: 12px;
    }
    
    .chart-controls select {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    /* Pair list mobile */
    .pair-list {
        max-height: 200px;
    }
    
    .pair-item {
        padding: 10px;
    }
    
    .pair-item .pair-name {
        font-size: 13px;
    }
    
    /* Modal mobile - full screen */
    .modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 5vh auto;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    /* Settings grid mobile */
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    /* Quick actions mobile */
    .quick-actions {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .quick-action-btn {
        padding: 12px;
        font-size: 12px;
    }
    
    /* Buttons mobile */
    .btn-primary, .btn-secondary {
        padding: 12px 20px;
        font-size: 14px;
        width: 100%;
    }
    
    /* Info panels mobile */
    .info-panel {
        padding: 12px;
    }
    
    /* Results section mobile */
    .result-box {
        padding: 15px;
    }
    
    /* Multi-pair grid mobile */
    .multi-pair-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .app-header {
        padding: 10px;
    }
    
    .header-title {
        font-size: 12px;
    }
    
    .main-content {
        padding: 10px;
        gap: 10px;
    }
    
    .signal-card {
        padding: 12px;
    }
    
    .signal-direction {
        font-size: 24px;
    }
    
    .chart-container {
        height: 250px;
        min-height: 200px;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    /* Modal full screen on very small devices */
    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100%;
        margin: 0;
        border-radius: 0;
    }
    
    /* Touch-friendly buttons */
    button, .btn-primary, .btn-secondary, .pricing-btn {
        min-height: 44px;
        font-size: 14px;
    }
    
    /* Pair list touch-friendly */
    .pair-item {
        min-height: 50px;
        padding: 12px;
    }
    
    /* Form inputs touch-friendly */
    input, select, textarea {
        min-height: 44px;
        font-size: 16px;
    }
    
    /* Checkbox touch-friendly */
    input[type="checkbox"] {
        width: 24px;
        height: 24px;
    }
}

/* Safe area for notched phones */
@supports (padding: max(0px)) {
    .app-container {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }
    
    .sidebar {
        padding-top: max(20px, env(safe-area-inset-top));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* Landscape mode adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .chart-container {
        height: 200px;
    }
    
    .modal-content {
        max-height: 95vh;
    }
}
