:root {
    /* Color Palette */
    --primary: #00B8D4;          /* Electric Cyan */
    --secondary: #1C2A35;        /* Deep Space Gray */
    --accent: #DFFA4C;           /* Vivid Citron */
    --positive: #18F2B2;         /* Signal Green */
    --warning: #FFB300;          /* Warning Amber */
    --negative: #FF3D71;         /* Alert Red */
    --soft-slate: #607D8B;       /* Soft Slate */
    --background: #0D1821;       /* Dark Background */
    --card-bg: #192734;          /* Card Background */
    --text-primary: #E9ECEF;     /* Primary Text */
    --text-secondary: #ADB5BD;   /* Secondary Text */
    --border-color: #2A3A4A;     /* Border Color */
}

/* Base Styles */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Typography */
.numeric {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
}

/* Header & Navigation */
header {
    background-color: var(--secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.navbar {
    padding: 0.5rem 2rem;
}

.navbar-brand {
    color: var(--text-primary);
    padding: 0;
}

.brand-container {
    display: flex;
    align-items: center;
}

.brand-logo {
    height: 40px;
    margin-right: 10px;
}

.brand-text h1 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 700;
}

.brand-text h1 span {
    color: var(--primary);
}

.brand-tagline {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}

.navbar-nav .nav-link {
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    transition: color 0.2s ease;
}

.navbar-nav .nav-link:hover, 
.navbar-nav .nav-link.active {
    color: var(--primary);
}

/* Wallet Connection */
.wallet-section {
    margin-left: 1.5rem;
}

.wallet-section #connect-wallet {
    background-color: var(--primary);
    border-color: var(--primary);
    font-weight: 500;
}

.wallet-section .connected-details {
    display: flex;
    align-items: center;
    background-color: rgba(0, 184, 212, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    color: var(--primary);
}

.address-display {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
}

.connection-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: var(--positive);
    border-radius: 50%;
    margin-left: 10px;
}

/* Consistent styling for wallet action buttons */
.connected-details .btn {
    font-size: 0.7rem !important;
    padding: 0.2rem 0.4rem !important;
    line-height: 2;
    border-width: 1px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    vertical-align: middle;
    box-sizing: border-box;
}

.connected-details .btn i {
    font-size: 0.7rem;
}

/* Ensure all outline button variants have identical dimensions */
.connected-details .btn-outline-secondary,
.connected-details .btn-outline-info,
.connected-details .btn-outline-danger {
    border-width: 1px !important;
    border-style: solid !important;
}

/* Main Content Sections */
main {
    padding: 2rem 0;
}

.content-section {
    margin-bottom: 3rem;
}

.section-header {
    margin-bottom: 2rem;
}

/* Asset Header */
.asset-header {
    background-color: var(--secondary);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.asset-selector .btn {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.asset-info {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.price-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.time-display {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.countdown {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    color: var(--warning);
}

.view-toggle .btn {
    border-color: var(--primary);
    color: var(--primary);
    font-size: 0.85rem;
}

.view-toggle .btn.active {
    background-color: var(--primary);
    color: var(--secondary);
}

/* Trade Card */
.trade-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.card-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Conviction Slider */
.conviction-slider-container {
    position: relative;
    margin: 2rem 0;
    padding: 0 1rem;
    margin-bottom: 20px;
}

.leverage-indicator {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 184, 212, 0.1);
    color: var(--primary);
    padding: 0.25rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
}

.leverage-value {
    color: var(--accent);
}

.conviction-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.bearish-label {
    color: var(--negative);
    font-weight: 600;
}

.bullish-label {
    color: var(--positive);
    font-weight: 600;
}

.form-range {
    width: 100%;
    padding: 0;
    margin: 0;
    height: 6px;
    background: linear-gradient(to right, var(--negative), var(--primary), var(--positive));
    border-radius: 8px;
}

.form-range::-webkit-slider-thumb {
    background: var(--accent);
    box-shadow: 0 0 8px rgba(223, 250, 76, 0.6);
}

.price-targets {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-family: 'IBM Plex Mono', monospace;
}

.price-target {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.price-target.current {
    color: var(--accent);
    font-weight: 600;
    position: relative;
}

.price-target.current::after {
    content: "^";
    position: absolute;
    left: 50%;
    top: -15px;
    transform: translateX(-50%);
    color: var(--accent);
}

/* Position Size Slider */
.position-size-container {
    padding: 0 1rem;
    margin: 1.5rem 0;
}

.position-size-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.current-size-display {
    text-align: center;
    margin-top: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent);
    font-family: 'IBM Plex Mono', monospace;
}

/* Payment Selection */
.payment-selection label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.form-select {
    background-color: var(--secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.form-select:focus {
    box-shadow: 0 0 0 0.25rem rgba(0, 184, 212, 0.25);
    border-color: var(--primary);
}

/* Option Preview */
.option-preview .card {
    background-color: rgba(0, 184, 212, 0.05);
    border: 1px solid rgba(0, 184, 212, 0.2);
}

.option-action {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
}

.option-details {
    margin-bottom: 1rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.detail-label {
    color: var(--text-secondary);
}

.detail-value {
    font-family: 'IBM Plex Mono', monospace;
    color: var(--text-primary);
}

.no-liquidation-badge {
    background-color: rgba(24, 242, 178, 0.1);
    color: var(--positive);
    text-align: center;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.no-liquidation-badge i {
    color: var(--accent);
}

/* Trade Actions */
#trade-now-btn {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--secondary);
    font-weight: 600;
    transition: all 0.2s ease;
}

#trade-now-btn:hover:not(:disabled) {
    background-color: #c9e44c;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(223, 250, 76, 0.3);
}

#trade-now-btn:disabled,
#adv-trade-btn:disabled {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #fff !important;
    cursor: not-allowed;
    opacity: 0.65;
    transform: none;
    box-shadow: none;
}

#trade-now-btn.btn-warning,
#adv-trade-btn.btn-warning {
    background-color: #f8d7da !important;
    border-color: #f5c6cb !important;
    color: #721c24 !important;
    font-weight: 600;
}

/* Insufficient Funds Warning */
#insufficient-funds-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
    color: #856404;
}

#insufficient-funds-warning i {
    color: #ffc107;
}

#balance-details {
    background-color: rgba(255, 193, 7, 0.05);
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-family: 'IBM Plex Mono', monospace;
    border-left: 3px solid #ffc107;
}

