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

:root {
    --bg-main: #0B0E14;
    --bg-glass: rgba(18, 22, 31, 0.65);
    --bg-glass-hover: rgba(25, 30, 42, 0.8);
    --border-glass: rgba(255, 255, 255, 0.08);
    
    --color-text-main: #E2E8F0;
    --color-text-muted: #94A3B8;
    
    --neon-cyan: #00F0FF;
    --neon-purple: #8A2BE2;
    --neon-green: #10B981;
    --neon-red: #EF4444;
    --neon-orange: #F59E0B;
}

body {
    background-color: var(--bg-main) !important;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(138, 43, 226, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(0, 240, 255, 0.08) 0%, transparent 50%);
    background-attachment: fixed;
    font-family: 'Outfit', sans-serif;
    color: var(--color-text-main);
}

/* Base Layout & Sidebar */
#wrapper {
    min-height: 100vh;
}
#sidebar-wrapper {
    width: 260px;
    background: rgba(11, 14, 20, 0.95) !important;
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-glass) !important;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
#page-content-wrapper {
    margin-left: 260px;
    transition: margin-left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Collapsed Sidebar State */
body.sidebar-collapsed #sidebar-wrapper {
    transform: translateX(-260px);
}
body.sidebar-collapsed #page-content-wrapper {
    margin-left: 0;
}

/* Sidebar Toggle Trigger Button with Animation */
.sidebar-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--neon-cyan);
    border-radius: 8px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    padding: 0;
}
.sidebar-toggle-btn:hover {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
    transform: scale(1.06);
}
.sidebar-toggle-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 18px;
    height: 13px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-toggle-icon span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--neon-cyan);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Hover Animation: Expand Outer Lines */
.sidebar-toggle-btn:hover .sidebar-toggle-icon span:nth-child(1) {
    transform: translateY(-1px);
}
.sidebar-toggle-btn:hover .sidebar-toggle-icon span:nth-child(3) {
    transform: translateY(1px);
}
/* Collapsed State: Morph into Forward Arrow */
body.sidebar-collapsed .sidebar-toggle-icon span:nth-child(1) {
    transform: translateY(3px) rotate(45deg);
    width: 60%;
    transform-origin: left center;
}
body.sidebar-collapsed .sidebar-toggle-icon span:nth-child(2) {
    transform: scaleX(1.1);
}
body.sidebar-collapsed .sidebar-toggle-icon span:nth-child(3) {
    transform: translateY(-3px) rotate(-45deg);
    width: 60%;
    transform-origin: left center;
}
.sidebar-heading {
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    border-bottom: 1px solid var(--border-glass) !important;
}
.list-group-item {
    background: transparent !important;
    color: var(--color-text-muted) !important;
    transition: all 0.3s ease;
    border-left: 3px solid transparent !important;
}
.list-group-item:hover, .list-group-item.active {
    color: var(--color-text-main) !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border-left: 3px solid var(--neon-cyan) !important;
}
.navbar {
    background: rgba(11, 14, 20, 0.8) !important;
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-glass) !important;
}

/* Glassmorphism Cards */
.card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    color: var(--color-text-main);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255,255,255,0.15);
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-glass);
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--color-text-main) !important;
}

