:root {
    --primary-glow: #8b5cf6;
    --accent-gold: #fbbf24;
    --success-green: #10b981;
    --danger-red: #ef4444;
    --info-blue: #06b6d4;
    --panel-bg: rgba(0, 0, 0, 0.6);
    --border-glow: rgba(139, 92, 246, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #050714;
    font-family: 'Orbitron', sans-serif;
    color: #e2e8f0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
}

#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.12;
    pointer-events: none;
}

.dashboard {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 12px;
    max-width: 1600px;
    margin: 0 auto;
    gap: 12px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: var(--panel-bg);
    border-radius: 15px;
    border: 1px solid var(--border-glow);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 10px;
}

.logo-section a {
    text-decoration: none;
}

.logo-section h1 {
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-gold), var(--primary-glow));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.logo-section p {
    font-size: 0.55rem;
    color: var(--primary-glow);
    letter-spacing: 2px;
}

.status-section {
    display: flex;
    gap: 12px;
    align-items: center;
}

.live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.6rem;
    padding: 5px 12px;
    background: rgba(0,0,0,0.4);
    border-radius: 20px;
    border: 1px solid var(--success-green);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--success-green);
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.time-display {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    color: var(--accent-gold);
}

.grid-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.grid-stat-card {
    background: var(--panel-bg);
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    border: 1px solid var(--border-glow);
}

.grid-stat-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--accent-gold);
}

.grid-stat-label {
    font-size: 0.55rem;
    color: #94a3b8;
    margin-top: 4px;
}

.main-content {
    display: flex;
    gap: 12px;
    flex: 1;
    min-height: 0;
}

.panel {
    background: var(--panel-bg);
    border-radius: 20px;
    border: 1px solid var(--border-glow);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.scroll-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.left-panel { flex: 1.2; }
.right-panel { flex: 0.8; }

.card {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    border: 1px solid rgba(139, 92, 246, 0.15);
    padding: 12px;
}

.gauge-container {
    text-align: center;
    border: 1px solid rgba(251, 191, 36, 0.2);
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.1) 0%, transparent 100%);
}

.price-gauge {
    font-size: 2.2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-gold), #fff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 5px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.stat-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 5px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-gold);
    font-family: 'Share Tech Mono', monospace;
}

.stat-label {
    font-size: 0.5rem;
    color: #94a3b8;
    letter-spacing: 1px;
    margin-top: 4px;
}

.signal-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
}

.signal-light {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 10px;
}