/* Options Table */
.options-table-container {
    margin: 1.5rem 0;
    overflow-x: auto;
    display: none;
    padding: 0 1rem;
}

.options-table {
    color: var(--text-primary);
}

.options-table thead th {
    background-color: var(--secondary);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    border-color: var(--border-color);
}

.options-table tbody td {
    border-color: var(--border-color);
    vertical-align: middle;
    font-size: 0.9rem;
}

.option-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.option-row:hover {
    background-color: rgba(0, 184, 212, 0.05);
}

.option-row.selected {
    background-color: rgba(0, 184, 212, 0.1);
    border-left: 3px solid var(--primary);
}

.select-option-btn {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--text-primary);
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
}

/* Positions Section */
.countdown-display {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    color: var(--warning);
    padding: 0.5rem 1rem;
    background-color: rgba(255, 179, 0, 0.1);
    border-radius: 2rem;
}

.position-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.position-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.position-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
}

.collateral-address {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.position-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.position-detail-item {
    flex: 1 0 calc(50% - 1.5rem);
}

.position-detail-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.position-detail-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.1rem;
    font-weight: 500;
}

.position-status {
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-block;
}

.status-negative {
    background-color: rgba(255, 61, 113, 0.1);
    color: var(--negative);
}

.status-positive {
    background-color: rgba(24, 242, 178, 0.1);
    color: var(--positive);
}

.position-pnl {
    margin-left: 1rem;
}

.pnl-negative {
    color: var(--negative);
}

.pnl-positive {
    color: var(--positive);
}

.position-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}

.no-positions-message {
    text-align: center;
    padding: 2rem;
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    color: var(--text-secondary);
}

.no-positions-message a {
    color: var(--primary);
    text-decoration: none;
}

/* History Section */
.filters {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.history-table-container {
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    padding: 1.5rem;
    overflow-x: auto;
}

.history-table {
    color: var(--text-primary);
}

.history-table thead th {
    background-color: var(--secondary);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    border-color: var(--border-color);
}

.history-table tbody td {
    border-color: var(--border-color);
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Fix for striped table rows */
.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(22, 59, 87, 0.7); /* A lighter version of your --secondary color */
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    color: var(--text-primary);
}


#no-history-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Modals */
.modal-content {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.modal-header {
    border-bottom-color: var(--border-color);
}

.modal-footer {
    border-top-color: var(--border-color);
}

.btn-close {
    color: var(--text-primary);
    filter: invert(1) brightness(200%);
}

.countdown-timer {
    text-align: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--warning);
    margin-bottom: 1rem;
}

.details-card {
    background-color: var(--secondary);
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    height: 100%;
}

.details-card h6 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-align: center;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.meaning-list {
    list-style-type: none;
    padding-left: 0;
}

.meaning-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.meaning-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
}

.profit-scenarios {
    background-color: var(--secondary);
    border-radius: 0.5rem;
    padding: 1.25rem;
}

.profit-scenarios h6 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.profit-scenarios ul {
    list-style-type: none;
    padding-left: 0;
}

