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

body {
    font-family: 'Courier New', monospace;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .glitch-link, .console-header, .header, .disclaimer-strip {
    animation: pulse 6s infinite, crackle 0.9s infinite;
    background: transparent;
    display: block;
}


.delta {
    animation: pulse 5s infinite, crackle 0.8s infinite;
    background: transparent;
}

.disclaimer-strip{ animation: pulse 8s infinite, crackle 1.5s infinite; }
h1 { animation: pulse 8s infinite, crackle 1.5s infinite; }
h2 { animation: pulse 7s infinite, crackle 1.25s infinite; }
h3 { animation: pulse 6s infinite, crackle 1s infinite; }
h4 { animation: pulse 5s infinite, crackle 1s infinite; }
h5 { animation: pulse 5s infinite, crackle 0.8s infinite; }
h6 { animation: pulse 5s infinite, crackle 0.8s infinite; }
.status-indicator { animation: pulse 4s infinite, crackle 0.7s infinite; }
.glitch-link { animation: pulse 3s infinite, crackle 0.4s infinite; }

/* Specific style for collapsible headers to maintain layout */
.collapsible-header {
    display: block;
    width: 100%;
    text-align: left;
    cursor: pointer;
    user-select: none;
    padding: 10px 0;
    margin: 10px 0;
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
    transition: all 0.3s ease;
}

/* Pulse animation */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        opacity: 1;
    }
}

/* Crackling effect */
@keyframes crackle {
    0% {
        text-shadow:
            0 0 4px var(--glow-color, var(--hacker-green-primary)),
            0 0 11px var(--glow-color, var(--hacker-green-primary)),
            0 0 19px var(--glow-color, var(--hacker-green-primary));
    }
    20% {
        text-shadow:
            0 0 4px var(--glow-color, var(--hacker-green-primary)),
            0 0 11px var(--glow-color, var(--hacker-green-primary)),
            2px 2px 19px var(--glow-color, var(--hacker-green-primary));
    }
    40% {
        text-shadow:
            -2px 0 4px var(--glow-color, var(--hacker-green-primary)),
            0 0 11px var(--glow-color, var(--hacker-green-primary)),
            2px 0 19px var(--glow-color, var(--hacker-green-primary));
    }
    60% {
        text-shadow:
            0 -2px 4px var(--glow-color, var(--hacker-green-primary)),
            0 0 11px var(--glow-color, var(--hacker-green-primary)),
            0 2px 19px var(--glow-color, var(--hacker-green-primary));
    }
    80% {
        text-shadow:
            1px 1px 4px var(--glow-color, var(--hacker-green-primary)),
            -1px -1px 11px var(--glow-color, var(--hacker-green-primary)),
            1px -1px 19px var(--glow-color, var(--hacker-green-primary));
    }
    100% {
        text-shadow:
            -1px 1px 4px var(--glow-color, var(--hacker-green-primary)),
            1px -1px 11px var(--glow-color, var(--hacker-green-primary)),
            -1px -1px 19px var(--glow-color, var(--hacker-green-primary));
    }
}

.status-indicator.disconnected, .delta.negative, .disclaimer-strip {
    --glow-color: var(--color-negative);
}


/* Animated background */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    perspective: 1000px;
    transform-style: preserve-3d;
    overflow: hidden;
}

/* Update the grid animations */
.grid, .vertical-lines, .horizontal-lines {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    animation: grid-animation 15s linear infinite;
    opacity: 0;
}

.grid {
    background:
        linear-gradient(90deg, var(--border-primary) 1px, transparent 1px) 0 0,
        linear-gradient(var(--border-primary) 1px, transparent 1px) 0 0;
    background-size: 40px 40px;
    transform: rotateX(60deg) rotateZ(45deg) translateZ(0);
    animation: grid-animation 15s linear infinite;
}

.vertical-lines {
    background: repeating-linear-gradient(
        90deg,
        var(--border-secondary) 0px,
        var(--border-secondary) 1px,
        transparent 1px,
        transparent 40px
    );
    transform: rotateX(60deg) rotateZ(45deg) translateZ(-100px);
    animation: grid-animation 15s linear infinite 5s; /* 5s delay */
}

.horizontal-lines {
    background: repeating-linear-gradient(
        0deg,
        var(--border-secondary) 0px,
        var(--border-secondary) 1px,
        transparent 1px,
        transparent 40px
    );
    transform: rotateX(60deg) rotateZ(45deg) translateZ(-200px);
    animation: grid-animation 15s linear infinite 10s; /* 10s delay */
}

