/* ============================================================
   StarkTrade 5.0K - TRUE BLACK MODE (Strategy View)
   Optimizado para alto rendimiento y estética militar.
   ============================================================ */

:root {
    --bg-pure: #0a0a0a;
    --bg-panel: #111111;
    --bg-input: #161616;
    --neon-cyan: #00f2ff;
    --matrix-green: #00ff41;
}

#strategy-card { background-color: var(--bg-pure); padding-bottom: 28px; }

.strategy-status {
    font-size: 0.72rem; padding: 8px 12px; border: 1px solid var(--border);
    border-left: 3px solid var(--accent-neon); border-radius: 3px;
    margin-bottom: 18px; color: var(--text-secondary); background: rgba(255,255,255,0.02);
}
.strategy-status.ok      { border-left-color: var(--matrix-green); color: var(--text-primary); }
.strategy-status.warn    { border-left-color: #ffb43d; color: #ffd9a3; }
.strategy-status.err     { border-left-color: var(--accent-red); color: #ffb3b3; }

/* Profile Bar & Presets */
.profile-bar {
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
    padding: 10px 12px; margin-bottom: 18px; border: 1px solid var(--border);
    border-left: 3px solid var(--neon-cyan); border-radius: 3px;
    background: rgba(0,242,255,0.05); position: relative; z-index: 10;
}
.profile-bar-label { font-size: 0.55rem; letter-spacing: 2px; color: var(--text-secondary); text-transform: uppercase; }
.profile-bar-select, .profile-bar-input {
    flex: 1 1 140px; background: var(--bg-input); color: var(--matrix-green);
    border: 1px solid var(--border); border-radius: 2px; padding: 6px 8px; font-size: 0.7rem;
}
.profile-bar-select:focus, .profile-bar-input:focus { outline: none; border-color: var(--neon-cyan); box-shadow: 0 0 10px var(--neon-cyan); }

.profile-btn {
    background: transparent; color: var(--matrix-green); border: 1px solid rgba(0,255,65,0.3);
    border-radius: 2px; padding: 6px 12px; font-size: 0.62rem; cursor: pointer; transition: all 0.2s;
}
.profile-btn:hover:not(:disabled) { background: rgba(0,255,65,0.1); box-shadow: 0 0 12px var(--matrix-green); }
.profile-btn-danger { color: var(--accent-red); border-color: rgba(255,62,62,0.4); }
.profile-btn-danger:hover { background: rgba(255,62,62,0.1); box-shadow: 0 0 12px var(--accent-red); }

.profile-btn-update { color: var(--neon-cyan); border-color: rgba(0,242,255,0.4); font-size: 0.95rem; }
.profile-btn-update:hover:not(:disabled) {
    background: rgba(0,242,255,0.15);
    box-shadow: 0 0 20px var(--neon-cyan);
    color: #fff;
}

/* Strategy Blocks */
.strategy-form { display: flex; flex-direction: column; gap: 18px; }
.strategy-block {
    border: 1px solid var(--neon-cyan); border-radius: 4px; padding: 18px 20px 22px;
    background: var(--bg-panel); box-shadow: 0 0 15px rgba(0, 242, 255, 0.1); position: relative;
}
.context-help {
    font-size: 0.62rem; color: var(--matrix-green); opacity: 0.7; margin: -10px 0 14px;
    font-family: monospace; letter-spacing: 0.5px;
}
.strategy-block legend {
    padding: 4px 10px; font-size: 0.7rem; letter-spacing: 2px; color: var(--neon-cyan);
    border: 1px solid var(--neon-cyan); border-radius: 3px; background: var(--bg-pure); text-transform: uppercase;
}

.strategy-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 20px; }
@media (max-width: 900px) { .strategy-grid-2 { grid-template-columns: 1fr; } }

.sf-field { display: flex; flex-direction: column; gap: 6px; font-size: 0.68rem; color: var(--text-secondary); }
.sf-field > span:first-child { font-weight: 700; color: var(--text-primary); text-transform: uppercase; font-size: 0.6rem; letter-spacing: 1px; }

.sf-field input, .sf-field select, .sf-field textarea {
    background: var(--bg-input); border: 1px solid #333; color: var(--matrix-green);
    font: inherit; font-size: 0.78rem; padding: 8px 10px; border-radius: 3px;
    transition: all 0.2s;
}
.sf-field input:focus, .sf-field select:focus, .sf-field textarea:focus {
    outline: none; border-color: var(--matrix-green); box-shadow: 0 0 10px rgba(0,255,65,0.25);
}
.sf-field textarea { resize: vertical; min-height: 80px; }

/* Tooltips Bloomberg Style */
[data-tooltip] { position: relative; cursor: help; }
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%);
    background: #000; border: 1px solid var(--neon-cyan); color: var(--matrix-green);
    padding: 6px 10px; font-size: 0.65rem; line-height: 1.3; white-space: pre-wrap;
    width: 200px; visibility: hidden; opacity: 0; transition: 0.2s; z-index: 999;
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.3); pointer-events: none;
}
[data-tooltip]:hover::after { visibility: visible; opacity: 1; bottom: 110%; }

