* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: radial-gradient(circle at center, #001122 0%, #000000 100%);
    overflow: hidden;
    font-family: 'Courier New', monospace;
}

canvas {
    display: block;
}

#tooltip {
    position: fixed;
    background: linear-gradient(45deg, rgba(0,255,255,0.9), rgba(0,200,255,0.9));
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    pointer-events: none;
    z-index: 1000;
    display: none;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 20px rgba(0,255,255,0.3);
    backdrop-filter: blur(10px);
    max-width: 250px;
}

#title {
    position: fixed;
    top: 20px;
    right: 20px;
    color: #00ffff;
    font-size: 24px;
    font-weight: bold;
    z-index: 1000;
    text-shadow: 0 0 10px #00ffff;
}

#dataPanel {
    position: fixed;
    bottom: 20px;
    left: 20px;
    color: #00ffff;
    font-size: 11px;
    z-index: 1000;
    background: rgba(0,0,0,0.8);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(0,255,255,0.3);
    min-width: 300px;
}

#marketHealth {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #00ffff;
    font-size: 18px;
    font-weight: bold;
    z-index: 1000;
    background: rgba(0,0,0,0.8);
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid rgba(0,255,255,0.3);
    text-align: center;
}

#stockPanel {
    position: fixed;
    right: -350px;
    top: 0;
    width: 350px;
    height: 100vh;
    background: rgba(0,0,0,0.95);
    color: #00ffff;
    z-index: 2000;
    padding: 20px;
    border-left: 2px solid rgba(0,255,255,0.5);
    backdrop-filter: blur(15px);
    transition: right 0.4s ease-in-out;
    overflow-y: auto;
}

#stockPanel.open {
    right: 0;
}

#togglePanel {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(45deg, rgba(0,255,255,0.8), rgba(0,150,255,0.8));
    color: white;
    border: none;
    padding: 15px 8px;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    z-index: 2001;
    font-size: 14px;
    font-weight: bold;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transition: all 0.3s ease;
}

#togglePanel:hover {
    background: linear-gradient(45deg, rgba(0,255,255,1), rgba(0,150,255,1));
    transform: translateY(-50%) translateX(-5px);
}

#stockPanel.open + #togglePanel {
    right: 370px;
    border-radius: 0 8px 8px 0;
}

.stock-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    margin: 8px 0;
    background: rgba(0,255,255,0.1);
    border-radius: 6px;
    border: 1px solid rgba(0,255,255,0.3);
    transition: all 0.3s ease;
}

.stock-item:hover {
    background: rgba(0,255,255,0.2);
    transform: translateX(5px);
}

.stock-item.active {
    background: rgba(0,255,100,0.2);
    border-color: rgba(0,255,100,0.5);
}

.stock-toggle {
    width: 20px;
    height: 20px;
    border: 2px solid #00ffff;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.stock-toggle.checked {
    background: #00ff44;
    border-color: #00ff44;
}

.stock-toggle.checked::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 2px;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.add-stock-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(0,255,255,0.3);
}

.add-stock-input {
    width: 100%;
    padding: 10px;
    background: rgba(0,255,255,0.1);
    border: 1px solid rgba(0,255,255,0.5);
    border-radius: 4px;
    color: #00ffff;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    margin: 10px 0;
}

.add-stock-input::placeholder {
    color: rgba(0,255,255,0.6);
}

.add-stock-btn {
    background: linear-gradient(45deg, rgba(0,255,100,0.8), rgba(0,200,150,0.8));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    width: 100%;
}

.add-stock-btn:hover {
    background: linear-gradient(45deg, rgba(0,255,100,1), rgba(0,200,150,1));
    transform: translateY(-2px);
}

.stock-info {
    font-size: 12px;
    color: rgba(0,255,255,0.8);
}

.panel-header {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
}

#dataPanel {
    position: fixed;
    bottom: 20px;
    left: -320px; /* hidden by default */
    color: #00ffff;
    font-size: 11px;
    z-index: 1000;
    background: rgba(0,0,0,0.8);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(0,255,255,0.3);
    min-width: 300px;
    max-height: 250px;
    overflow-y: auto;
    transition: left 0.4s ease-in-out;
}

#dataPanel.open {
    left: 20px; /* slides into view */
}

#toggleDataPanel {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: linear-gradient(45deg, rgba(0,255,255,0.8), rgba(0,150,255,0.8));
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 4px;
    cursor: pointer;
    z-index: 2001;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
}

#toggleDataPanel:hover {
    background: linear-gradient(45deg, rgba(0,255,255,1), rgba(0,150,255,1));
    transform: translateX(3px);
}

/* Push button aside when panel is open */
#dataPanel.open + #toggleDataPanel {
    left: 340px;
}


.section-title {
    font-size: 14px;
    font-weight: bold;
    margin: 15px 0 10px 0;
    color: #00ff44;
}

.sentiment-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
}

.positive { background: #00ff44; }
.negative { background: #ff4400; }
.neutral { background: #ffaa00; }

.data-row {
    margin: 4px 0;
    display: flex;
    justify-content: space-between;
}

.pulse {
    animation: pulse 2s infinite;
}

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

#helpBox {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 220px;
    background: rgba(0,0,0,0.85);
    color: #00ffff;
    font-size: 12px;
    z-index: 1500;
    border: 1px solid rgba(0,255,255,0.3);
    border-radius: 8px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

#helpHeader {
    padding: 10px;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    background: rgba(0,255,255,0.1);
    border-bottom: 1px solid rgba(0,255,255,0.3);
    user-select: none;
}

#helpContent {
    padding: 10px;
    line-height: 1.4em;
}

/* collapsed state */
#helpBox.collapsed {
    max-height: 30px;
    opacity: 0.8;
}

#helpBox.collapsed #helpContent {
    display: none;
}
