/* ALL EXISTING STYLES PRESERVED - keeping them as is */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #0B0F1C;
    color: #E5E7EB;
    line-height: 1.5;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1E2329;
}

::-webkit-scrollbar-thumb {
    background: #474D57;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5E6673;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1E2329 0%, #2B3139 100%);
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid #2B3139;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(240, 185, 11, 0.1) 0%, transparent 50%);
    animation: pulse 10s infinite;
    pointer-events: none;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #F0B90B;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.header .subtitle {
    font-size: 16px;
    color: #A6B0C2;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.header .badge {
    background: #F0B90B;
    color: #0B0F1C;
    padding: 6px 16px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 13px;
    display: inline-block;
    position: relative;
    z-index: 1;
}

/* WebSocket Status */
.ws-status {
    background: #1E2329;
    border: 1px solid #2B3139;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
}

.ws-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #2B3139;
    padding: 8px 16px;
    border-radius: 30px;
}

.ws-led {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #F6465D;
    transition: all 0.3s;
}

.ws-led.connected {
    background: #0ECB81;
    box-shadow: 0 0 12px #0ECB81;
    animation: pulse 2s infinite;
}

.ws-info {
    color: #F0B90B;
    font-size: 13px;
    font-weight: 500;
}

.ws-stats {
    display: flex;
    gap: 20px;
    margin-left: auto;
}

.ws-stat {
    text-align: center;
}

.ws-stat-label {
    color: #A6B0C2;
    font-size: 11px;
    text-transform: uppercase;
}

.ws-stat-value {
    color: #F0B90B;
    font-weight: 600;
    font-size: 15px;
}

/* Trading Controls */
.trading-controls {
    background: #1E2329;
    border: 1px solid #2B3139;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    letter-spacing: 0.5px;
}

.control-btn.connect {
    background: #0ECB81;
    color: #0B0F1C;
}

.control-btn.disconnect {
    background: #F6465D;
    color: white;
}

.control-btn.market {
    background: #F0B90B;
    color: #0B0F1C;
}

.control-btn.orders {
    background: #8B5CF6;
    color: white;
}

.control-btn.reset {
    background: #474D57;
    color: white;
}

/* Navigation */
.nav {
    background: #1E2329;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid #2B3139;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    position: sticky;
    top: 20px;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav a {
    color: #A6B0C2;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s;
    cursor: pointer;
}

.nav a:hover,
.nav a.active {
    color: #F0B90B;
    background: #2B3139;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 40px 0 20px;
}

.section-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: #F0B90B;
    border-left: 4px solid #F0B90B;
    padding-left: 15px;
    letter-spacing: 0.5px;
}

.section-header .version {
    background: #1E2329;
    color: #A6B0C2;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 12px;
    border: 1px solid #2B3139;
}

/* Market Segments */
.market-segments {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin: 20px 0 30px;
}

.segment-card {
    background: #1E2329;
    border: 1px solid #2B3139;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.segment-card:hover {
    border-color: #F0B90B;
    transform: translateY(-2px);
}

.segment-card .name {
    color: #F0B90B;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
}

.segment-card .desc {
    color: #A6B0C2;
    font-size: 11px;
}

/* Trading Grid */
.trading-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    margin-bottom: 30px;
}

