/* ============================================
   FlowDash Module - Order Flow Analytics
   Pure Black Theme #000000
   ============================================ */

.flowdash-module {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #000000;
    overflow: hidden;
}

/* Header */
.flowdash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #000000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.flowdash-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.flowdash-title i {
    color: #F39C12;
    font-size: 16px;
}

.flowdash-title h2 {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.flowdash-subtitle {
    color: #666;
    font-size: 11px;
}

.flowdash-live {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 4px;
    color: #22c55e;
    font-size: 10px;
    font-weight: 600;
}

.flowdash-live .live-dot {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.flowdash-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.flowdash-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

.flowdash-search i {
    color: #666;
    font-size: 11px;
}

.flowdash-search input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 12px;
    width: 100px;
    outline: none;
}

.flowdash-btn {
    position: relative;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: #888;
    cursor: pointer;
    transition: all 0.15s;
}

.flowdash-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.alert-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ef4444;
    border-radius: 8px;
    color: #fff;
    font-size: 9px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tabs */
.flowdash-tabs {
    display: flex;
    gap: 2px;
    padding: 8px 20px;
    background: #000000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #666;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #888;
}

.tab-btn.active {
    background: rgba(243, 156, 18, 0.15);
    color: #F39C12;
}

.tab-btn i {
    font-size: 10px;
}

/* Content */
.flowdash-content {
    flex: 1;
    overflow: auto;
    padding: 16px;
}

/* Time & Sales Tape */
.tape-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tape-filters {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    color: #666;
    font-size: 10px;
    text-transform: uppercase;
}

.filter-group input,
.filter-group select {
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: #fff;
    font-size: 11px;
    outline: none;
}

.filter-group input {
    width: 80px;
}

.filter-stats {
    margin-left: auto;
    display: flex;
    gap: 16px;
}

.stat-item {
    font-size: 11px;
}

.stat-label {
    color: #666;
}

.stat-value {
    color: #fff;
    font-weight: 600;
    margin-left: 4px;
}

.text-accent {
    color: #F39C12 !important;
}

/* Tape Table */
.tape-table-container {
    flex: 1;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 6px;
}

.tape-table {
    width: 100%;
    border-collapse: collapse;
}

.tape-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.tape-table th {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    color: #888;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tape-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    transition: background 0.1s;
}

.tape-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.tape-row.block-trade {
    background: rgba(243, 156, 18, 0.08);
    border-left: 3px solid #F39C12;
}

.tape-row.block-trade:hover {
    background: rgba(243, 156, 18, 0.12);
}

.tape-row td {
    padding: 8px 12px;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
}

.tape-time {
    color: #666;
}

.tape-price {
    color: #fff;
    font-weight: 500;
}

.tape-size {
    color: #888;
}

.tape-row.block-trade .tape-size {
    color: #F39C12;
    font-weight: 600;
}

.tape-side {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
}

.tape-side.buy {
    color: #22c55e;
}

.tape-side.sell {
    color: #ef4444;
}

.tape-exchange {
    color: #666;
    font-size: 10px;
}

/* Order Flow Analytics */
.flow-container {
    height: 100%;
}

.flow-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.flow-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    overflow: hidden;
}

.flow-card.wide {
    grid-column: span 2;
}

.flow-card .card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.flow-card .card-header i {
    color: #F39C12;
    font-size: 11px;
}