@keyframes grid-animation {
    0% {
        opacity: 0;
        transform: rotateX(60deg) rotateZ(45deg) translateZ(-100px);
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: rotateX(60deg) rotateZ(45deg) translateZ(300px);
    }
}

/* Add an overlay gradient for depth perception */
.depth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        var(--bg-overlay) 0%,
        transparent 20%,
        transparent 80%,
        var(--bg-overlay) 100%
    );
    pointer-events: none;
    z-index: -1;
}

/* Glowing overlay */
.glow-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at 50% 50%,
        var(--glow-primary) 0%,
        var(--bg-overlay) 100%
    );
    pointer-events: none;
    z-index: -1;
}

/* Matrix rain effect (enhanced) */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    opacity: 0.15;
    background: black;
    transform: translateZ(-300px);
}

/* Add depth to container elements */
.container {
    position: relative;
    z-index: 1;
    transform-style: preserve-3d;
    perspective: 1000px;
}



/* Add these keyframes for additional effects */
@keyframes pulse-3d {
    0%, 100% {
        transform: translateZ(20px);
    }
    50% {
        transform: translateZ(40px);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateZ(20px);
    }
    50% {
        transform: translateY(-10px) translateZ(40px);
    }
}

/* Base container styles */
.container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 80px auto 0;
}

/* Widget base styles */
.widget {
    background: var(--bg-tertiary);
    padding: 25px;
    border-radius: 15px;
    backdrop-filter: blur(5px);
    border: 1px solid var(--border-secondary);
    box-shadow: 0 0 20px var(--glow-primary);
    transition: all 0.3s ease;
}


/* Professional Hacker Green Color Palette */
:root {
    /* Core Hacker Green Colors */
    --hacker-green-primary: #00ff41;
    --hacker-green-secondary: #00cc33;
    --hacker-green-accent: #33ff66;
    --hacker-green-glow: #00ff88;
    --hacker-green-dark: #004d1a;
    --hacker-green-deep: #001a0a;

    /* Status Colors */
    --color-positive: #00ff41;
    --color-negative: #ff1a1a;
    --color-warning: #ff8800;
    --color-info: #00ccff;

    /* Background Colors */
    --bg-primary: #0a0f0a;
    --bg-secondary: rgba(0, 26, 10, 0.8);
    --bg-tertiary: rgba(0, 20, 0, 0.6);
    --bg-overlay: rgba(0, 0, 0, 0.4);

    /* Border Colors */
    --border-primary: rgba(0, 255, 65, 0.2);
    --border-secondary: rgba(0, 255, 65, 0.1);
    --border-glow: rgba(0, 255, 65, 0.3);

    /* Text Colors */
    --text-primary: #00ff41;
    --text-secondary: rgba(0, 255, 65, 0.9);
    --text-muted: rgba(0, 255, 65, 0.7);
    --text-bright: #33ff66;

    /* Glow Effects */
    --glow-positive: rgba(0, 255, 65, 0.5);
    --glow-negative: rgba(255, 26, 26, 0.5);
    --glow-warning: rgba(255, 136, 0, 0.5);
    --glow-primary: rgba(0, 255, 65, 0.3);
}

/* Color theme */
.value, .positive {
    color: var(--color-positive);
    text-shadow: 0 0 8px var(--glow-positive);
}

.negative {
    color: var(--color-negative);
    text-shadow: 0 0 8px var(--glow-negative);
}

/* Widget layout */
@media (min-width: 769px) {
    .container {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
    }

    .widget-medium {
        grid-column: span 3;
    }

    .widget-large {
        grid-column: span 6;
    }
}