/* Chart Container */
.chart-container {
    background: #1E2329;
    border: 1px solid #2B3139;
    border-radius: 16px;
    padding: 20px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.symbol-info h1 {
    font-size: 28px;
    color: #F0B90B;
    margin: 0;
}

.symbol-info .company {
    font-size: 14px;
    color: #A6B0C2;
    margin-top: 2px;
}

.price-info {
    text-align: right;
}

.price-info .current {
    font-size: 32px;
    font-weight: 600;
    color: #0ECB81;
    display: block;
    transition: color 0.3s;
}

.price-info .current.up {
    color: #0ECB81;
    animation: flashGreen 0.5s;
}

.price-info .current.down {
    color: #F6465D;
    animation: flashRed 0.5s;
}

.price-info .change {
    font-size: 14px;
}

.price-info .change.positive {
    color: #0ECB81;
}

.price-info .change.negative {
    color: #F6465D;
}

/* Timeframe Selector */
.timeframe-selector {
    display: flex;
    gap: 5px;
    margin: 15px 0;
    background: #2B3139;
    padding: 4px;
    border-radius: 8px;
    width: fit-content;
}

.timeframe-btn {
    background: transparent;
    border: none;
    color: #A6B0C2;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.timeframe-btn:hover {
    color: #F0B90B;
}

.timeframe-btn.active {
    background: #F0B90B;
    color: #0B0F1C;
}

/* Chart Area */
.chart-area {
    background: #2B3139;
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    height: 300px;
    position: relative;
    border: 1px solid #3A3F4A;
    overflow: hidden;
}

.candlestick-chart {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 2px;
}

.candle-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    position: relative;
    min-width: 8px;
}

.candle-body {
    width: 80%;
    border-radius: 2px;
    position: relative;
    transition: height 0.1s;
}

.candle-body.green {
    background: #0ECB81;
}

.candle-body.red {
    background: #F6465D;
}

.candle-wick {
    width: 2px;
    background: #A6B0C2;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    color: #A6B0C2;
    font-size: 11px;
}

/* Position Info */
.position-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 15px 0;
}

.position-item {
    background: #2B3139;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #3A3F4A;
}

.position-item.highlight {
    border-left: 3px solid #F0B90B;
}

.position-label {
    color: #A6B0C2;
    font-size: 11px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

.position-value {
    color: #E5E7EB;
    font-size: 13px;
    font-weight: 600;
    display: block;
}

.position-value.positive {
    color: #0ECB81;
}

.position-value.negative {
    color: #F6465D;
}

/* Trade Actions */
.trade-actions {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.buy-btn,
.sell-btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
}

.buy-btn {
    background: #0ECB81;
    color: #0B0F1C;
}

.sell-btn {
    background: #F6465D;
    color: white;
}

/* Order Book */
.order-book {
    background: #1E2329;
    border: 1px solid #2B3139;
    border-radius: 16px;
    padding: 20px;
}

.order-book-header {
    display: flex;
    justify-content: space-between;
    color: #F0B90B;
    font-size: 12px;
    padding: 10px 0;
    border-bottom: 2px solid #2B3139;
    font-weight: 600;
}

.order-book-asks,
.order-book-bids {
    max-height: 150px;
    overflow-y: auto;
}

.order-book-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    font-family: monospace;
    transition: background 0.2s;
    position: relative;
}

.order-book-row:hover {
    background: #2B3139;
}

.volume-bar-container {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: rgba(240, 185, 11, 0.1);
    z-index: 0;
    transition: width 0.3s;
}

.order-book-row span {
    position: relative;
    z-index: 1;
}

.bid-price {
    color: #0ECB81;
    font-weight: 600;
}

.ask-price {
    color: #F6465D;
    font-weight: 600;
}

.current-price-bar {
    background: #2B3139;
    padding: 10px;
    margin: 10px 0;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    border: 1px solid #F0B90B;
    font-weight: 600;
}

.bid-volume,
.ask-volume {
    font-size: 11px;
    color: #A6B0C2;
}

.order-stats {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #2B3139;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: #A6B0C2;
    font-size: 13px;
}

.stat-value {
    color: #F0B90B;
    font-weight: 600;
}

/* Spread Indicator */
.spread-indicator {
    display: flex;
    justify-content: space-between;
    background: #2B3139;
    padding: 8px 12px;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 12px;
    color: #F0B90B;
}

/* Endpoint Card */
.endpoint-card {
    background: #1E2329;
    border: 1px solid #2B3139;
    border-radius: 16px;
    margin-bottom: 20px;
    overflow: hidden;
}