/* Sliders & Toggles */
.sf-range input[type="range"] { appearance: none; background: #222; height: 5px; border-radius: 3px; }
.sf-range input[type="range"]::-webkit-slider-thumb {
    appearance: none; width: 16px; height: 16px; background: var(--neon-cyan);
    border-radius: 50%; box-shadow: 0 0 10px var(--neon-cyan); cursor: pointer;
}
.sf-range input[type="range"]::-moz-range-thumb {
    width: 16px; height: 16px; background: var(--neon-cyan); border-radius: 50%;
    box-shadow: 0 0 10px var(--neon-cyan); cursor: pointer; border: none;
}

.sf-toggle {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(255,255,255,0.01); border: 1px solid #333; border-radius: 3px; padding: 10px 14px;
}
.sf-switch { width: 36px; height: 18px; background: #2a2a2f; border-radius: 12px; position: relative; transition: 0.2s; }
.sf-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: #666; border-radius: 50%; transition: 0.2s; }
.sf-toggle input:checked ~ .sf-switch { background: rgba(0,255,65,0.2); }
.sf-toggle input:checked ~ .sf-switch::after { left: 20px; background: var(--matrix-green); box-shadow: 0 0 8px var(--matrix-green); }

/* Kill Switch (Special Red Panel) */
.kill-switch {
    display: flex; justify-content: space-between; align-items: center; padding: 14px 18px;
    background: rgba(255,62,62,0.04); border: 1px solid var(--accent-red); border-radius: 4px; margin-bottom: 16px;
}
.kill-switch .ks-title { font-size: 0.78rem; letter-spacing: 2px; color: var(--accent-red); font-weight: 700; text-transform: uppercase; }
.kill-switch .ks-desc { font-size: 0.65rem; color: var(--text-secondary); }

.btn-update-protocol {
    background: transparent; border: 1px solid var(--neon-cyan); color: var(--neon-cyan);
    font-size: 0.74rem; letter-spacing: 2px; padding: 10px 24px; cursor: pointer;
    transition: 0.2s; border-radius: 3px; font-weight: 700; text-transform: uppercase;
}
.btn-update-protocol:hover:not(:disabled) { background: rgba(0,242,255,0.1); box-shadow: 0 0 25px rgba(0,242,255,0.4); }

/* AI Thoughts Stream (Ventana de Pensamiento) */
.ats {
    margin-top: 18px; background: var(--bg-panel);
    border: 1px solid var(--neon-cyan); border-radius: 4px;
    box-shadow: 0 0 15px rgba(0,242,255,0.08); overflow: hidden;
}
.ats-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 14px; background: rgba(0,242,255,0.04);
    border-bottom: 1px solid rgba(0,242,255,0.2);
}
.ats-title { font-size: 0.7rem; letter-spacing: 2px; color: var(--neon-cyan); text-transform: uppercase; font-weight: 700; }
.ats-led { width: 8px; height: 8px; border-radius: 50%; background: #444; transition: all 0.3s; }
.ats-led.ok { background: var(--matrix-green); box-shadow: 0 0 8px var(--matrix-green); animation: ats-pulse 2.4s ease-in-out infinite; }
@keyframes ats-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

.ats-list {
    max-height: 320px; overflow-y: auto; padding: 6px 12px;
    font-family: 'Consolas','Courier New',monospace;
    scrollbar-width: thin; scrollbar-color: rgba(0,242,255,0.4) var(--bg-input);
}
.ats-list::-webkit-scrollbar { width: 6px; }
.ats-list::-webkit-scrollbar-track { background: var(--bg-input); }
.ats-list::-webkit-scrollbar-thumb { background: rgba(0,242,255,0.4); border-radius: 3px; }

.ats-empty { padding: 14px; text-align: center; color: var(--text-secondary); font-size: 0.65rem; letter-spacing: 1px; }
.ats-empty.ats-empty-err {
    color: var(--accent-red, #ff4d4d);
    border-top: 1px solid rgba(255,77,77,0.25);
    background: rgba(255,77,77,0.04);
}
.ats-item {
    padding: 8px 10px; margin: 6px 0;
    border-left: 2px solid rgba(0,255,65,0.35); background: rgba(0,255,65,0.02);
    border-radius: 2px; transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
}
.ats-meta { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.6rem; color: var(--text-secondary); letter-spacing: 1px; margin-bottom: 4px; }
.ats-ts { color: var(--neon-cyan); }
.ats-pair { color: var(--matrix-green); font-weight: 700; }
.ats-body { font-size: 0.72rem; line-height: 1.45; color: var(--matrix-green); white-space: pre-wrap; word-break: break-word; }

.ats-flash {
    border-left-color: var(--matrix-green) !important;
    background: rgba(0,255,65,0.14) !important;
    box-shadow: 0 0 16px rgba(0,255,65,0.55);
    animation: ats-blink 1.4s ease-out;
}
@keyframes ats-blink {
    0%   { background: rgba(0,255,65,0.4);  box-shadow: 0 0 28px rgba(0,255,65,0.9); }
    100% { background: rgba(0,255,65,0.02); box-shadow: 0 0 0    rgba(0,255,65,0);   }
}

/* BOT PULSE (Parche F) — narracion del ciclo IA en tiempo real */
.ps {
    margin-top: 18px; background: var(--bg-panel);
    border: 1px solid var(--neon-cyan); border-radius: 4px;
    box-shadow: 0 0 15px rgba(0,242,255,0.08); overflow: hidden;
}
.ps-list {
    max-height: 260px; overflow-y: auto; padding: 4px 10px;
    font-family: 'Consolas','Courier New',monospace;
    scrollbar-width: thin; scrollbar-color: rgba(0,242,255,0.4) var(--bg-input);
}
.ps-list::-webkit-scrollbar { width: 6px; }
.ps-list::-webkit-scrollbar-track { background: var(--bg-input); }
.ps-list::-webkit-scrollbar-thumb { background: rgba(0,242,255,0.4); border-radius: 3px; }

.ps-item {
    display: grid; grid-template-columns: 70px 160px 1fr; gap: 8px;
    align-items: baseline; padding: 4px 8px; margin: 2px 0;
    font-size: 0.7rem; line-height: 1.35;
    border-left: 2px solid transparent;
    transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
}
.ps-ts    { color: var(--neon-cyan); font-size: 0.65rem; }
.ps-step  { color: var(--text-secondary); font-weight: 700; letter-spacing: 1px; font-size: 0.62rem; text-transform: uppercase; }
.ps-label { color: var(--text-primary); word-break: break-word; }

.ps-info  { border-left-color: rgba(0,255,65,0.4); }
.ps-info  .ps-label { color: var(--matrix-green); }
.ps-warn  { border-left-color: #ffb84d; background: rgba(255,184,77,0.04); }
.ps-warn  .ps-label { color: #ffb84d; }
.ps-error { border-left-color: var(--accent-red, #ff4d4d); background: rgba(255,77,77,0.06); }
.ps-error .ps-label { color: var(--accent-red, #ff4d4d); }

.ps-cycle-mark { border-top: 1px dashed rgba(0,242,255,0.25); margin-top: 8px; padding-top: 6px; }

.ps-flash {
    background: rgba(0,255,65,0.18) !important;
    box-shadow: 0 0 12px rgba(0,255,65,0.45);
    animation: ps-blink 1.2s ease-out;
}
@keyframes ps-blink {
    0%   { background: rgba(0,255,65,0.35); }
    100% { background: rgba(0,255,65,0.02); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .profile-bar { flex-direction: column; align-items: stretch; }
    .kill-switch { flex-direction: column; text-align: center; gap: 12px; }
    .btn-update-protocol { width: 100%; }
    .sf-field input, .sf-field select, .sf-field textarea { font-size: 0.85rem; padding: 10px; }
    .ats-list { max-height: 240px; }
    .ps-list  { max-height: 200px; }
    .ps-item  { grid-template-columns: 60px 110px 1fr; font-size: 0.65rem; }
}
