/* 
   SMC & Money Flow Trading Bot CSS Style Suite
   Theme: High-fidelity Ultra Dark Neon Cyberpunk
*/

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-main: #06090e;
    --bg-darker: #040609;
    --bg-card: rgba(13, 17, 26, 0.7);
    --bg-card-hover: rgba(20, 26, 38, 0.85);
    --accent: #8c52ff;
    --accent-glow: rgba(140, 82, 255, 0.35);
    --accent-subtle: rgba(140, 82, 255, 0.1);
    --bullish: #00e676;
    --bullish-glow: rgba(0, 230, 118, 0.2);
    --bullish-subtle: rgba(0, 230, 118, 0.06);
    --bearish: #ff2d55;
    --bearish-glow: rgba(255, 45, 85, 0.2);
    --bearish-subtle: rgba(255, 45, 85, 0.06);
    --gold: #ffd700;
    --gold-glow: rgba(255, 215, 0, 0.15);
    
    --text-primary: #f5f6f9;
    --text-secondary: #909bb4;
    --text-muted: #5d677d;
    
    --border: rgba(255, 255, 255, 0.05);
    --border-active: rgba(140, 82, 255, 0.4);
    --border-bullish: rgba(0, 230, 118, 0.3);
    --border-bearish: rgba(255, 45, 85, 0.3);
    
    --font-ui: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --blur: blur(14px);
    --radius: 12px;
    --radius-sm: 6px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-ui);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Background Animated Gradient Overlay */
body::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -20%;
    width: 140%;
    height: 140%;
    background: radial-gradient(circle at 15% 15%, rgba(140, 82, 255, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 85% 85%, rgba(0, 230, 118, 0.03) 0%, transparent 40%),
                radial-gradient(circle at 50% 50%, rgba(255, 45, 85, 0.02) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

/* Header Component */
header {
    height: 70px;
    width: 100%;
    background: var(--bg-darker);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 10;
}

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

.logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent), var(--bullish));
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--accent-glow);
    animation: rotateGlow 8s linear infinite;
}

.logo-section h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, var(--text-primary), #d0baff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-section span {
    font-size: 11px;
    font-weight: 500;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    background: var(--accent-subtle);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(140, 82, 255, 0.2);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.market-select-wrapper {
    position: relative;
}

.market-dropdown {
    background: #111622;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.market-dropdown:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-subtle);
}

.market-ticker-stats {
    display: flex;
    align-items: center;
    gap: 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    padding: 6px 20px;
    border-radius: var(--radius-sm);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
}

.stat-value.up { color: var(--bullish); }
.stat-value.down { color: var(--bearish); }

/* Main Dashboard Workspace */
.dashboard-wrapper {
    flex: 1;
    display: flex;
    width: 100%;
    overflow: hidden;
}

/* Sidebar Styling */
aside {
    width: 320px;
    height: 100%;
    background: #080b11;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 20px;
    gap: 24px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    backdrop-filter: var(--blur);
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.08);
    background: var(--bg-card-hover);
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 8px;
}

.card-title i {
    color: var(--accent);
}

/* Form Styles */
.form-group {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.input-wrapper {
    position: relative;
    display: flex;
}

.input-wrapper i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.form-control {
    width: 100%;
    background: #0f131d;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px 8px 36px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 13px;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 8px var(--accent-subtle);
}

/* Custom Toggle Switch */
.toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #171d2b;
    transition: .3s;
    border-radius: 24px;
    border: 1px solid var(--border);
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent-subtle);
    border-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(22px);
    background-color: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

/* Button Suites */
.btn {
    width: 100%;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    outline: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    background: #9d6aff;
    box-shadow: 0 4px 20px rgba(140, 82, 255, 0.5);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--bullish);
    color: #000;
    border: none;
    box-shadow: 0 4px 15px var(--bullish-glow);
}

.btn-success:hover {
    background: #33ff99;
    box-shadow: 0 4px 20px rgba(0, 230, 118, 0.4);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--bearish);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px var(--bearish-glow);
}

