:root {
    --bg-dark: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.36);

    --primary-accent: #38bdf8;
    /* Sky Blue */
    --success-color: #34d399;
    /* Emerald */
    --danger-color: #f87171;
    /* Red */

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: radial-gradient(circle at top right, #1e293b, #0f172a);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Glassmorphism Cards */
.card,
.modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
}

.card-header,
.card-footer,
.modal-header,
.modal-footer {
    background: #062E52 !important;
    border-color: var(--glass-border) !important;
}

footer {
    background: #062E52 !important;
}

/* Inputs & Selects */
.form-select,
.form-control,
.input-group-text {
    background-color: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-primary) !important;
    backdrop-filter: blur(4px);
}

.form-select:focus,
.form-control:focus {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

/* Typography & Colors */
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.025em;
}

.text-muted {
    color: var(--text-secondary) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

/* In-Card Elements */
.bg-white {
    background: transparent !important;
}

.bg-light {
    background: rgba(255, 255, 255, 0.05) !important;
}

.bg-body-tertiary {
    background: rgba(0, 0, 0, 0.2) !important;
}

.border-light-subtle {
    border-color: var(--glass-border) !important;
}

.border-secondary {
    border-color: var(--glass-border) !important;
}

/* Tables */
.table {
    --bs-table-color: var(--text-primary);
    --bs-table-bg: transparent;
    --bs-table-border-color: #9B9BA8;
    /* Softer borders */
}

/* Ensure border-0 class removes borders from cells */
.table tr.border-0 td,
.table tr.border-0 th {
    border-bottom: 0 !important;
    border-color: transparent !important;
}

.table th {
    font-weight: 600;
    color: #17D9FF !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.9rem;
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

.table td {
    vertical-align: middle;
    font-family: 'Roboto Mono', monospace;
    /* Monospace for numbers */
    font-size: 0.85rem;
}

.table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
    /* Subtle hover */
}

.table tr.border-bottom,
.table .border-bottom {
    border-color: #9B9BA8 !important;
}

/* Order Book Depth Visuals */
.depth-row-ask {
    background: linear-gradient(90deg, transparent 0%, rgba(248, 113, 113, 0.05) 100%);
}

.depth-row-bid {
    background: linear-gradient(90deg, transparent 0%, rgba(74, 222, 128, 0.05) 100%);
}

/* Buttons */
.btn-ghost {
    color: var(--text-secondary);
    background: #263852 !important;
    border: 1px solid transparent;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: #324b6e !important;
    border-color: var(--glass-border);
}

.btn-ghost.active {
    background: rgba(56, 189, 248, 0.15);
    color: var(--primary-accent) !important;
    border-color: rgba(56, 189, 248, 0.3);
}

/* Custom Utils */
.small-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Global Overrides for Dark Mode Visibility */
.text-success {
    color: #4ade80 !important;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.2);
}

.text-danger {
    color: #f87171 !important;
    text-shadow: 0 0 10px rgba(248, 113, 113, 0.2);
}

.text-warning {
    color: #facc15 !important;
    text-shadow: 0 0 10px rgba(250, 204, 21, 0.2);
}

.text-info {
    color: #60a5fa !important;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.2);
}

/* Ensure Analyze button matches request */
.btn-info {
    background-color: #263852 !important;
    border-color: #263852 !important;
    color: white !important;
}

/* Use Bright Blue for Info */

/* Custom Variants */
.text-success-custom {
    color: #4ade80 !important;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.3);
}

.text-danger-custom {
    color: #f87171 !important;
    text-shadow: 0 0 10px rgba(248, 113, 113, 0.3);
}

.text-primary {
    color: #38bdf8 !important;
}

.small-value {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.text-warning-custom,
.text-secondary-accent {
    color: #facc15 !important;
    /* Yellow-400 */
    text-shadow: 0 0 10px rgba(250, 204, 21, 0.3);
}

.text-bright-blue {
    color: #60a5fa !important;
    /* Blue-400 */
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
}

.text-bright-green {
    color: #4ade80 !important;
    /* Green-400 */
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.3);
}

.text-bright-red {
    color: #f87171 !important;
    /* Red-400 */
    text-shadow: 0 0 10px rgba(248, 113, 113, 0.3);
}

/* ApexCharts Dark Theme Overrides */
.apexcharts-tooltip {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.36);
    color: #f8fafc !important;
}

.apexcharts-tooltip-title {
    background: #0f172a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    font-family: 'Inter', sans-serif !important;
    color: #f8fafc !important;
}

.apexcharts-tooltip-text {
    color: #f8fafc !important;
}

.apexcharts-tooltip-text-value,
.apexcharts-tooltip-text-z-value {
    color: #f8fafc !important;
    font-family: 'Roboto Mono', monospace;
    font-weight: 600;
}

.apexcharts-tooltip-text-label {
    color: #94a3b8 !important;
    /* Secondary text */
}

.apexcharts-text {
    fill: #94a3b8 !important;
    /* Axis labels */
}

.apexcharts-legend-text {
    color: #f8fafc !important;
    /* Legend text */
    fill: #f8fafc !important;
    font-family: 'Inter', sans-serif !important;
}

.apexcharts-gridline {
    stroke: rgba(255, 255, 255, 0.05) !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Animations */
.fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* AI Banner Specific */
.bg-dark {
    background: rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

/* Table Padding Override */
.table th,
.table td {
    padding: 0.75rem 1rem !important;
}

/* Spinner */
.spinner-border {
    --bs-spinner-width: 2rem;
    --bs-spinner-height: 2rem;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .5;
    }
}

/* Custom Background Subtles for Badges */
.bg-bright-green-subtle {
    background-color: rgba(74, 222, 128, 0.15) !important;
    color: #4ade80 !important;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.bg-bright-red-subtle {
    background-color: rgba(248, 113, 113, 0.15) !important;
    color: #f87171 !important;
    background-color: rgba(248, 113, 113, 0.15) !important;
    color: #f87171 !important;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.table tr.support-last-row td {
    border-bottom: 1px solid #9B9BA8 !important;
    border-top: 1px solid #9B9BA8 !important;
}