.flow-card .card-header span {
    color: #888;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.flow-card .card-body {
    padding: 16px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row .stat-label {
    color: #888;
    font-size: 11px;
}

.stat-row .stat-value {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.stat-row .stat-value.positive {
    color: #22c55e;
}

.stat-row .stat-value.negative {
    color: #ef4444;
}

.volume-bar {
    height: 8px;
    background: #ef4444;
    border-radius: 4px;
    margin-top: 12px;
    overflow: hidden;
}

.volume-bar .buy-bar {
    height: 100%;
    background: #22c55e;
    border-radius: 4px 0 0 4px;
}

/* Region rows */
.region-row {
    display: grid;
    grid-template-columns: 50px 70px 40px 1fr;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.region-name {
    color: #fff;
    font-size: 11px;
    font-weight: 500;
}

.region-vol {
    color: #888;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
}

.region-pct {
    color: #F39C12;
    font-size: 11px;
    font-weight: 600;
}

.region-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.region-fill {
    height: 100%;
    background: #F39C12;
    border-radius: 3px;
}

/* Channel rows */
.channel-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.channel-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.channel-name {
    flex: 1;
    color: #888;
    font-size: 11px;
}

.channel-pct {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

/* Account rows */
.account-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.account-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.account-type {
    color: #fff;
    font-size: 12px;
    font-weight: 500;
}

.account-sentiment {
    color: #666;
    font-size: 10px;
}

.account-pct {
    font-size: 18px;
    font-weight: 700;
    color: #888;
}

/* Securities Table */
.securities-table {
    width: 100%;
    border-collapse: collapse;
}

.securities-table th {
    padding: 8px;
    color: #666;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.securities-table td {
    padding: 10px 8px;
    font-size: 11px;
    color: #888;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.securities-table .ticker {
    color: #fff;
    font-weight: 600;
}

.securities-table .positive {
    color: #22c55e;
}

.securities-table .negative {
    color: #ef4444;
}

/* Volume Profile */
.vap-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 16px;
}

.vap-chart {
    flex: 1;
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 16px;
    overflow: auto;
}

.vap-price-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px 0;
}

.vap-price-label {
    color: #666;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
}

.vap-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vap-row {
    display: flex;
    align-items: center;
    height: 20px;
    gap: 4px;
}

.vap-bar {
    height: 16px;
    border-radius: 2px;
}

.vap-bar.buy {
    background: rgba(34, 197, 94, 0.7);
}

.vap-bar.sell {
    background: rgba(239, 68, 68, 0.7);
}

.vap-volume {
    color: #666;
    font-size: 9px;
    font-family: 'JetBrains Mono', monospace;
    min-width: 40px;
}

.vap-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #888;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-dot.buy {
    background: #22c55e;
}

.legend-dot.sell {
    background: #ef4444;
}

.legend-dot.poc {
    background: #F39C12;
}

.vap-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
}

.vap-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.vap-stat .stat-label {
    color: #666;
    font-size: 10px;
    text-transform: uppercase;
}

.vap-stat .stat-value {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

/* Alerts */
.alerts-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 16px;
    height: 100%;
}

.alerts-config {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 16px;
}

.alerts-config h3 {
    color: #fff;
    font-size: 12px;
    margin: 0 0 16px;
}

.alert-rules {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #888;
}

.rule-item label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rule-item input[type="checkbox"] {
    accent-color: #F39C12;
}

.rule-value {
    width: 60px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: #fff;
    font-size: 11px;
    text-align: right;
}

.alerts-list {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 16px;
    overflow: auto;
}

.alerts-list h3 {
    color: #fff;
    font-size: 12px;
    margin: 0 0 16px;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    margin-bottom: 8px;
}

.alert-item.high {
    border-left: 3px solid #ef4444;
}

.alert-item.medium {
    border-left: 3px solid #F39C12;
}

.alert-item.low {
    border-left: 3px solid #22c55e;
}

.alert-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    color: #888;
}

.alert-content {
    flex: 1;
}

.alert-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.alert-ticker {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.alert-time {
    color: #666;
    font-size: 10px;
}

.alert-message {
    color: #888;
    font-size: 11px;
}

.alert-severity {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
}

.alert-severity.high {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.alert-severity.medium {
    background: rgba(243, 156, 18, 0.15);
    color: #F39C12;
}

.alert-severity.low {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

/* Responsive */
@media (max-width: 1400px) {
    .flow-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .flow-card.wide {
        grid-column: span 2;
    }
}

@media (max-width: 900px) {
    .flow-grid {
        grid-template-columns: 1fr;
    }
    
    .flow-card.wide {
        grid-column: span 1;
    }
    
    .alerts-container {
        grid-template-columns: 1fr;
    }
}

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