:root {
    --bg-color: #0b0c10;
    --panel-bg: rgba(25, 27, 36, 0.6);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8;
    --silver-gradient: linear-gradient(135deg, #e2e8f0 0%, #94a3b8 100%);
    --sell-color: #34d399; /* Green for Sell */
    --buy-color: #f87171; /* Red for Buy */
    --ecom-color: #fbbf24; /* Yellow/Gold for ECOM */
    --internal-color: #818cf8; /* Indigo for Internal */
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(148, 163, 184, 0.1) 0px, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 1.5rem;
    overflow-x: hidden;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 1.5rem;
    background: var(--silver-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--silver-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--sell-color);
    font-weight: 600;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background-color: var(--sell-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--sell-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* Controls / Sidebar */
.controls {
    padding: 1.5rem;
    position: sticky;
    top: 1.5rem;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--panel-border);
}

.settings-header h2 {
    font-size: 1.25rem;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.mode-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #4b5563;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--accent-color);
}

input:checked + .slider:before {
    transform: translateX(16px);
}

.slider.round {
    border-radius: 20px;
}

.slider.round:before {
    border-radius: 50%;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #4b5563;
}

.status-dot.connected {
    background-color: var(--sell-color);
    box-shadow: 0 0 5px var(--sell-color);
}

.status-dot.error {
    background-color: var(--buy-color);
    box-shadow: 0 0 5px var(--buy-color);
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-group h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.control-group h4 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 1rem 0 0.5rem 0;
}

.input-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.input-row label {
    flex: 1;
    display: flex;
    flex-direction: column;
    font-size: 0.75rem;
    color: var(--text-secondary);
    gap: 0.25rem;
}

.input-row input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.input-row input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.primary-btn {
    width: 100%;
    padding: 0.75rem;
    margin-top: 1rem;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.primary-btn:hover {
    background: #0284c7;
}

/* Display Area */
.display-area {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.price-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* Price Cards */
.price-card {
    padding: 1.25rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.price-card.interactive:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
}

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

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.badge.accent {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-color);
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

.price-row .label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.price-row .value {
    font-size: 1.15rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s;
}

.price-row.sell .value { color: var(--sell-color); }
.price-row.buy .value { color: var(--buy-color); }
.price-row.ecom .value { color: var(--ecom-color); font-size: 1rem; }
.price-row.internal .value { color: var(--internal-color); font-size: 1rem; }

.divider {
    border: 0;
    height: 1px;
    background: var(--panel-border);
    margin: 0.75rem 0;
}

/* Animations */
@keyframes highlightUpdate {
    0% { filter: brightness(1); transform: scale(1); }
    50% { filter: brightness(1.8); transform: scale(1.02); }
    100% { filter: brightness(1); transform: scale(1); }
}

@keyframes inputFlash {
    0% { background-color: rgba(52, 211, 153, 0.4); color: #fff; border-color: var(--sell-color); box-shadow: 0 0 10px var(--sell-color); }
    100% { background-color: rgba(0, 0, 0, 0.2); color: var(--text-primary); border-color: var(--panel-border); box-shadow: none; }
}

.updated {
    animation: highlightUpdate 0.6s ease-out;
}

input.updated {
    animation: inputFlash 0.8s ease-out;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    .controls {
        position: static;
    }
}

@keyframes flashUp { 0% { color: #22c55e; filter: brightness(1.5); text-shadow: 0 0 10px #22c55e; } 100% { } }
@keyframes flashDown { 0% { color: #ef4444; filter: brightness(1.5); text-shadow: 0 0 10px #ef4444; } 100% { } }
.flash-up { animation: flashUp 1s ease-out; }
.flash-down { animation: flashDown 1s ease-out; }

/* Custom Scrollbar Utilities */
.table-header::-webkit-scrollbar,
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.table-header,
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