.endpoint-header {
    background: #2B3139;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #3A3F4A;
}

.method {
    background: #F0B90B;
    color: #0B0F1C;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
}

.method.ws {
    background: #8B5CF6;
    color: white;
}

.endpoint-url {
    color: #F0B90B;
    font-family: monospace;
    font-size: 15px;
}

.endpoint-desc {
    color: #A6B0C2;
    font-size: 13px;
    margin-left: auto;
}

/* JSON Section */
.json-section {
    padding: 20px;
    border-bottom: 1px solid #2B3139;
}

.json-title {
    color: #F0B90B;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.json-box {
    background: #2B3139;
    border: 1px solid #3A3F4A;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    font-family: monospace;
    font-size: 13px;
    color: #A6B0C2;
    position: relative;
    overflow-x: auto;
}

.json-box pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.json-box .copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #1E2329;
    border: 1px solid #3A3F4A;
    color: #F0B90B;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s;
}

.json-box .copy-btn:hover {
    border-color: #F0B90B;
    background: #2B3139;
}

/* Order Types Grid */
.order-types-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.order-card {
    background: #1E2329;
    border: 1px solid #2B3139;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s;
    height: fit-content;
}

.order-card:hover {
    border-color: #F0B90B;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(240, 185, 11, 0.1);
}

.order-preview {
    padding: 20px;
    border-bottom: 1px solid #2B3139;
}

.preview-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 13px;
    padding-bottom: 8px;
    border-bottom: 1px solid #2B3139;
}

.preview-row .value {
    color: #F0B90B;
    font-weight: 600;
}

.stock-info {
    text-align: center;
    margin: 15px 0;
}

.stock-symbol {
    font-size: 24px;
    font-weight: 600;
    color: #F0B90B;
}

.stock-name {
    font-size: 12px;
    color: #A6B0C2;
}

.bid-ask {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 10px 0;
    font-size: 12px;
    color: #A6B0C2;
}

.order-input {
    margin: 12px 0;
}