/* Mobile view */
@media (max-width: 768px) {
    .container {
        display: flex;
        flex-direction: column;
    }

    .widget {
        width: 100%;
        margin-bottom: 15px;
    }

    /* Adjust metrics strip for mobile */
    .metrics-strip {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .metric-box {
        width: 100%;
    }

    /* Adjust filled orders table for mobile */
    .filled-orders-table {
        font-size: 0.8em;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .filled-orders-controls {
        flex-direction: column;
        gap: 10px;
    }
}

/* Maintain green theme */
.metric span:first-child::before {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    text-shadow: 0 0 8px var(--glow-positive);
}

.status-indicator {
    position: relative;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 0.8em;
    z-index: 1000;
    border: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    transition: all 0.3s ease;
}

.connected {
    color: var(--color-positive);
    border-color: var(--border-glow);
    text-shadow: 0 0 8px var(--glow-positive);
    box-shadow:
        0 0 10px var(--glow-positive),
        0 0 20px var(--glow-primary);
}


.disconnected {
    color: var(--color-negative);
    border-color: var(--glow-negative);
    text-shadow: 0 0 8px var(--glow-negative);
    box-shadow:
        0 0 10px var(--glow-negative),
        0 0 20px rgba(255, 26, 26, 0.1);
}

.connecting {
    color: var(--color-warning);
    border-color: var(--glow-warning);
    text-shadow: 0 0 8px var(--glow-warning);
    box-shadow:
        0 0 10px var(--glow-warning),
        0 0 20px rgba(255, 136, 0, 0.1);
}

/* Widget headers */
.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
}

/* Maintain matrix background effect */
.matrix-bg {
    opacity: 0.1;
}

/* Mobile-first responsive design */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 15px;
        padding: 15px;
        margin-top: 60px;
    }

    /* Make all widgets full width on mobile */
    .widget, 
    .widget-medium, 
    .widget-large {
        grid-column: 1 / -1;
        padding: 15px;
    }

    /* Adjust header for mobile */
    .header {
        padding: 10px 15px;
        border-bottom: 1px solid rgba(0, 255, 0, 0.2);
        background: rgba(0, 20, 0, 0.95);
    }

    .header-title {
        font-size: 1em;
    }

    .header-subtitle {
        display: none; /* Hide subtitle on mobile */
    }

    /* Adjust metrics strip for mobile */
    .metrics-strip {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .metric-box {
        width: 100%;
    }

    /* Adjust filled orders table for mobile */
    .filled-orders-table {
        font-size: 0.8em;
    }

    .filled-orders-table th,
    .filled-orders-table td {
        padding: 6px 4px;
    }

    /* Make controls stack on mobile */
    .filled-orders-controls {
        flex-direction: column;
        gap: 10px;
    }

    .page-controls {
        width: 100%;
        justify-content: space-between;
    }

    /* Adjust info sections for mobile */
    .info-section {
        padding: 15px;
    }

    .main-title {
        font-size: 1.8em;
    }

    /* Adjust watermark for mobile */
    .watermark {
        font-size: min(8vw, 6vh);
    }
}


.analytics-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    overflow: hidden;
}

.analytics-table th, .analytics-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-secondary);
}

.analytics-table th {
    background: var(--bg-tertiary);
    font-size: 0.9em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-bright);
}

.analytics-table tr:nth-child(even) {
    background: rgba(0, 26, 10, 0.4);
}

.analytics-table tr:hover {
    background: var(--glow-primary);
}

.analytics-table td {
    font-size: 0.9em;
    line-height: 1.5;
    color: var(--text-secondary);
}

.analytics-table tbody tr:last-child td {
    border-bottom: none;
}

/* Tablet breakpoint */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }

    .widget-medium {
        grid-column: span 2;
    }

    .widget-large {
        grid-column: span 4;
    }
}

/* Additional mobile optimizations */
@media (max-width: 480px) {
    /* Extra small screens */
    .filled-orders-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .metric span:first-child::before {
        width: 200px; /* Limit tooltip width */
        white-space: normal; /* Allow wrapping */
        bottom: 120%;
        font-size: 0.8em;
    }

    .header-title {
        font-size: 0.9em;
    }

    .status-indicator {
        font-size: 0.7em;
    }
}

/* Handle landscape orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .container {
        margin-top: 50px;
    }

    .metrics-strip {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .metric-box {
        width: calc(50% - 10px);
    }
}

/* Improve touch targets on mobile */
@media (hover: none) and (pointer: coarse) {
    .page-button,
    .debug-toggle,
    .widget-control {
        min-height: 44px;
        min-width: 44px;
    }

    .results-per-page {
        height: 44px;
    }
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
}

.widget-header h2 {
    margin: 0;
    padding: 0;
    border: none;
}

.widget-controls {
    display: flex;
    gap: 10px;
}