.signal-light.buy { background: radial-gradient(circle, #10b981, #064e3b); box-shadow: 0 0 30px rgba(16,185,129,0.4); animation: pulse-green 1s infinite; }
.signal-light.sell { background: radial-gradient(circle, #ef4444, #7f1d1d); box-shadow: 0 0 30px rgba(239,68,68,0.4); animation: pulse-red 1s infinite; }
.signal-light.neutral { background: radial-gradient(circle, #fbbf24, #92400e); box-shadow: 0 0 30px rgba(251,191,36,0.3); }

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 20px rgba(16,185,129,0.4); }
    50% { box-shadow: 0 0 50px rgba(16,185,129,0.8); }
}
@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 20px rgba(239,68,68,0.4); }
    50% { box-shadow: 0 0 50px rgba(239,68,68,0.8); }
}

.confidence-container { width: 100%; max-width: 250px; margin-top: 10px; }
.progress-bg { height: 6px; background: #1e293b; border-radius: 10px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary-glow), var(--accent-gold)); transition: width 0.5s; }

.bottom-panel {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 10px;
    background: var(--panel-bg);
    border-radius: 15px;
    border: 1px solid var(--border-glow);
    flex-shrink: 0;
}

.control-btn {
    background: linear-gradient(135deg, var(--primary-glow), #6d28d9);
    border: none;
    padding: 6px 16px;
    border-radius: 30px;
    color: white;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    cursor: pointer;
}

.control-btn.stop { background: linear-gradient(135deg, var(--danger-red), #b91c1c); }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: var(--primary-glow); border-radius: 10px; }

@media (max-width: 1024px) {
    .main-content { flex-direction: column; overflow-y: auto; }
    body { overflow-y: auto; height: auto; min-height: 100vh; }
    .dashboard { height: auto; }
    .grid-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .header { flex-direction: column; text-align: center; }
    .status-section { width: 100%; justify-content: center; }
    .bottom-panel { grid-template-columns: repeat(2, 1fr); }
}


/* ============================================
   AI LEARNING DASHBOARD - COLLAPSIBLE SECTION
   ============================================ */

.ai-learning-section {
    margin: 20px 15px;
    background: linear-gradient(135deg, rgba(15, 25, 35, 0.95) 0%, rgba(10, 20, 30, 0.95) 100%);
    border-radius: 16px;
    border: 1px solid rgba(0, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    overflow: hidden;
    transition: all 0.3s ease;
}

.ai-learning-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(0, 200, 255, 0.1) 0%, rgba(0, 100, 150, 0.05) 100%);
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
    transition: all 0.2s ease;
}

.ai-learning-header:hover {
    background: linear-gradient(135deg, rgba(0, 200, 255, 0.15) 0%, rgba(0, 100, 150, 0.1) 100%);
}

.ai-learning-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ai-learning-title i {
    font-size: 1.5rem;
    color: #00d4ff;
    animation: learningPulse 2s infinite;
}

.ai-learning-title h3 {
    margin: 0;
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #00d4ff, #00ff88);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.ai-learning-badge {
    background: rgba(0, 212, 255, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-family: 'Share Tech Mono', monospace;
    color: #00d4ff;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.ai-learning-toggle {
    font-size: 1.2rem;
    color: #00d4ff;
    transition: transform 0.3s ease;
}

.ai-learning-toggle.collapsed {
    transform: rotate(-90deg);
}

.ai-learning-content {
    max-height: 800px;
    overflow-y: auto;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding: 20px;
}

.ai-learning-content.collapsed {
    max-height: 0;
    padding: 0 20px;
    overflow: hidden;
}

/* Learning Dashboard Inner Styles */
.learning-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.learning-card {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(0, 255, 255, 0.15);
    transition: all 0.2s ease;
}

.learning-card:hover {
    border-color: rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.1);
}

.learning-card-title {
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    color: #00d4ff;
    margin-bottom: 12px;
    letter-spacing: 1px;
    border-left: 3px solid #00d4ff;
    padding-left: 10px;
}

.param-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.param-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
    border-radius: 8px;
    text-align: center;
}

.param-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.1rem;
    font-weight: bold;
    color: #00ff88;
}

.param-label {
    font-size: 0.65rem;
    color: #8899aa;
    margin-top: 4px;
}

.learning-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.learning-stat {
    text-align: center;
}

.learning-stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #00d4ff;
}

.learning-stat-label {
    font-size: 0.6rem;
    color: #667788;
}

.chart-container {
    margin-top: 15px;
    height: 200px;
}

.learning-dashboard canvas {
    max-height: 180px;
    width: 100%;
}

.recommendation-text {
    font-size: 0.7rem;
    color: #aabbcc;
    line-height: 1.4;
    margin-top: 10px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    font-family: 'Share Tech Mono', monospace;
}

.learning-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 0.7rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00ff88;
    animation: learningPulse 1.5s infinite;
}

.status-dot.inactive {
    background: #ff4444;
    animation: none;
}

.learning-refresh-btn {
    margin-top: 12px;
    width: 100%;
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid rgba(0, 212, 255, 0.3);
    padding: 6px;
    border-radius: 6px;
    color: #00d4ff;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.learning-refresh-btn:hover {
    background: rgba(0, 212, 255, 0.3);
    border-color: rgba(0, 212, 255, 0.5);
}

@keyframes learningPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Scrollbar for learning content */
.ai-learning-content::-webkit-scrollbar {
    width: 6px;
}

.ai-learning-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.ai-learning-content::-webkit-scrollbar-thumb {
    background: #00d4ff;
    border-radius: 3px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .learning-dashboard {
        grid-template-columns: 1fr;
    }
    
    .ai-learning-content {
        padding: 15px;
    }
    
    .ai-learning-title h3 {
        font-size: 0.85rem;
    }
    
    .ai-learning-title i {
        font-size: 1.2rem;
    }
    
    .param-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   AI LEARNING MODAL POPUP STYLES
   ============================================ */

/* Modal Popup Styles */
.ai-learning-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    overflow: auto;
}

.ai-learning-modal-content {
    background: linear-gradient(135deg, rgba(15, 25, 35, 0.98) 0%, rgba(10, 20, 30, 0.98) 100%);
    margin: 2% auto;
    padding: 20px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.2);
}