.profit-scenarios li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.profit-scenarios li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
}

.chart-placeholder {
    background-color: var(--secondary);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

.settlement-info h6, .settlement-scenarios h6 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.settlement-info ul, .settlement-scenarios ul {
    list-style-type: none;
    padding-left: 0;
}

.settlement-info li, .settlement-scenarios li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.settlement-info li::before, .settlement-scenarios li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .asset-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .asset-info {
        width: 100%;
    }
    
    .view-toggle {
        width: 100%;
        display: flex;
        justify-content: center;
    }
    
    .position-detail-item {
        flex: 1 0 100%;
    }
    
    .position-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 1rem;
    }
    
    .wallet-section {
        margin-left: 0;
        margin-top: 1rem;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filters .row > div {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .row > [class*="col-"] {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* Loading spinners and data states */
#loading-profitable-trades, #no-profitable-trades-data {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Analytics Dashboard */
.analytics-dashboard {
    background-color: rgba(0, 184, 212, 0.05);
    border: 1px solid rgba(0, 184, 212, 0.2);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
}

.analytics-title {
    color: var(--primary);
    font-weight: 600;
}

.analytics-title i {
    margin-right: 0.5rem;
}

.analytics-controls button {
    margin-left: 0.5rem;
    border-color: var(--primary);
    color: var(--primary);
}

.analytics-controls button:hover {
    background-color: var(--primary);
    color: var(--secondary);
}

/* Analytics section toggle styling */
#toggle-analytics-section {
    transition: transform 0.2s ease;
}

#toggle-analytics-section:hover {
    transform: scale(1.1);
}

/* Analytics content transition */
.analytics-content,
.support-resistance-section,
.pc-ratio-dials,
.analytics-status,
.analytics-chart-section {
    transition: opacity 0.3s ease, max-height 0.3s ease;
    overflow: hidden;
}

/* Support/Resistance Section */
.support-resistance-section {
    background-color: rgba(25, 39, 52, 0.3);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.section-subtitle i {
    margin-right: 0.5rem;
    color: var(--primary);
}

.levels-display-container {
    position: relative;
    padding: 0.5rem 0;
}

.price-range-bar {
    position: relative;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 0.25rem;
    padding: 0.5rem;
}

.price-range-labels {
    display: flex;
    justify-content: space-between;
    padding-top: 0.75rem;
    margin-bottom: 0.5rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.price-range-line {
    position: absolute;
    top: 50%;
    left: 0.5rem;
    right: 0.5rem;
    height: 2px;
    background: linear-gradient(to right, var(--negative), var(--primary), var(--positive));
    border-radius: 1px;
    transform: translateY(-50%);
}

/* Analytics Levels Overlay - Updated for new position */
.analytics-levels-overlay {
    position: absolute;
    top: 50%;
    left: 0.5rem;
    right: 0.5rem;
    height: 20px;
    pointer-events: none;
    z-index: 2;
    transform: translateY(-50%);
}

.level-marker {
    position: absolute;
    width: 2px;
    height: 20px;
    top: 0;
    pointer-events: auto;
    cursor: help;
    z-index: 3;
    border-radius: 1px;
}

.level-marker.support {
    background-color: var(--positive);
    box-shadow: 0 0 4px rgba(24, 242, 178, 0.6);
}

.level-marker.resistance {
    background-color: var(--negative);
    box-shadow: 0 0 4px rgba(255, 61, 113, 0.6);
}

.level-marker.gamma-wall {
    background-color: var(--accent);
    box-shadow: 0 0 4px rgba(223, 250, 76, 0.6);
}

.level-marker::before {
    content: '';
    position: absolute;
    left: 50%;
    top: -8px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 6px solid currentColor;
}

.level-marker::after {
    content: attr(data-level-name);
    position: absolute;
    left: 50%;
    bottom: -25px;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.65rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.level-marker:hover::after {
    opacity: 1;
}

/* Nearby level indicators */
.level-marker.nearby-level {
    opacity: 0.7;
    height: 15px;
    background: linear-gradient(to bottom, currentColor 0%, transparent 100%);
    box-shadow: none;
}

.level-marker.nearby-level::before {
    display: none;
}

.level-marker.nearby-level::after {
    bottom: -20px;
    font-size: 0.6rem;
    opacity: 0.8;
}

/* Put/Call Ratio Dials */
.pc-ratio-dials {
    background-color: rgba(25, 39, 52, 0.3);
    border-radius: 0.5rem;
    padding: 1rem;
}

.ratio-dial {
    text-align: center;
    cursor: help;
    transition: transform 0.2s ease;
}

.ratio-dial:hover {
    transform: scale(1.05);
}

.dial-container {
    position: relative;
    margin: 0 auto 0.5rem;
    width: 60px;
    height: 30px; /* Half height for semicircle */
    overflow: hidden; /* Clip the bottom half */
}

.dial-circle {
    width: 60px;
    height: 60px; /* Keep full circle for proper gradient */
    border: 3px solid var(--border-color);
    border-radius: 50%;
    position: absolute;
    top: 0; /* Position at top of container */
    left: 0;
    background: conic-gradient(
        from 270deg, 
        var(--negative) 0deg 60deg,      /* Red: 9-11 o'clock (bearish) */
        var(--accent) 60deg 120deg,      /* Yellow: 11-1 o'clock (neutral) */
        var(--positive) 120deg 180deg    /* Green: 1-3 o'clock (bullish) */
    );
}

/* Remove the ::after mask since we're using overflow: hidden */
.dial-circle::after {
    display: none;
}

.dial-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 22px; /* Slightly shorter for semicircle */
    background-color: white;
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(90deg);
    transition: transform 0.3s ease;
    z-index: 4;
}

.dial-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

.dial-value {
    display: none;
}

.dial-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    text-align: center;
}

.dial-value-inline {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.7rem;
}

.ratio-legend {
    text-align: center;
    font-size: 0.75rem;
}

.ratio-legend .legend-bull {
    color: var(--positive);
}

.ratio-legend .legend-neutral {
    color: var(--accent);
}

.ratio-legend .legend-bear {
    color: var(--negative);
}

/* Analytics Status */
.analytics-status {
    text-align: center;
    padding: 0.5rem;
    background-color: rgba(25, 39, 52, 0.5);
    border-radius: 0.25rem;
}

/* Analytics Chart Section */
.analytics-chart-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 1rem;
}

.chart-container {
    background-color: var(--secondary);
    border-radius: 0.5rem;
    padding: 1rem;
}

.tradingview-widget-container {
    height: 400px;
    width: 100%;
}

#tradingview_chart {
    height: 100%;
    width: 100%;
}