.btn-danger:hover {
    background: #ff5e7e;
    box-shadow: 0 4px 20px rgba(255, 45, 85, 0.4);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Pulsing Indicators */
.pulse-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
    display: inline-block;
}

.pulse-indicator.active {
    background-color: var(--bullish);
}

.pulse-indicator.active::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: var(--bullish);
    border-radius: 50%;
    animation: pulse 1.8s infinite ease-in-out;
}

.pulse-indicator.inactive {
    background-color: var(--bearish);
}

/* Main Working Screen */
.main-screen {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 20px;
    gap: 20px;
}

/* Split Workspace layout */
.chart-container-card {
    flex: 2;
    min-height: 380px;
    width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

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

.chart-selectors {
    display: flex;
    gap: 8px;
}

.chart-btn-tf {
    background: #101520;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.chart-btn-tf.active, .chart-btn-tf:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

#tradingview-chart-box {
    flex: 1;
    width: 100%;
    min-height: 350px;
    height: 350px;
    background: #04060a;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

/* Bottom Dashboard Split */
.bottom-dock {
    flex: 1.2;
    min-height: 250px;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 20px;
    overflow: hidden;
}

.poi-dock-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tf-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    flex: 1;
    overflow-y: auto;
}

.tf-status-card {
    background: #0d111b;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
}

.tf-status-card.bullish {
    border-color: var(--border-bullish);
    background: linear-gradient(180deg, var(--bg-card) 60%, var(--bullish-subtle) 100%);
}

.tf-status-card.bearish {
    border-color: var(--border-bearish);
    background: linear-gradient(180deg, var(--bg-card) 60%, var(--bearish-subtle) 100%);
}

.tf-badge {
    font-size: 14px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
}

.tf-trend {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.tf-trend.bullish { color: var(--bullish); }
.tf-trend.bearish { color: var(--bearish); }

.tf-mfi-indicator {
    font-family: var(--font-mono);
    font-size: 12px;
}

/* Terminal & Log Output Card */
.terminal-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.terminal-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.tab-btn.active {
    background: var(--accent-subtle);
    color: var(--accent);
}

.tab-content {
    flex: 1;
    overflow-y: auto;
    display: none;
}

.tab-content.active {
    display: block;
}

/* Live Terminal Log Stream */
.terminal-stream {
    font-family: var(--font-mono);
    font-size: 11px;
    color: #a4b3d6;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: #030509;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    height: 100%;
    overflow-y: auto;
}

.log-row {
    line-height: 1.5;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.02);
    padding-bottom: 2px;
}

.log-time {
    color: var(--accent);
    margin-right: 8px;
}

.log-type {
    font-weight: 700;
    margin-right: 8px;
    text-transform: uppercase;
}

.log-type.success { color: var(--bullish); }
.log-type.error { color: var(--bearish); }
.log-type.info { color: var(--text-secondary); }
.log-type.trigger { color: var(--gold); }

/* Custom Tables */
.trade-table-wrapper {
    height: 100%;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #030509;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    text-align: left;
}

th {
    background: #090c13;
    padding: 8px 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 10px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    font-family: var(--font-mono);
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Indicators and Tags inside Tables */
.badge-side {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}

.badge-side.buy {
    background: var(--bullish-subtle);
    color: var(--bullish);
    border: 1px solid rgba(0, 230, 118, 0.2);
}

.badge-side.sell {
    background: var(--bearish-subtle);
    color: var(--bearish);
    border: 1px solid rgba(255, 45, 85, 0.2);
}

/* Keyframes Animations */
@keyframes pulse {
    0% {
        transform: scale(0.9);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.4);
        opacity: 0;
    }
    100% {
        transform: scale(0.9);
        opacity: 0.8;
    }
}

@keyframes rotateGlow {
    from {
        filter: hue-rotate(0deg);
    }
    to {
        filter: hue-rotate(360deg);
    }
}

/* Loader Screen Overlay */
.loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #06090e;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    transition: opacity 0.5s ease;
}

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

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

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