.widget-control {
    background: none;
    border: none;
    color: #00ff00;
    cursor: pointer;
    padding: 5px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.widget-control:hover {
    opacity: 1;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
}

.widget-small {
    grid-column: span 2;
}

.widget-medium {
    grid-column: span 3;
}

.widget-large {
    grid-column: span 6;
}

@media (max-width: 1200px) {
    .container {
        grid-template-columns: repeat(4, 1fr);
        padding: 0 15px;
        margin-top: 60px;
    }
    
    .widget-medium {
        grid-column: span 2;
    }
    
    .widget-large {
        grid-column: span 4;
    }

    .metrics-strip {
        flex-wrap: wrap;
        gap: 20px;
    }

    .metric-box {
        flex: 1 1 calc(50% - 20px);
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        margin: 60px auto 20px;
        padding: 0 10px;
    }

    .widget-small, 
    .widget-medium, 
    .widget-large {
        grid-column: span 1;
    }



    .metrics-strip {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .metric-box {
        width: 100%;
        min-width: unset;
    }

    .header {
        padding: 10px;
    }

    .header-title {
        font-size: 1em;
    }

    .header-subtitle {
        display: none;
    }

    .main-title {
        font-size: 1.8em;
        padding: 0 10px;
    }

    .info-section {
        padding: 15px;
    }

    .filled-orders-table {
        font-size: 0.8em;
    }

    .filled-orders-controls {
        flex-direction: column;
        gap: 10px;
    }

    .page-controls {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .filled-orders-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .metric {
        margin: 15px 0;
        display: flex;
        justify-content: space-between;
        padding: 8px;
        border-radius: 5px;
        background: rgba(0, 255, 0, 0.03);
        transition: all 0.3s ease;
    }

    .metric .delta {
        margin-left: 0;
        margin-top: 5px;
    }

    .main-title {
        font-size: 1.5em;
    }

    .widget {
        padding: 15px;
    }

    .widget-header {
        flex-direction: column;
        gap: 10px;
    }

    .widget-controls {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Add better touch support for mobile */
@media (hover: none) {
    .widget:hover {
    border-color: rgba(0, 255, 0, 0.3);
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.2);
    }

    .metric:hover {
        background: rgba(0, 255, 0, 0.05);
        transform: translateX(5px);
    }

    .widget-control,
    .page-button,
    .collapsible-header {
        padding: 10px;  /* Larger touch target */
    }

    /* Improve tooltip behavior on touch devices */
    .metric span:first-child::before {
        display: none;  /* Hide tooltips on touch devices */
    }

    .metric span:first-child:active::before {
        opacity: 1;
        visibility: visible;
        bottom: 100%;
    }
}

/* Add safe area insets for modern mobile browsers */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(10px, env(safe-area-inset-left));
        padding-right: max(10px, env(safe-area-inset-right));
    }

    .header {
        padding-left: max(10px, env(safe-area-inset-left));
        padding-right: max(10px, env(safe-area-inset-right));
        padding-top: max(10px, env(safe-area-inset-top));
    }
}

/* Improve table responsiveness */
.filled-orders-table {
    width: 100%;
    min-width: 600px;  /* Ensure minimum width for content */
}

.filled-orders-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -15px;  /* Negative margin to allow full-width scrolling */
    padding: 0 15px;
    scroll-behavior: smooth;
    position: relative;
    /* Add these properties to prevent scroll reset */
    scroll-snap-type: none;
    -webkit-scroll-snap-type: none;
    touch-action: pan-x pan-y;
    will-change: scroll-position;
}

.metric {
    margin: 15px 0;
    display: flex;
    justify-content: space-between;
    padding: 8px;
    border-radius: 5px;
    background: rgba(0, 255, 0, 0.03);
    transition: all 0.3s ease;
}

.metric:hover {
    background: rgba(0, 255, 0, 0.05);
    transform: translateX(5px);
}

.value {
    color: #00ff00;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.delta {
    margin-left: 15px;
    font-size: 0.9em;
}

.positive {
    color: #00ff00;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.negative {
    color: #ff0033;
    text-shadow: 0 0 5px rgba(255, 0, 51, 0.5);
}

/* Update these styles to ensure negative values glow red */
.value.negative {
    color: #ff0033;
    text-shadow: 0 0 5px rgba(255, 0, 51, 0.5);
}

.delta.negative {
    color: #ff0033;
    text-shadow: 0 0 5px rgba(255, 0, 51, 0.5);
}

/* Add connection status indicator */
.status-indicator {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8em;
    z-index: 1000;
}

.connected {
    background: rgba(0, 255, 0, 0.2);
    color: #00ff00;
}

.disconnected {
    background: rgba(255, 0, 0, 0.2);
    color: #ff0033;
    border-color: rgba(255, 0, 51, 0.3);
    text-shadow: 0 0 5px rgba(255, 0, 51, 0.5);
}

.connecting {
    background: rgba(255, 165, 0, 0.2);
    color: #ffa500;
}

/* Debug panel styles */
.debug-panel {
    position: relative;  /* Changed from fixed */
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.75);
    color: #00ff00;
    font-size: 0.8em;
    border-radius: 5px;
    margin-top: 20px;  /* Add spacing from widgets */
    border: 1px solid rgba(0, 255, 0, 0.2);
    min-height: 100px;
    display: block !important;  /* Always show */
    visibility: visible !important;  /* Always visible */
}