.order-input label {
    display: block;
    color: #A6B0C2;
    font-size: 11px;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.order-input input {
    width: 100%;
    background: #2B3139;
    border: 1px solid #3A3F4A;
    color: #E5E7EB;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

.order-input input:focus {
    border-color: #F0B90B;
}

.order-input select {
    width: 100%;
    background: #2B3139;
    border: 1px solid #3A3F4A;
    color: #E5E7EB;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

.order-input select:focus {
    border-color: #F0B90B;
}

.volume-slider {
    margin: 15px 0;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    color: #A6B0C2;
    font-size: 11px;
    margin-bottom: 5px;
}

.slider-track {
    height: 4px;
    background: #2B3139;
    border-radius: 2px;
    position: relative;
}

.slider-fill {
    height: 100%;
    width: 50%;
    background: #F0B90B;
    border-radius: 2px;
}

.order-note,
.order-warning,
.order-summary,
.order-info,
.order-requirement {
    font-size: 11px;
    padding: 8px 10px;
    border-radius: 6px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-note {
    background: rgba(240, 185, 11, 0.1);
    color: #F0B90B;
}

.order-warning {
    background: rgba(246, 70, 93, 0.1);
    color: #F6465D;
}

.order-summary {
    background: #2B3139;
    color: #A6B0C2;
}

.order-info {
    background: rgba(14, 203, 129, 0.1);
    color: #0ECB81;
}

.order-requirement {
    background: rgba(139, 92, 246, 0.1);
    color: #8B5CF6;
}

.confirm-btn {
    width: 100%;
    background: #F0B90B;
    color: #0B0F1C;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.confirm-btn:hover {
    background: #D6A50A;
}

.confirm-btn.large {
    padding: 15px;
    font-size: 16px;
}

/* Confirmation Card */
.confirmation-details {
    background: #2B3139;
    border-radius: 12px;
    padding: 20px;
    margin: 10px 0;
}

.confirmation-header {
    color: #F0B90B;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
}

.confirmation-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #3A3F4A;
}

.confirmation-total {
    display: flex;
    justify-content: space-between;
    margin: 15px 0;
    padding: 10px 0;
    border-top: 2px solid #F0B90B;
    font-weight: 600;
}

.confirmation-note {
    font-size: 11px;
    color: #A6B0C2;
    text-align: center;
    margin-top: 10px;
}

/* PIN Section */
.pin-section {
    background: #1E2329;
    border: 1px solid #2B3139;
    border-radius: 16px;
    padding: 30px;
    max-width: 400px;
    margin: 30px auto;
}

.pin-header {
    color: #F0B90B;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 25px;
}

.pin-inputs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.pin-digit {
    width: 45px;
    height: 45px;
    background: #2B3139;
    border: 2px solid #3A3F4A;
    border-radius: 10px;
    color: #E5E7EB;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    outline: none;
}

.pin-digit:focus {
    border-color: #F0B90B;
}

.pin-divider {
    text-align: center;
    color: #A6B0C2;
    font-size: 12px;
    margin: 15px 0;
    position: relative;
}

.pin-divider::before,
.pin-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #2B3139;
}

.pin-divider::before {
    left: 0;
}

.pin-divider::after {
    right: 0;
}

.face-id-btn {
    width: 100%;
    background: #2B3139;
    border: 1px solid #F0B90B;
    color: #F0B90B;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.face-id-btn:hover {
    background: rgba(240, 185, 11, 0.1);
}

/* Market Data Grid */
.market-data-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.data-card {
    background: #1E2329;
    border: 1px solid #2B3139;
    border-radius: 12px;
    overflow: hidden;
}

.data-header {
    background: #2B3139;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #3A3F4A;
}

/* Enhanced Holdings Section */
.holdings-section {
    background: #1E2329;
    border: 1px solid #2B3139;
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
}

.holdings-header {
    color: #F0B90B;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.portfolio-summary-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #2B3139;
    border-radius: 12px;
    border: 1px solid #3A3F4A;
}

.portfolio-stat-item {
    text-align: center;
    padding: 10px;
    background: #1E2329;
    border-radius: 8px;
}

.portfolio-stat-label {
    color: #A6B0C2;
    font-size: 11px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 5px;
}

.portfolio-stat-value {
    color: #F0B90B;
    font-size: 18px;
    font-weight: 600;
    display: block;
}

.portfolio-stat-sub {
    color: #0ECB81;
    font-size: 11px;
    display: block;
}

.holdings-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.holding-item {
    display: grid;
    grid-template-columns: 80px 100px 100px 80px 100px 1fr;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #2B3139;
    cursor: pointer;
    transition: all 0.2s;
    gap: 10px;
}

.holding-item:hover {
    background: #2B3139;
    transform: translateX(5px);
}

.holding-symbol {
    color: #F0B90B;
    font-weight: 600;
    font-size: 14px;
}

.holding-price {
    color: #E5E7EB;
    font-family: monospace;
    font-size: 14px;
}

.holding-quantity {
    color: #A6B0C2;
    font-size: 13px;
}

.holding-value {
    color: #E5E7EB;
    font-family: monospace;
    font-size: 13px;
    font-weight: 600;
}

.holding-change {
    font-weight: 600;
    font-size: 13px;
}

.holding-change.positive {
    color: #0ECB81;
}

.holding-change.negative {
    color: #F6465D;
}

.holding-progress {
    height: 4px;
    background: #2B3139;
    border-radius: 2px;
    overflow: hidden;
}

.holding-progress-fill {
    height: 100%;
    background: #F0B90B;
    border-radius: 2px;
}

.search-input {
    width: 100%;
    background: #2B3139;
    border: 1px solid #3A3F4A;
    color: #E5E7EB;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    margin-top: 15px;
}

.search-input:focus {
    border-color: #F0B90B;
}

/* API Flow Visualization - CORRECTED */
.api-flow-visualization {
    background: #1E2329;
    border: 1px solid #2B3139;
    border-radius: 16px;
    padding: 25px;
    margin: 20px 0;
}

.flow-header {
    color: #F0B90B;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.flow-diagram {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    flex-wrap: wrap;
    gap: 15px;
    background: #2B3139;
    padding: 30px;
    border-radius: 12px;
}

.flow-node {
    background: #1E2329;
    border: 2px solid #3A3F4A;
    border-radius: 12px;
    padding: 20px;
    min-width: 200px;
    text-align: center;
    position: relative;
    flex: 1;
}

.flow-node.vision {
    border-color: #8B5CF6;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.flow-node.optimus {
    border-color: #F0B90B;
    box-shadow: 0 0 20px rgba(240, 185, 11, 0.2);
}

.flow-node.psx-rules {
    border-color: #0ECB81;
    box-shadow: 0 0 20px rgba(14, 203, 129, 0.2);
}

.flow-icon {
    font-size: 32px;
    margin-bottom: 15px;
}

.flow-label {
    color: #E5E7EB;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
}

.flow-desc {
    color: #A6B0C2;
    font-size: 12px;
    line-height: 1.6;
}

.flow-arrow {
    color: #F0B90B;
    font-size: 28px;
    font-weight: 600;
}

.flow-note {
    text-align: center;
    color: #A6B0C2;
    font-size: 13px;
    margin-top: 20px;
    padding: 15px;
    background: #2B3139;
    border-radius: 8px;
    border-left: 4px solid #0ECB81;
}

.flow-legend {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-top: 25px;
    padding: 15px;
    background: #2B3139;
    border-radius: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #E5E7EB;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-color.vision {
    background: #8B5CF6;
}

.legend-color.optimus {
    background: #F0B90B;
}

.legend-color.psx-rules {
    background: #0ECB81;
}

/* API Purpose Cards */
.api-purpose-section {
    background: #1E2329;
    border: 1px solid #2B3139;
    border-radius: 16px;
    padding: 25px;
    margin: 20px 0;
}

.purpose-header {
    color: #F0B90B;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 25px;
}

.purpose-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.purpose-card {
    background: #2B3139;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #3A3F4A;
    transition: all 0.3s;
}

.purpose-card:hover {
    border-color: #F0B90B;
    transform: translateY(-2px);
}

.purpose-icon {
    font-size: 28px;
    margin-bottom: 15px;
}

.purpose-title {
    color: #F0B90B;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 12px;
}

.purpose-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.purpose-tag {
    background: rgba(240, 185, 11, 0.1);
    color: #F0B90B;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-family: monospace;
}

.purpose-description {
    color: #A6B0C2;
    font-size: 13px;
    margin-bottom: 15px;
    line-height: 1.6;
}

.purpose-example {
    background: #1E2329;
    border-radius: 6px;
    padding: 10px;
    font-size: 12px;
    color: #0ECB81;
    border-left: 3px solid #F0B90B;
}

/* Endpoint Usage Guide */
.endpoint-usage {
    background: #2B3139;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    border: 1px solid #3A3F4A;
}

.usage-title {
    color: #F0B90B;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.usage-text {
    color: #A6B0C2;
    font-size: 12px;
    line-height: 1.6;
    margin-bottom: 10px;
}

.usage-example {
    background: #1E2329;
    border-radius: 6px;
    padding: 8px 12px;
    font-family: monospace;
    font-size: 11px;
    color: #0ECB81;
    border-left: 3px solid #F0B90B;
}

/* PSX Rules Section */
.psx-rules-section {
    background: linear-gradient(135deg, #1E2329 0%, #1a1f2a 100%);
    border: 2px solid #0ECB81;
    border-radius: 16px;
    padding: 25px;
    margin: 20px 0;
}

.psx-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.psx-icon {
    font-size: 32px;
    background: rgba(14, 203, 129, 0.1);
    padding: 10px;
    border-radius: 12px;
}

.psx-title {
    color: #0ECB81;
    font-size: 20px;
    font-weight: 600;
}

.psx-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.psx-card {
    background: #2B3139;
    border-radius: 12px;
    padding: 15px;
    border: 1px solid #3A3F4A;
}

.psx-card-title {
    color: #0ECB81;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.psx-card-content {
    color: #A6B0C2;
    font-size: 12px;
    line-height: 1.6;
}

/* WebSocket Console */
.ws-console {
    background: #1E2329;
    border: 1px solid #2B3139;
    border-radius: 16px;
    margin: 20px 0;
    overflow: hidden;
}

.console-header {
    background: #2B3139;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3A3F4A;
}

.console-header span {
    color: #F0B90B;
    font-weight: 600;
    font-size: 14px;
}

.clear-btn {
    background: transparent;
    border: 1px solid #3A3F4A;
    color: #A6B0C2;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.clear-btn:hover {
    border-color: #F0B90B;
    color: #F0B90B;
}

.console-messages {
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.console-message {
    padding: 8px;
    font-family: monospace;
    font-size: 12px;
    border-bottom: 1px solid #2B3139;
    color: #A6B0C2;
    animation: fadeIn 0.3s;
}

.console-message .msg-time {
    color: #F0B90B;
    margin-right: 10px;
}

.console-message .msg-type {
    color: #8B5CF6;
    margin-right: 10px;
    font-weight: 600;
}

.console-message .msg-data {
    color: #0ECB81;
}

.console-message .msg-data.ask {
    color: #F6465D;
}

.console-message .msg-data.bid {
    color: #0ECB81;
}

/* Real-time OHLC Stream Section */
.realtime-streams {
    background: #1E2329;
    border: 1px solid #2B3139;
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
}

.stream-header {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.stream-badge {
    background: #2B3139;
    color: #F0B90B;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
}

/* Animations */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes flashGreen {

    0%,
    100% {
        color: #0ECB81;
    }

    50% {
        color: #FFFFFF;
    }
}

@keyframes flashRed {

    0%,
    100% {
        color: #F6465D;
    }

    50% {
        color: #FFFFFF;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-10px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Demo Disclaimer */
.demo-disclaimer {
    background: rgba(240, 185, 11, 0.15);
    border: 1px solid #F0B90B;
    color: #F0B90B;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
}

.demo-disclaimer i {
    margin-right: 8px;
}

/* Footer */
.footer {
    margin-top: 50px;
    padding: 30px;
    background: #1E2329;
    border: 1px solid #2B3139;
    border-radius: 16px;
    text-align: center;
    color: #A6B0C2;
    font-size: 13px;
}

/* Responsive */
@media (max-width: 1200px) {
    .trading-grid {
        grid-template-columns: 1fr;
    }

    .order-types-grid {
        grid-template-columns: 1fr;
    }

    .market-data-grid {
        grid-template-columns: 1fr;
    }

    .purpose-grid {
        grid-template-columns: 1fr;
    }

    .psx-grid {
        grid-template-columns: 1fr;
    }

    .flow-diagram {
        flex-direction: column;
    }

    .flow-arrow {
        transform: rotate(90deg);
    }

    .holding-item {
        grid-template-columns: 80px 100px 80px 80px 80px 1fr;
        font-size: 12px;
        gap: 5px;
    }
}

@media (max-width: 768px) {
    .holding-item {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .holding-progress {
        grid-column: 1/-1;
    }

    .portfolio-summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 400px) {
    .header {
        flex-direction: column;
        text-align: center;
    }

    .logo-container {
        margin-left: 0 !important;
        margin-top: 15px;
    }
}