.levels-legend {
    background-color: rgba(25, 39, 52, 0.5);
    border-radius: 0.5rem;
    padding: 1rem;
}

.levels-legend h6 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.levels-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
}

.level-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 0.25rem;
    font-size: 0.8rem;
}

.level-name {
    color: var(--text-secondary);
}

.level-price {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    color: var(--text-primary);
}

.level-distance {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.level-item.support .level-price {
    color: var(--positive);
}

.level-item.resistance .level-price {
    color: var(--negative);
}

.level-item.gamma-wall .level-price {
    color: var(--accent);
}

/* Analytics Loading States */
.analytics-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.analytics-error {
    text-align: center;
    padding: 1rem;
    background-color: rgba(255, 61, 113, 0.1);
    border: 1px solid rgba(255, 61, 113, 0.3);
    border-radius: 0.25rem;
    color: var(--negative);
    font-size: 0.9rem;
}

/* Responsive adjustments for analytics */
@media (max-width: 768px) {
    .pc-ratio-dials .row {
        justify-content: center;
    }
    
    .pc-ratio-dials .col-3 {
        flex: 0 0 auto;
        width: auto;
        margin: 0 0.5rem;
    }
    
    .dial-container {
        width: 50px;
        height: 25px; /* Half height for mobile semicircle */
    }
    
    .dial-circle {
        width: 50px;
        height: 50px; /* Keep full circle for proper gradient */
    }
    
    .dial-needle {
        height: 18px; /* Shorter for mobile */
    }
    
    .analytics-controls {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .analytics-controls button {
        margin-left: 0;
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
    
    .tradingview-widget-container {
        height: 300px;
    }
    
    .levels-list {
        grid-template-columns: 1fr;
    }
}

/* Tooltip enhancements for level markers */
.level-tooltip {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    min-width: 150px;
}

.level-tooltip.show {
    opacity: 1;
}

.level-tooltip .tooltip-title {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.level-tooltip .tooltip-price {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.level-tooltip .tooltip-description {
    font-size: 0.75rem;
    color: #ccc;
    line-height: 1.3;
}

/* Auto-refresh toggle styling */
.form-check-input {
    background-color: var(--secondary);
    border-color: var(--border-color);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Order countdown styling */
.order-countdown {
    font-weight: bold;
    color: var(--warning);
}

/* Add warning color when order is about to expire */
.order-countdown.expiring-soon {
    color: var(--negative);
    animation: flash 1s infinite;
}

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

.status-badge {
    padding: 0.3rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-settled {
    background-color: rgba(24, 242, 178, 0.1);
    color: var(--positive);
}
.status-expired {
    background-color: rgba(255, 179, 0, 0.1);
    color: var(--warning);
}
.status-canceled {
    background-color: rgba(96, 125, 139, 0.1);
    color: var(--soft-slate);
}
.status-open {
    background-color: rgba(0, 184, 212, 0.1);
    color: var(--primary);
}

.collateralisation-address {
    font-size: 0.85rem;
    margin: -5px 0 8px 0;
    color: #777;
}

.collateralisation-address a {
    color: #6c757d;
    text-decoration: underline;
}

.collateralisation-address a:hover {
    color: #495057;
}

/* Batch capacity styles */
.batch-capacity h6 {
    margin-bottom: 0.5rem;
}

.progress {
    height: 6px;
    background-color: var(--border-color);
    border-radius: 8px;
}

.progress-bar {
    background-color: var(--primary);
    border-radius: 8px;
}

/* Change progress bar color as it fills */
.progress-bar[style*="width: 8"] {
    background-color: var(--warning);
}

.progress-bar[style*="width: 9"], 
.progress-bar[style*="width: 100"] {
    background-color: var(--negative);
}

.batch-info {
    background-color: rgba(0, 184, 212, 0.05);
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.batch-info i {
    color: var(--primary);
}

/* Add to modal styles */
#batch-modal-info {
    background-color: rgba(0, 184, 212, 0.05);
    border-left: 3px solid var(--primary);
    padding: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Error alert styling */
#trade-error-alert {
    background-color: rgba(255, 61, 113, 0.1);
    border-color: var(--negative);
    color: var(--negative);
    font-weight: 500;
}

#trade-error-alert i {
    color: var(--negative);
}

/* Add to the status badge styles */
.status-expired {
    background-color: rgba(255, 61, 113, 0.1);
    color: var(--negative);
    padding: 0.3rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Add style for the settle button */
#settle-option-btn {
    background-color: var(--primary);
    border-color: var(--primary);
    margin-right: auto; /* This will push it to the left */
}

#settle-option-btn:hover {
    background-color: #0096a7;
}

/* Style for the settled success button */
#settle-option-btn.btn-success {
    background-color: var(--positive);
    border-color: var(--positive);
}

/* Swap information display */
.swap-info {
    background-color: rgba(0, 184, 212, 0.05);
    border: 1px solid rgba(0, 184, 212, 0.2);
    border-radius: 0.5rem;
}

.swap-title {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
}

.swap-rate {
    background-color: var(--secondary);
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-family: 'IBM Plex Mono', monospace;
}

.swap-amount {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    color: var(--text-primary);
}

.swap-direction {
    background-color: rgba(22, 59, 87, 0.5);
    padding: 0.5rem;
    border-radius: 0.25rem;
}

/* Scoreboard styles */
.scoreboard-table-container {
    overflow-x: auto;
}

.scoreboard-table th {
    background-color: var(--secondary);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Consolidated Streak column styling */
.scoreboard-table .streak-cell {
    text-align: left;
    font-family: 'IBM Plex Mono', monospace;
    color: var(--accent);
    font-weight: 600;
    cursor: help;
    transition: all 0.2s ease;
}

.scoreboard-table .streak-cell:hover {
    background-color: rgba(0, 184, 212, 0.1);
    transform: scale(1.02);
}

/* Special highlighting for impressive streaks */
.scoreboard-table .streak-impressive {
    color: var(--positive) !important;
    text-shadow: 0 0 3px rgba(24, 242, 178, 0.3);
}

/* Enhanced tooltip styling for streak breakdown */
.tooltip-inner {
    max-width: 280px;
    background-color: var(--secondary);
    border: 2px solid var(--primary);
    color: var(--text-primary);
    padding: 12px 16px;
    font-size: 0.9rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.scoreboard-table .rank-1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.05));
    border-left: 3px solid #FFD700;
}

.scoreboard-table .rank-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.1), rgba(192, 192, 192, 0.05));
    border-left: 3px solid #C0C0C0;
    color: #C0C0C0 !important; /* Silver text for better visibility */
}