.ai-learning-modal-close {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #00d4ff;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.ai-learning-modal-close:hover {
    color: #ff4444;
    transform: scale(1.1);
}

.ai-learning-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
}

.ai-learning-modal-header i {
    font-size: 1.8rem;
    color: #00d4ff;
}

.ai-learning-modal-header h2 {
    font-family: 'Orbitron', monospace;
    font-size: 1.3rem;
    margin: 0;
    background: linear-gradient(135deg, #00d4ff, #00ff88);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.ai-learning-modal-header .badge {
    background: rgba(0, 212, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    color: #00d4ff;
    margin-left: auto;
}

/* Open Modal Button */
.ai-learning-open-btn {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(0, 100, 150, 0.1));
    border: 1px solid rgba(0, 212, 255, 0.3);
    padding: 8px 16px;
    border-radius: 8px;
    color: #00d4ff;
    cursor: pointer;
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}

.ai-learning-open-btn:hover {
    background: rgba(0, 212, 255, 0.3);
    border-color: rgba(0, 212, 255, 0.6);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

/* Modal Content Styles */
.modal-learning-dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-learning-card {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 18px;
    border: 1px solid rgba(0, 255, 255, 0.15);
}

.modal-learning-card:hover {
    border-color: rgba(0, 255, 255, 0.3);
}

.modal-learning-card-title {
    font-family: 'Orbitron', monospace;
    font-size: 0.85rem;
    color: #00d4ff;
    margin-bottom: 15px;
    letter-spacing: 1px;
    border-left: 3px solid #00d4ff;
    padding-left: 12px;
}

.modal-param-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.modal-param-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

.modal-param-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.2rem;
    font-weight: bold;
    color: #00ff88;
}

.modal-param-label {
    font-size: 0.65rem;
    color: #8899aa;
    margin-top: 5px;
}

.modal-learning-stats {
    display: flex;
    justify-content: space-around;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-learning-stat {
    text-align: center;
}

.modal-learning-stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #00d4ff;
}

.modal-learning-stat-label {
    font-size: 0.6rem;
    color: #667788;
}

.modal-vol-regime-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.modal-vol-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 3px solid;
}

.modal-vol-card.low { border-left-color: #2ecc71; }
.modal-vol-card.normal { border-left-color: #3498db; }
.modal-vol-card.high { border-left-color: #e74c3c; }

.modal-vol-title {
    font-size: 0.75rem;
    font-weight: bold;
}

.modal-vol-values {
    display: flex;
    gap: 15px;
}

.modal-vol-values span {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    color: #00ff88;
}

.modal-session-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.modal-session-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 3px solid;
}

.modal-session-card.asia { border-left-color: #f1c40f; }
.modal-session-card.london { border-left-color: #2ecc71; }
.modal-session-card.ny { border-left-color: #e74c3c; }

.modal-session-title {
    font-size: 0.75rem;
    font-weight: bold;
}

.modal-session-values {
    display: flex;
    gap: 15px;
}

.modal-session-values span {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    color: #00ff88;
}

.modal-recommendation-text {
    font-size: 0.7rem;
    color: #aabbcc;
    line-height: 1.4;
    margin-top: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.modal-chart-container {
    height: 220px;
    margin-top: 10px;
}

.modal-refresh-btn {
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid rgba(0, 212, 255, 0.3);
    padding: 6px 12px;
    border-radius: 6px;
    color: #00d4ff;
    cursor: pointer;
    font-size: 0.7rem;
    margin-top: 12px;
    width: 100%;
    transition: all 0.2s ease;
}

.modal-refresh-btn:hover {
    background: rgba(0, 212, 255, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .ai-learning-modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 15px;
    }
    
    .modal-param-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .modal-vol-card, .modal-session-card {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .modal-vol-values, .modal-session-values {
        justify-content: center;
    }
    
    .ai-learning-modal-header h2 {
        font-size: 1rem;
    }
    
    .ai-learning-open-btn span {
        display: none;
    }
    
    .ai-learning-open-btn i {
        margin: 0;
    }
    
    .ai-learning-open-btn {
        padding: 8px 12px;
    }
}