/* ====================================================
   BREATHWEALTHFX CINEMATIC BATTLE ENGINE STYLESHEET
   Version 1.0 - Dark Premium Glassmorphic Aesthetics
   ==================================================== */

:root {
    --bg-dark: #07090E;
    --bg-card: rgba(15, 20, 32, 0.75);
    --border-color: rgba(255, 255, 255, 0.08);
    
    --bull-color: #00FF66;
    --bull-glow: rgba(0, 255, 102, 0.35);
    
    --bear-color: #FF2A55;
    --bear-glow: rgba(255, 42, 85, 0.35);
    
    --gold-color: #FFD700;
    --text-main: #F0F4F8;
    --text-muted: #8A99AD;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(0, 255, 102, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(255, 42, 85, 0.05) 0%, transparent 40%);
}

.app-container {
    width: 95vw;
    max-width: 1400px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 1st LAYER: Header HUD */
.hud-header {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

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

.brand-logo {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.brand-logo .highlight {
    color: var(--bull-color);
}

.version-badge {
    background: rgba(0, 255, 102, 0.1);
    color: var(--bull-color);
    border: 1px solid rgba(0, 255, 102, 0.3);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.regime-badge-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.regime-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.regime-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gold-color);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.hud-stats {
    display: flex;
    gap: 24px;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.stat-title {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.stat-value {
    font-size: 1.05rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.stat-value.gold { color: var(--gold-color); }
.stat-value.safe { color: var(--bull-color); }

/* 2nd LAYER: Dominance Gauge Bar */
.dominance-bar-container {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 20px;
}

.fighter-score {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 170px;
}

.bull-score { color: var(--bull-color); }
.bear-score { color: var(--bear-color); justify-content: flex-end; }

.gauge-track {
    flex: 1;
    height: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    position: relative;
    display: flex;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gauge-fill {
    height: 100%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.bull-fill {
    background: linear-gradient(90deg, #00B347, var(--bull-color));
    box-shadow: 0 0 12px var(--bull-glow);
}

.bear-fill {
    background: linear-gradient(90deg, var(--bear-color), #B3002D);
    box-shadow: 0 0 12px var(--bear-glow);
}

.clash-point {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
}

/* 3rd SUB-LAYER: Market Story Box */
.candle-story-box {
    background: rgba(10, 14, 24, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.story-tag {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--bull-color);
    background: rgba(0, 255, 102, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.story-text {
    font-size: 0.9rem;
    color: #D1D9E6;
    line-height: 1.4;
}

/* 3rd LAYER: Battle Canvas & Stage Area */
.battle-canvas-wrapper {
    position: relative;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(0, 255, 102, 0.15);
    min-height: 550px;
}

.status-overlay {
    position: absolute;
    top: 16px;
    left: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
    pointer-events: auto;
}

.ws-status {
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ws-status.connected {
    color: var(--bull-color);
    border-color: rgba(0, 255, 102, 0.4);
}

.control-status {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--gold-color);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* Eye View Bar (3 View Modes Selector) */
.view-mode-selector {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 10px;
    padding: 4px 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.eye-icon {
    font-size: 1rem;
    margin-right: 4px;
}

.view-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-btn.active {
    background: var(--gold-color);
    color: #000;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.view-btn:hover:not(.active) {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

#battleCanvas {
    width: 100%;
    height: 550px;
    display: block;
}

/* 4th LAYER: Controls Toolbar */
.control-toolbar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sim-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.sim-buttons {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-bull {
    background: rgba(0, 255, 102, 0.15);
    color: var(--bull-color);
    border: 1px solid rgba(0, 255, 102, 0.4);
}

.btn-bull:hover {
    background: var(--bull-color);
    color: #000;
    box-shadow: 0 0 16px var(--bull-glow);
}

.btn-bear {
    background: rgba(255, 42, 85, 0.15);
    color: var(--bear-color);
    border: 1px solid rgba(255, 42, 85, 0.4);
}

.btn-bear:hover {
    background: var(--bear-color);
    color: #FFF;
    box-shadow: 0 0 16px var(--bear-glow);
}

.btn-clash {
    background: rgba(255, 215, 0, 0.15);
    color: var(--gold-color);
    border: 1px solid rgba(255, 215, 0, 0.4);
}

.btn-clash:hover {
    background: var(--gold-color);
    color: #000;
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.4);
}

.btn-reset {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-reset:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* CHART FOCUS MODE - fight/hybrid UI hidden, not deleted */
.version-badge,
.dominance-bar-container,
.view-mode-selector,
.control-status,
.control-toolbar {
    display: none !important;
}

.app-container {
    gap: 12px;
}

.hud-header {
    border-radius: 8px;
}

.battle-canvas-wrapper {
    border-radius: 8px;
    min-height: 590px;
}

#battleCanvas {
    width: 100%;
    height: auto;
    min-height: 550px;
    display: block;
}

.status-overlay {
    justify-content: flex-start;
}

.candle-story-box {
    border-radius: 8px;
}

/* MT5 TIMEFRAME BAR */
.mt5-timeframe-bar {
    position: absolute;
    top: 3px;
    left: 5px;
    z-index: 16;
    display: flex;
    align-items: center;
    gap: 1px;
    min-height: 26px;
    padding: 1px 3px;
    background: #030303;
    border: 1px solid rgba(210, 210, 210, 0.35);
    border-radius: 0;
    box-shadow: inset 0 -1px 0 rgba(255,255,255,0.12);
    white-space: nowrap;
}

.tf-btn {
    min-width: 32px;
    height: 22px;
    border: 1px solid transparent;
    background: #050505;
    color: #c9ced8;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.tf-btn:hover {
    border-color: rgba(47, 140, 255, 0.85);
    color: #ffffff;
}

.tf-btn.active {
    border-color: #2f8cff;
    background: #0d1d31;
    color: #ffffff;
}

.battle-canvas-wrapper.chart-mode {
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: none;
}

.battle-canvas-wrapper.chart-mode .status-overlay {
    top: 34px;
}
/* MT5 MINI CHART TOOLBAR */
.mt5-toolbar-divider {
    width: 1px;
    height: 24px;
    margin: 0 3px;
    background: rgba(255, 255, 255, 0.26);
}

.mt5-chart-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
}

.mt5-tool-btn {
    position: relative;
    width: 29px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(0, 229, 255, 0.26);
    background: #050505;
    cursor: pointer;
}

.mt5-tool-btn:hover,
.mt5-tool-btn.active {
    border-color: #00e5ff;
    background: rgba(0, 229, 255, 0.14);
}

.mt5-icon {
    position: relative;
    width: 17px;
    height: 17px;
    display: block;
}

.mt5-icon-crosshair::before,
.mt5-icon-crosshair::after {
    content: '';
    position: absolute;
    background: #00ff99;
}

.mt5-icon-crosshair::before {
    left: 8px;
    top: 1px;
    width: 1px;
    height: 15px;
}

.mt5-icon-crosshair::after {
    left: 1px;
    top: 8px;
    width: 15px;
    height: 1px;
}

.mt5-icon-candles::before,
.mt5-icon-candles::after {
    content: '';
    position: absolute;
    top: 2px;
    width: 5px;
    height: 13px;
    border: 1px solid #00e5ff;
    background: rgba(0, 229, 255, 0.16);
}

.mt5-icon-candles::before { left: 2px; }
.mt5-icon-candles::after { right: 2px; }

.mt5-icon-line::before {
    content: '';
    position: absolute;
    inset: 3px 1px;
    border-left: 2px solid transparent;
    border-bottom: 2px solid #00ff99;
    transform: skew(-28deg) rotate(-12deg);
}

.mt5-icon-zoom-in::before,
.mt5-icon-zoom-out::before {
    content: '';
    position: absolute;
    left: 1px;
    top: 1px;
    width: 10px;
    height: 10px;
    border: 2px solid #2f8cff;
    border-radius: 50%;
}

.mt5-icon-zoom-in::after,
.mt5-icon-zoom-out::after {
    content: '';
    position: absolute;
    left: 11px;
    top: 12px;
    width: 7px;
    height: 2px;
    background: #2f8cff;
    transform: rotate(45deg);
    transform-origin: left center;
}

.mt5-tool-btn[data-chart-tool="zoom-in"] .mt5-icon span,
.mt5-tool-btn[data-chart-tool="zoom-out"] .mt5-icon span {
    display: none;
}

.mt5-icon-zoom-in {
    background: linear-gradient(#2f8cff, #2f8cff) center 6px / 8px 2px no-repeat,
                linear-gradient(#2f8cff, #2f8cff) 6px center / 2px 8px no-repeat;
}

.mt5-icon-zoom-out {
    background: linear-gradient(#2f8cff, #2f8cff) center 6px / 8px 2px no-repeat;
}


.mt5-icon-autoscroll::before,
.mt5-icon-chartshift::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 3px;
    width: 10px;
    height: 10px;
    border-left: 2px solid #00ff99;
    border-bottom: 2px solid #00ff99;
}

.mt5-icon-autoscroll::after {
    content: '';
    position: absolute;
    right: 1px;
    top: 5px;
    width: 7px;
    height: 7px;
    border-top: 2px solid #00e5ff;
    border-right: 2px solid #00e5ff;
    transform: rotate(45deg);
}

.mt5-icon-chartshift::after {
    content: '';
    position: absolute;
    right: 1px;
    top: 2px;
    width: 2px;
    height: 14px;
    background: #2f8cff;
    box-shadow: -5px 5px 0 -3px #00e5ff;
}