.scoreboard-table .rank-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.1), rgba(205, 127, 50, 0.05));
    border-left: 3px solid #CD7F32;
}

.scoreboard-table tr:not(.rank-1):not(.rank-2):not(.rank-3) {
    color: var(--text-primary);
}

/* Beta flag styling */
.beta-flag-container {
    background-color: rgba(0, 123, 255, 0.1);
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 123, 255, 0.2);
}

.beta-flag {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
}

.beta-label {
    background-color: #007bff;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.beta-info {
    color: #555;
}

.liquidity-info {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
}

.renewal-info {
    color: #666;
    margin-left: auto;
    font-style: italic;
}

@media (max-width: 767px) {
    .beta-flag {
        justify-content: center;
        text-align: center;
    }
    
    .renewal-info {
        margin-left: 0;
        width: 100%;
        text-align: center;
    }
}

/* Open Positions Leaderboard styles */
.open-positions-table-container {
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    padding: 1.5rem;
    overflow-x: auto;
    margin-bottom: 2rem;
}

.open-positions-table {
    color: var(--text-primary);
}

.open-positions-table thead th {
    background-color: var(--secondary);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    border-color: var(--border-color);
}

.open-positions-table tbody td {
    border-color: var(--border-color);
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Add pulsing animation for positions close to expiry */
@keyframes pulse-warning {
    0% { color: var(--warning); }
    50% { color: var(--negative); }
    100% { color: var(--warning); }
}

.open-positions-table .text-danger {
    animation: pulse-warning 2s infinite;
    font-weight: bold;
}

#loading-open-positions, #no-open-positions-data {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
}