.debug-panel.expanded {
    height: 200px;
    overflow-y: auto;
}

#debug-log {
    padding: 10px;
    white-space: pre-wrap;  /* Preserve line breaks and wrap text */
    font-family: monospace;
    height: 100%;
    overflow-y: auto;
}

/* Remove mobile hiding */
@media (max-width: 768px) {
    .debug-panel {
        height: auto;
        min-height: 100px;
        overflow: visible;
    }
}

/* Update watermark styles */
.watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: min(6vw, 4.5vh);  /* Use the smaller of vertical or horizontal size */
    font-weight: bold;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
    color: rgba(0, 255, 0, 0.03);
    z-index: -1;
    pointer-events: none;
    user-select: none;
    text-shadow: 
        0 0 20px rgba(0, 255, 0, 0.05),
        0 0 40px rgba(0, 255, 0, 0.02),
        2px 2px 2px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.3em;  /* Reduced from 0.5em */
    filter: blur(1px);
    opacity: 0.8;
    animation: glitch 10s infinite linear alternate;
    width: 90vw;  /* Set maximum width */
    text-align: center;
}

/* Add content switching based on available space */
.watermark::before {
    content: "DIOPHANT SOLUTIONS";
}

/* Media query for smaller screens - first reduction */
@media (max-width: 900px) {
    .watermark {
        font-size: min(5vw, 4vh);
        letter-spacing: 0.2em;
    }
}

/* Switch to D S when space is too tight */
@media (max-width: 500px) {
    .watermark::before {
        content: "D S";
    }
    .watermark {
        letter-spacing: 0.5em;
        font-size: min(8vw, 6vh);
    }
}

/* Add glitch animation */
@keyframes glitch {
    0%, 100% { 
        text-shadow: 
            0 0 20px rgba(0, 255, 0, 0.05),
            0 0 40px rgba(0, 255, 0, 0.02),
            2px 2px 2px rgba(0, 0, 0, 0.5);
        opacity: 0.8;
    }
    33% {
        text-shadow: 
            0 0 20px rgba(0, 255, 0, 0.05),
            0 0 40px rgba(0, 255, 0, 0.02),
            -2px -2px 2px rgba(0, 0, 0, 0.5);
        opacity: 0.7;
    }
    66% {
        text-shadow: 
            0 0 20px rgba(0, 255, 0, 0.06),
            0 0 40px rgba(0, 255, 0, 0.03),
            1px -1px 2px rgba(0, 0, 0, 0.5);
        opacity: 0.9;
    }
}

/* Add header styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(0, 255, 0, 0.1);
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.header-subtitle {
    font-size: 0.8em;
    opacity: 0.7;
    margin-left: 10px;
}

/* Adjust container margin to account for header */
.container {
    margin-top: 80px;  /* Increased from 40px */
}

/* Move status indicator to align with header */
.status-indicator {
    position: relative;  /* Changed from fixed */
    top: 0;
    right: 0;
}

/* Update these tooltip styles */
span[data-tooltip] {
    position: relative;
    cursor: help;
}

span[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 140%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: rgba(0, 20, 0, 0.95);
    border: 1px solid rgba(0, 255, 0, 0.2);
    border-radius: 4px;
    color: #00ff00;
    font-size: 0.9em;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: 
        opacity 0.3s ease,
        visibility 0.3s ease,
        transform 0.3s ease;
    box-shadow: 
        0 0 10px rgba(0, 255, 0, 0.1),
        0 0 20px rgba(0, 255, 0, 0.05);
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    pointer-events: none;
    /* Add a small initial transform */
    transform: translateX(-50%) translateY(5px);
}

span[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    /* Remove the transform on hover */
    transform: translateX(-50%) translateY(0);
}

/* Add a hover area to prevent flickering */
span[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    height: 40px; /* Increased hover area */
    z-index: 999;
}

/* Add these styles for filled orders */
.filled-orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.filled-orders-table th,
.filled-orders-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 255, 0, 0.1);
}

.filled-orders-table th {
    font-weight: bold;
    color: rgba(0, 255, 0, 0.8);
    text-transform: uppercase;
    font-size: 0.8em;
    letter-spacing: 0.1em;
}

.filled-orders-table tr {
    transition: all 0.3s ease;
}

.filled-orders-table tr:hover {
    background: rgba(0, 255, 0, 0.05);
}

.filled-orders-table .buy {
    color: #00ff00;
}

.filled-orders-table .sell {
    color: #ff0033;
}