/* Typography & Colors */
.text-primary { color: var(--neon-cyan) !important; }
.text-success { color: var(--neon-green) !important; }
.text-danger { color: var(--neon-red) !important; }
.text-warning { color: var(--neon-orange) !important; }
.text-info { color: var(--neon-cyan) !important; }
.text-muted { color: var(--color-text-muted) !important; }

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}
.btn-success { background-color: rgba(16, 185, 129, 0.2); color: var(--neon-green); border: 1px solid var(--neon-green); }
.btn-success:hover { background-color: var(--neon-green); color: #000; }
.btn-warning { background-color: rgba(245, 158, 11, 0.2); color: var(--neon-orange); border: 1px solid var(--neon-orange); }
.btn-warning:hover { background-color: var(--neon-orange); color: #000; }
.btn-secondary { background-color: rgba(148, 163, 184, 0.1); color: var(--color-text-main); border: 1px solid var(--color-text-muted); }
.btn-secondary:hover { background-color: rgba(148, 163, 184, 0.3); color: #fff; }
.btn-danger { background-color: rgba(239, 68, 68, 0.2); color: var(--neon-red); border: 1px solid var(--neon-red); }
.btn-danger:hover { background-color: var(--neon-red); color: #000; box-shadow: 0 0 15px rgba(239, 68, 68, 0.5); }

/* Tables */
.table-dark {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
    border-color: var(--border-glass);
    color: var(--color-text-main);
}
table th {
    color: var(--color-text-muted) !important;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--border-glass) !important;
}
table td {
    vertical-align: middle;
}

/* Badges */
.badge {
    font-weight: 600;
    font-size: 0.85em;
    padding: 0.5em 0.8em;
    border-radius: 6px;
    letter-spacing: 0.5px;
}
.badge.bg-primary { background: rgba(0, 240, 255, 0.2) !important; color: var(--neon-cyan) !important; border: 1px solid rgba(0, 240, 255, 0.3); }
.badge.bg-success { background: rgba(16, 185, 129, 0.2) !important; color: var(--neon-green) !important; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge.bg-danger { background: rgba(239, 68, 68, 0.2) !important; color: var(--neon-red) !important; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge.bg-warning { background: rgba(245, 158, 11, 0.2) !important; color: var(--neon-orange) !important; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge.bg-secondary { background: rgba(148, 163, 184, 0.1) !important; color: var(--color-text-muted) !important; border: 1px solid rgba(148, 163, 184, 0.2); }
.badge.bg-light { background: rgba(255, 255, 255, 0.85) !important; color: #000 !important; }

/* Progress Bars */
.progress {
    background-color: rgba(255, 255, 255, 0.05);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar {
    transition: width 0.5s ease;
}
.progress-bar.bg-info {
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple)) !important;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

/* Animations */
@keyframes pulse-cyan {
    0% { text-shadow: 0 0 4px rgba(0, 240, 255, 0.2); }
    50% { text-shadow: 0 0 15px rgba(0, 240, 255, 0.8); }
    100% { text-shadow: 0 0 4px rgba(0, 240, 255, 0.2); }
}

.live-price-pulse {
    animation: pulse-cyan 1.5s infinite;
    color: var(--neon-cyan);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.6);
}
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 240, 255, 0.4);
}

/* Orders and Lattice Scrollable Containers */
.orders-scroll-container {
    max-height: 290px;
    overflow-y: auto;
}
.vein-orders-scroll-container {
    max-height: 170px;
    overflow-y: auto;
}

/* Rung styling */
.rung-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    padding: 6px 10px;
    transition: all 0.2s ease;
}
.rung-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(0, 240, 255, 0.3);
}

/* In-Between Gap: Current Stage Orders Box */
.current-stage-orders-box {
    background: rgba(11, 14, 20, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5);
}
.order-item-row {
    background: rgba(18, 22, 31, 0.7) !important;
    transition: all 0.2s ease;
}
.order-item-row:hover {
    background: rgba(25, 30, 42, 0.95) !important;
    border-color: rgba(0, 240, 255, 0.35) !important;
    transform: translateX(2px);
}

/* Live Update Flash Animations */
@keyframes flash-up-anim {
    0% {
        background-color: rgba(16, 185, 129, 0.45) !important;
        color: #ffffff !important;
        text-shadow: 0 0 10px #10B981, 0 0 20px #10B981;
        box-shadow: 0 0 14px rgba(16, 185, 129, 0.7);
        border-color: #10B981 !important;
    }
    100% {
        background-color: transparent;
        text-shadow: none;
        box-shadow: none;
    }
}

@keyframes flash-down-anim {
    0% {
        background-color: rgba(239, 68, 68, 0.45) !important;
        color: #ffffff !important;
        text-shadow: 0 0 10px #EF4444, 0 0 20px #EF4444;
        box-shadow: 0 0 14px rgba(239, 68, 68, 0.7);
        border-color: #EF4444 !important;
    }
    100% {
        background-color: transparent;
        text-shadow: none;
        box-shadow: none;
    }
}

@keyframes flash-update-anim {
    0% {
        background-color: rgba(0, 240, 255, 0.45) !important;
        color: #ffffff !important;
        text-shadow: 0 0 10px #00F0FF, 0 0 20px #00F0FF;
        box-shadow: 0 0 15px rgba(0, 240, 255, 0.7);
        border-color: #00F0FF !important;
    }
    100% {
        background-color: transparent;
        text-shadow: none;
        box-shadow: none;
    }
}

.flash-up {
    animation: flash-up-anim 0.8s cubic-bezier(0.1, 0.9, 0.2, 1) forwards !important;
}

.flash-down {
    animation: flash-down-anim 0.8s cubic-bezier(0.1, 0.9, 0.2, 1) forwards !important;
}

.flash-update {
    animation: flash-update-anim 0.8s cubic-bezier(0.1, 0.9, 0.2, 1) forwards !important;
}

/* Flash Targets Base Transition Styling */
#mshm-tx, #mshm-tnx, #proj-p-tx, #proj-p-tnx, #proj-m-tx, #proj-m-tnx,
#pct-t2, #pct-t1, #pct-bp, #pct-mt1, #pct-mt2,
#vt2, #vt1, #vbp, #vmt1, #vmt2,
#v-stage, #v-case-text, #v-stage-badge, #v-case-badge {
    display: inline-block;
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Symbol Drawer & Offcanvas */
.offcanvas.bg-dark {
    background-color: #0E131F !important;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.7);
}
.symbol-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.symbol-item:hover {
    background: rgba(0, 240, 255, 0.08);
    border-color: rgba(0, 240, 255, 0.35);
    transform: translateX(-3px);
}
.symbol-item.active {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}
.btn-xs {
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.5;
    border-radius: 0.25rem;
}

.nav-tabs-sessions {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.nav-tabs-sessions .nav-link {
    color: var(--color-text-muted);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}
.nav-tabs-sessions .nav-link:hover {
    color: var(--color-text-main);
    border-bottom-color: rgba(255, 255, 255, 0.3);
}
.nav-tabs-sessions .nav-link.active {
    background: transparent;
    color: #ffffff;
    border-bottom: 2px solid #ffffff;
    font-weight: 600;
}

/* Better contrast for placeholders on dark backgrounds */
.form-control::placeholder {
    color: rgba(226, 232, 240, 0.5) !important;
    opacity: 1;
}