/* Weekly Prizes Banner */
.weekly-prizes-banner {
    background: linear-gradient(90deg, #0c1223 0%, #1e3a8a 100%);
    color: white;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.weekly-prizes-banner::before {
    content: "";
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(45deg, rgba(255,215,0,0.1) 0%, rgba(255,215,0,0) 70%);
    z-index: 0;
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) }
    20%, 100% { transform: translateX(100%) }
}

.prize-banner-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.5rem;
    position: relative;
    z-index: 1;
}

.prize-title {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    font-size: 1.2rem;
    color: #ffd700;
    margin-bottom: 0.2rem;
}

.prize-description {
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.prize-info {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Top 3 Medal Highlighting */
.rank-1 {
    background-color: rgba(255, 215, 0, 0.1);
    font-weight: 600;
}

.rank-2 {
    background-color: rgba(192, 192, 192, 0.1);
    font-weight: 600;
}

.rank-3 {
    background-color: rgba(205, 127, 50, 0.1);
    font-weight: 600;
}

/* Add this to your existing CSS */
.scoreboard-table th i.bi-info-circle {
    font-size: 0.8rem;
    margin-left: 3px;
    cursor: help;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.scoreboard-table th i.bi-info-circle:hover {
    opacity: 1;
}

/* Conviction Slider Tick Marks - Fixed Alignment */
datalist {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 5px;
    padding: 0;
    /* Fix alignment issues by adjusting positioning */
    position: relative;
    left: 0;
    right: 0;
}

datalist option {
    position: relative;
    width: 0; /* Change from 1px to 0 to avoid extra space */
    padding: 0;
    margin: 0;
}

datalist option::before {
    content: '';
    position: absolute;
    width: 2px;
    height: 8px;
    background-color: var(--text-secondary);
    transform: translateX(-50%); /* Center the tick mark */
    top: 0;
}

/* Improve slider track to match ticks placement */
.form-range {
    width: 100%;
    padding: 0;
    margin: 0;
    height: 6px;
    background: linear-gradient(to right, var(--negative), var(--primary), var(--positive));
    border-radius: 8px;
}

/* Add container padding to ensure everything aligns properly */
.conviction-slider-container {
    position: relative;
    margin: 2rem 0;
    padding: 0 1rem;
    margin-bottom: 20px; /* More space for the ticks */
}

/* Make sure the slider and datalist are in perfect alignment */
.conviction-slider-container input[type="range"],
.conviction-slider-container datalist {
    width: 100%;
    box-sizing: border-box;
}

.conviction-slider-container input[type="range"],
.position-size-container input[type="range"] {
    background: var(--secondary);
    border-radius: 0.25rem;
    height: 6px;
}

.conviction-slider-container input[type="range"]::-webkit-slider-thumb,
.position-size-container input[type="range"]::-webkit-slider-thumb {
    background: var(--primary);
    border: 2px solid var(--background);
    border-radius: 50%;
    cursor: pointer;
}

/* ETH Wrap Section Styling */
.eth-wrap-section .card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.eth-wrap-section .card-title {
    color: var(--primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.eth-wrap-section .card-title i {
    color: var(--primary);
    margin-right: 0.5rem;
}

.eth-wrap-section .card-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.eth-wrap-section .form-control {
    background-color: var(--secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.eth-wrap-section .form-control:focus {
    background-color: var(--secondary);
    border-color: var(--primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 184, 212, 0.25);
}

.eth-wrap-section .form-text {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.eth-wrap-section .quick-amounts {
    margin-top: 0.5rem;
}

.eth-wrap-section .quick-amounts .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.eth-wrap-section .quick-amounts .btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

#wrap-eth-btn {
    background-color: transparent;
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 500;
    transition: all 0.2s ease;
}

#wrap-eth-btn:hover {
    background-color: var(--primary);
    color: var(--background);
}

#wrap-eth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#wrap-status {
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

#wrap-status.alert-info {
    background-color: rgba(0, 184, 212, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

#wrap-status.alert-success {
    background-color: rgba(24, 242, 178, 0.1);
    border-color: var(--positive);
    color: var(--positive);
}

#wrap-status.alert-danger {
    background-color: rgba(255, 61, 113, 0.1);
    border-color: var(--negative);
    color: var(--negative);
}

#loading-scoreboard {
    padding: 2rem;
    color: var(--text-primary);
}

#no-scoreboard-data {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
}

/* Profitable Trades Table */
.profitable-trades-table-container {
    margin-top: 1rem;
}

.profitable-trades-table th {
    color: var(--text-primary);
    background-color: var(--secondary);
    border-color: var(--border-color);
    font-weight: 600;
    white-space: nowrap;
}

.profitable-trades-table {
    color: var(--text-primary);
}

.profitable-trades-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--secondary);
    border-color: var(--border-color);
}

.profitable-trades-table tbody td {
    border-color: var(--border-color);
    vertical-align: middle;
}

.profitable-trades-table .rank-1 {
    background-color: rgba(255, 215, 0, 0.1); /* Gold */
}

.profitable-trades-table .rank-2 {
    background-color: rgba(192, 192, 192, 0.1); /* Silver */
}

.profitable-trades-table .rank-3 {
    background-color: rgba(205, 127, 50, 0.1); /* Bronze */
}

.profitable-trades-table tr:not(.rank-1):not(.rank-2):not(.rank-3) {
    background-color: transparent;
}

.profitable-trades-table th i.bi-info-circle {
    color: var(--primary);
    margin-left: 4px;
    cursor: help;
    transition: color 0.2s ease;
}

.profitable-trades-table th i.bi-info-circle:hover {
    color: var(--accent);
}

.trade-description {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    background-color: rgba(0, 184, 212, 0.1);
    color: var(--primary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid rgba(0, 184, 212, 0.2);
}

#loading-profitable-trades, #no-profitable-trades-data {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
}

/* Checkbox Styling */
.form-check {
    background-color: rgba(0, 184, 212, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
    padding-left: 2rem;
    transition: all 0.2s ease;
}

.form-check:hover {
    border-color: var(--primary);
    background-color: rgba(0, 184, 212, 0.08);
}

.form-check-input {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    width: 1.2em;
    height: 1.2em;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 184, 212, 0.25);
}

.form-check-label {
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
}

/* Approval Checkbox Specific Styling */
#exact-approval-checkbox + label {
    margin-bottom: 0.5rem;
}