.filled-orders-table .time {
    font-family: 'Courier New', monospace;
    opacity: 0.8;
}

/* Add these styles for pagination */
.filled-orders-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding: 10px 0;
    border-top: 1px solid rgba(0, 255, 0, 0.1);
}

.page-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.page-button {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid rgba(0, 255, 0, 0.2);
    color: #00ff00;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-button:hover {
    background: rgba(0, 255, 0, 0.2);
}

.page-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    color: rgba(0, 255, 0, 0.8);
    font-size: 0.9em;
}

.results-per-page {
    background: rgba(0, 20, 0, 0.95);
    border: 1px solid rgba(0, 255, 0, 0.2);
    color: #00ff00;
    padding: 5px;
    border-radius: 3px;
}

.results-per-page option {
    background: rgba(0, 20, 0, 0.95);
    color: #00ff00;
}

/* Add this style for the total count display */
.total-count {
    color: rgba(0, 255, 0, 0.8);
    font-size: 0.9em;
    margin-left: 10px;
    padding: 5px 8px;
    background: rgba(0, 20, 0, 0.95);
    border: 1px solid rgba(0, 255, 0, 0.2);
    border-radius: 3px;
}

.filled-orders-table .fees {
    color: #ff0033;
    text-shadow: 0 0 5px rgba(255, 0, 51, 0.5);
}

.intro-section {
    grid-column: span 6;  /* Full width */
    text-align: center;
    margin-bottom: 40px;
}

.main-title {
    font-size: 2.5em;
    color: var(--text-primary);
    text-shadow:
        0 0 10px var(--glow-positive),
        0 0 20px var(--glow-primary);
    margin-bottom: 20px;
    letter-spacing: 0.1em;
}

.info-section {
    grid-column: span 6;
    background: var(--bg-tertiary);
    padding: 30px;
    border-radius: 15px;
    /* backdrop-filter: blur(5px); */
    border: 1px solid var(--border-secondary);
    box-shadow: 0 0 20px var(--glow-primary);
    margin-bottom: 40px;
    text-align: left;
    line-height: 1.6;
}

.info-section p {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.info-section h2 {
    color: var(--text-primary);
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-primary);
    padding-bottom: 10px;
}

.metrics-strip {
    grid-column: span 6;
    display: inline-flex;  /* Change from flex to inline-flex */
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;  /* Center the content */
    margin: 0 auto 30px;  /* Center the strip with auto margins */
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 15px;
    backdrop-filter: blur(5px);
    border: 1px solid var(--border-secondary);
    max-width: fit-content;  /* Fit to content width */
}

.metric-box {
    flex: 0 1 auto;  /* Don't grow, allow shrink, auto basis */
    min-width: 150px;
    text-align: center;
    padding: 15px;
}

.metric-card {
    text-align: center;
    padding: 15px 25px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
}

.metric-card .label {
    font-size: 0.9em;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.metric-card .value {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--glow-positive);
}

.metric-card .gain {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--color-positive);
}

.metric-card .loss {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--color-negative);
}

.metric-box .label {
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.metric-box .value {
    font-size: 1.8em;
    font-weight: bold;
    text-shadow: 0 0 10px var(--glow-positive);
}

.metric-box .positive {
    color: var(--color-positive);
}

.metric-box .negative {
    color: var(--color-negative);
    border-color: var(--glow-negative);
    text-shadow: 0 0 8px var(--glow-negative);
}

.collapsible-header:hover {
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--glow-positive);
}

.collapsible-content {
    padding: 10px 0;
    transition: all 0.3s ease;
}

/* Contact links styling */
.contact-links {
    grid-column: span 6;
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0 30px 0;
}