.form-check .form-text {
    margin-top: 0.5rem;
}

.form-check .form-text small {
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Price Alerts Styling */
.asset-header {
    margin-bottom: 1rem;
}

/* ============================================
   TROLLBOX STYLES
   ============================================ */

.trollbox-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    height: 400px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    z-index: 1050;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    font-family: 'Inter', sans-serif;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    opacity: 1;
}

.trollbox-widget.minimized {
    height: 50px;
    transition: height 0.3s ease;
}

.trollbox-widget.hidden {
    display: none;
}

/* Add a subtle fade-in effect for state changes */
.trollbox-widget.state-loading {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.trollbox-widget.state-ready {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.trollbox-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border-radius: 12px 12px 0 0;
    padding: 12px 16px;
    display: flex;
    justify-content: between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--border-color);
}

.trollbox-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.trollbox-title i {
    color: var(--primary);
    font-size: 16px;
}

.online-count {
    background: var(--primary);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    margin-left: auto;
    margin-right: 8px;
}

.trollbox-controls {
    display: flex;
    gap: 4px;
}

.trollbox-controls .btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
}

.trollbox-controls .btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.trollbox-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.trollbox-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}

.trollbox-messages::-webkit-scrollbar {
    width: 4px;
}

.trollbox-messages::-webkit-scrollbar-track {
    background: transparent;
}

.trollbox-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.trollbox-messages::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.message {
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--primary);
    font-size: 13px;
    line-height: 1.4;
    position: relative;
    animation: fadeInMessage 0.3s ease;
}

@keyframes fadeInMessage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.own-message {
    background: rgba(0, 212, 170, 0.15);
    border-left-color: var(--primary);
    margin-left: 20px;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.message-author {
    font-weight: 600;
    color: var(--primary);
    font-size: 12px;
}

.message-author.clickable-username {
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: underline;
    text-decoration-color: transparent;
}

.message-author.clickable-username:hover {
    color: var(--text-primary);
    text-decoration-color: var(--primary);
    transform: translateY(-1px);
}

.message-time {
    color: var(--text-secondary);
    font-size: 11px;
    margin-left: auto;
}

.message-content {
    color: var(--text-primary);
    word-wrap: break-word;
}

.system-message {
    background: rgba(255, 193, 7, 0.1);
    border-left-color: #ffc107;
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 6px 12px;
    font-size: 12px;
}

.system-message i {
    color: #ffc107;
    margin-right: 6px;
}

.trollbox-input-container {
    border-top: 1px solid var(--border-color);
    padding: 12px;
}

.trollbox-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.user-badge {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.user-badge.anonymous {
    background: var(--text-secondary);
}

.trollbox-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.trollbox-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}

.trollbox-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 184, 212, 0.2);
}

.trollbox-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.trollbox-send-btn {
    background: var(--primary);
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.trollbox-send-btn:hover:not(:disabled) {
    background: #0096a7;
    transform: translateY(-1px);
}

.trollbox-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.trollbox-status {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
}

.trollbox-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 1049;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 184, 212, 0.4);
    transition: all 0.3s ease;
}

.trollbox-toggle:hover {
    background: #0096a7;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 184, 212, 0.5);
}

.chat-notification {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--background);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .trollbox-widget {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 300px;
        border-radius: 12px 12px 0 0;
        border-bottom: none;
    }
    
    .trollbox-widget.minimized {
        height: 50px;
    }
    
    .trollbox-toggle {
        bottom: 80px; /* Above mobile navigation if any */
        right: 16px;
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .trollbox-widget {
        height: 250px;
    }
    
    .message {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .trollbox-input {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* Animation for new messages */
@keyframes messageHighlight {
    0% {
        background: rgba(0, 212, 170, 0.3);
    }
    100% {
        background: rgba(255, 255, 255, 0.05);
    }
}

.message.new-message {
    animation: messageHighlight 2s ease;
}

/* Rate limit warning */
.rate-limit-warning {
    background: rgba(255, 71, 87, 0.1);
    border-left-color: #ff4757;
    color: #ff4757;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 12px;
}

.typing-dots {
    display: flex;
    gap: 2px;
}

.typing-dot {
    width: 4px;
    height: 4px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes typingAnimation {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Content filter and error message styling */
.content-filter-warning {
    background: rgba(255, 179, 0, 0.1);
    border-left-color: var(--warning);
    color: var(--warning);
}

.error-message {
    background: rgba(255, 61, 113, 0.1);
    border-left-color: var(--negative);
    color: var(--negative);
}

/* Loading indicator for message pagination */
.system-message.loading-more {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    margin: 4px 0;
    animation: fadeInMessage 0.3s ease-out;
}

.system-message.loading-more i {
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Expired position styling */
.expired-position {
    background-color: rgba(255, 179, 0, 0.05) !important;
    border-left: 3px solid var(--warning);
    font-weight: 500;
    position: relative;
}

.expired-position::before {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: var(--warning);
    color: white;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    z-index: 10;
}

/* PnL tooltips enhancement */
.pnl-tooltip {
    cursor: help;
    position: relative;
    border-bottom: 1px dotted;
}

.pnl-tooltip:hover {
    opacity: 0.8;
}

/* Settlement price specific styling */
.settlement-price-info {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.settlement-price-badge {
    background-color: rgba(0, 184, 212, 0.1);
    color: var(--primary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

/* Enhanced tooltip styles */
.tooltip {
    font-size: 0.875rem;
    max-width: 300px;
}

.tooltip-inner {
    background-color: #2c3e50;
    color: #ffffff;
    border-radius: 6px;
    padding: 8px 12px;
    font-weight: 500;
    text-align: left;
    line-height: 1.4;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: #2c3e50;
}

.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: #2c3e50;
}

.tooltip.bs-tooltip-left .tooltip-arrow::before {
    border-left-color: #2c3e50;
}

.tooltip.bs-tooltip-right .tooltip-arrow::before {
    border-right-color: #2c3e50;
}

/* Sort controls styling */
.sort-controls {
    margin-bottom: 1rem;
}

.sort-controls .btn-group .btn {
    border-color: var(--border-color);
    color: var(--text-secondary);
    background-color: var(--card-bg);
}

.sort-controls .btn-group .btn.active,
.sort-controls .btn-group .btn:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Loading states */
.loading-overlay {
    position: relative;
}

.loading-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-overlay.dark::after {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Responsive design for mobile */
@media (max-width: 768px) {
    .open-positions-table {
        font-size: 0.8rem;
    }
    
    .open-positions-table th,
    .open-positions-table td {
        padding: 0.5rem 0.25rem;
    }
    
    .expired-position::before {
        display: none; /* Hide the overlay text on mobile for better readability */
    }
    
    .position-details {
        flex-direction: column;
        gap: 1rem;
    }
    
    .position-detail-item {
        flex: 1 0 100%;
    }
}