.glitch-link {
    color: #00ff00;
    text-decoration: none;
    font-size: 1.2em;
    padding: 10px 20px;
    border: 1px solid rgba(0, 255, 0, 0.2);
    border-radius: 5px;
    background: rgba(0, 20, 0, 0.95);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.glitch-link::before {
    content: attr(href);  /* Uses the href attribute as the text */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(0);
    opacity: 0;
    z-index: -1;
}

.glitch-link:hover {
    border-color: rgba(0, 255, 0, 9);
    box-shadow: 
        0 0 10px rgba(0, 255, 0, 0.2),
        0 0 20px rgba(0, 255, 0, 0.1);
}

.glitch-link::before {
    content: attr(href);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    transform: translateX(0);
    opacity: 0;
    z-index: -1;
}

/* Glitch animation */
@keyframes glitch-anim {
    0% {
        clip-path: inset(40% 0 61% 0);
        transform: translate(-2px, 2px);
    }
    20% {
        clip-path: inset(92% 0 1% 0);
        transform: translate(1px, -3px);
    }
    40% {
        clip-path: inset(43% 0 1% 0);
        transform: translate(-1px, 3px);
    }
    60% {
        clip-path: inset(25% 0 58% 0);
        transform: translate(3px, -1px);
    }
    80% {
        clip-path: inset(54% 0 7% 0);
        transform: translate(-3px, 2px);
    }
    100% {
        clip-path: inset(58% 0 43% 0);
        transform: translate(2px, -2px);
    }
}

.glitch-link:hover::before {
    animation: glitch-anim 0.3s infinite linear alternate-reverse;
    opacity: 0.3;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .contact-links {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .glitch-link {
        width: 80%;
        text-align: center;
    }
}

/* Disclaimer styling */
.disclaimer-strip {
    grid-column: span 6;
    margin: 20px auto;
    padding: 15px 25px;
    background: rgba(255, 0, 0, 0.01);
    border: 1px solid rgba(255, 0, 0, 0.2);
    border-radius: 10px;
    max-width: 800px;
    position: relative;
    overflow: hidden;
}

.disclaimer-strip::before {
    content: attr(data-text);  /* We'll need to add this attribute to the HTML */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff0033;
    opacity: 0;
    z-index: -1;
    padding: inherit;
}

.disclaimer-strip:hover::before {
    animation: glitch-anim 0.3s infinite linear alternate-reverse;
    opacity: 0.3;
}

.disclaimer-text {
    color: #ff0033;
    text-align: center;
    font-size: 0.9em;
    margin: 0;
    line-height: 1.5;
    text-shadow: 0 0 5px rgba(255, 0, 51, 0.5);  /* Add text shadow */
}

.disclaimer-text i {
    margin-right: 10px;
    animation: pulse 2s infinite;
}

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



/* Mobile responsiveness */
@media (max-width: 768px) {
    .disclaimer-strip {
        margin: 15px 10px;
        padding: 12px 15px;
    }

    .disclaimer-text {
        font-size: 0.8em;
    }
}

/* Update console container styles */
.console-container {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: rgba(0, 7, 0, 0.9);
    border-top: 1px solid #333;
    z-index: 1000;
}

/* Add padding to container to account for console height */
.container {
    padding-bottom: 250px;  /* Slightly more than console height to ensure spacing */
}

.console-content {
    height: 200px;
    overflow-y: auto;
    padding: 10px;
    font-family: monospace;
    font-size: 12px;
    color: #00ff00;
    transition: height 0.3s ease;
}

.console-content.collapsed {
    height: 0;
    padding: 0;
    overflow: hidden;
}

/* Update console header style */
.console-header {
    padding: 5px 10px;
    cursor: pointer;
    background: rgba(0, 20, 0, 0.95);
    color: #00ff00;
    display: flex;
    /*justify-content: flex-end; /* Align content to the right */
    align-items: center;
    border-top: 1px solid rgba(0, 255, 0, 0.2);
}

/* Optional: Add hover effect */
.console-header:hover {
    background: rgba(0, 40, 0, 0.95);
}

/* Update toggle icon animation */
.toggle-icon {
    transition: transform 0.3s ease;
}

.collapsed .toggle-icon {
    transform: rotate(180deg);
}




.portfolio-overview {
    grid-column: span 6;
    background: rgba(0, 20, 0, 0.65);
    border-radius: 15px;
    border: 1px solid rgba(0, 255, 0, 0.1);
    padding: 20px;
    margin-bottom: 30px;
}

.overview-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.overview-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.overview-label {
    color: rgba(0, 255, 0, 0.7);
    font-size: 0.9em;
}

.overview-value-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.overview-value {
    color: #00ff00;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
    font-size: 1em;
}

.overview-delta {
    font-size: 0.8em;
    min-width: 70px; /* Ensure consistent width for percentage */
    text-align: right;
}

.overview-value.positive,
.overview-delta.positive {
    color: #00ff00;
}

.overview-value.negative,
.overview-delta.negative {
    color: #ff0033;
    border-color: rgba(255, 0, 51, 0.3);
    text-shadow: 0 0 5px rgba(255, 0, 51, 0.5);
}

@media (max-width: 480px) {
    .overview-row {
        flex-wrap: wrap;
    }
    
    .overview-value-group {
        width: 100%;
        justify-content: space-between;
        margin-top: 5px;
    }
    
    .overview-label {
        width: 100%;
    }
    
    .portfolio-overview {
        padding: 15px;
    }
    
    .overview-grid {
        gap: 12px;
    }
}

/* Common glitch effect base class */
.glitch-element {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Update existing elements to include glitch effect */
.collapsible-header, 
.status-indicator,
.console-header,
.glitch-link,
.disclaimer-strip {
    position: relative;
    overflow: hidden;
}

/* Pseudo-element for glitch effect */
.collapsible-header::before,
.status-indicator::before,
.console-header::before,
.custom-dropdown::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    display: flex;
    align-items: center;
    padding: inherit;
    opacity: 0;
    z-index: -1;
}

/* Hover effects */
.collapsible-header:hover::before,
.status-indicator:hover::before,
.console-header:hover::before,
.custom-dropdown:hover::before {
    animation: glitch-anim 0.3s infinite linear alternate-reverse;
    opacity: 0.3;
}

/* Color-specific styles */
.status-indicator.connected::before {
    color: #00ff00;
}

.status-indicator.disconnected::before {
    color: #ff0033;
}

.metric-box .positive::before {
    color: #00ff00;
}

.metric-box .negative::before {
    color: #ff0033;
}

/* Custom Dropdown Styles */
.custom-dropdown {
    position: relative;
    display: inline-block;
    user-select: none;
}

.dropdown-toggle {
    background: rgba(0, 20, 0, 0.95);
    border: 1px solid rgba(0, 255, 0, 0.2);
    color: #00ff00;
    padding: 8px 12px;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.dropdown-toggle:hover {
    border-color: rgba(0, 255, 0, 0.4);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.1);
}

.dropdown-arrow {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.dropdown-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(0, 20, 0, 0.95);
    border: 1px solid rgba(0, 255, 0, 0.2);
    border-radius: 3px;
    margin-top: 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: rgba(0, 255, 0, 0.1);
}

/* Add backdrop filter for glass effect */
.dropdown-menu {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Holdings Widget Styles */
.holdings-header {
    font-weight: bold;
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.holdings-grid {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(100px, 1fr) minmax(100px, 1fr) minmax(100px, 1fr) minmax(100px, 1fr);
    gap: 10px;
    align-items: center;
    width: 100%;
}

.holdings-row {
    margin: 12px 0;
    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.holdings-row:hover {
    background: rgba(0, 255, 0, 0.05);
}

.asset-name {
    display: flex;
    align-items: center;
    gap: 12px;
}

.asset-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.balance-value {
    font-family: 'Courier New', monospace;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .holdings-grid {
        grid-template-columns: minmax(100px, 1fr) minmax(80px, 1fr) minmax(80px, 1fr);
        gap: 8px;
    }

    .hide-mobile {
        display: none;
    }

    .asset-name {
        gap: 8px;
    }

    .asset-icon {
        width: 20px;
        height: 20px;
    }

    .holdings-row {
        padding: 8px;
        margin: 8px 0;
    }

    .balance-value {
        font-size: 0.9em;
    }
}

/* Small Mobile Screens */
@media (max-width: 480px) {
    .holdings-grid {
        grid-template-columns: minmax(80px, 1fr) minmax(70px, 1fr) minmax(70px, 1fr);
        gap: 6px;
        font-size: 0.9em;
    }

    .asset-icon {
        width: 16px;
        height: 16px;
    }

    .holdings-row {
        padding: 6px;
        margin: 6px 0;
    }

    .balance-value {
        font-size: 0.8em;
    }
}

/* Extra Small Screens */
@media (max-width: 360px) {
    .holdings-grid {
        grid-template-columns: minmax(70px, 1fr) minmax(60px, 1fr) minmax(60px, 1fr);
        gap: 4px;
        font-size: 0.8em;
    }
}

.metrics-strip-beta {
    grid-column: span 6;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 20, 0, 0.65);
    border-radius: 15px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(0, 255, 0, 0.1);
}

@media (max-width: 768px) {
    .metrics-strip-beta {
        flex-direction: column;
        gap: 15px;
    }
}

.overview-delta.negative {
    color: #ff0033;
    border-color: rgba(255, 0, 51, 0.3);
    text-shadow: 0 0 5px rgba(255, 0, 51, 0.5);
}

/* Add this new style to ensure delta arrows match their value color */
.delta {
    text-align: center;
}

/* Ensure the arrow icons inherit the correct color and glow */
.delta[style*="color: #ff0033"] {
    color: #ff0033 !important;
    text-shadow: 0 0 5px rgba(255, 0, 51, 0.5) !important;
}

.delta[style*="color: #00ff00"] {
    color: #00ff00 !important;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5) !important;
}
