/* Volumetric & Glossy Cyber-Space GRAM Design System for DexRepeat.xyz */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Syne:wght@700;800&display=swap');

:root {
    /* Color Palette - Strictly Turquoise & Dark Space Slate */
    --bg-dark: #03060a; /* Ultra deep space */
    --bg-panel: rgba(8, 20, 30, 0.65);
    --bg-panel-solid: #081219;
    --bg-card: rgba(12, 28, 40, 0.55);
    --accent-cyan: #00f0ff; /* Electric Neon Turquoise */
    --accent-cyan-rgb: 0, 240, 255;
    --accent-turquoise-deep: #0088cc; /* Deep Gram Blue-Turquoise */
    --accent-turquoise-soft: #00e5ff;
    --text-primary: #ffffff;
    --text-muted: #829cb0; /* Soft space-grey */
    --text-success: #00ffcc; /* Profit mint-turquoise */
    --text-danger: #ff3366; /* Loss percentage indicator */
    --border-color: rgba(0, 240, 255, 0.22);
    --border-highlight: rgba(255, 255, 255, 0.25); /* Glossy top edge */
    --transition-speed: 0.2s;
    --font-heading: 'Syne', sans-serif;
    --font-body: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow: hidden;
    position: relative;
    height: 100vh;
    width: 100vw;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(0, 240, 255, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(0, 136, 204, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(8, 20, 30, 1) 0%, #03060a 100%);
    background-attachment: fixed;
}

/* 3D Perspective Grid Background */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(0, 240, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.015) 1px, transparent 1px);
    background-size: 60px 60px;
    background-position: center;
    perspective: 500px;
    transform: perspective(500px) rotateX(60deg) translateY(-25%) translateZ(-100px);
    mask-image: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 80%);
    -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 80%);
    z-index: -1;
    pointer-events: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

/* Full-Screen Terminal Grid Layout */
.terminal-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Header */
.terminal-header {
    height: 70px;
    background: rgba(4, 9, 14, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 1.8rem;
    color: var(--accent-cyan);
    animation: rotateQi 15s linear infinite;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, var(--accent-cyan) 60%, var(--accent-turquoise-deep) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-subtext {
    font-size: 0.55rem;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    font-weight: 800;
}

.logo-domain {
    font-size: 0.7rem;
    color: var(--accent-cyan);
    border: 1px solid var(--border-color);
    padding: 1px 5px;
    border-radius: 5px;
    margin-left: 4px;
    background: rgba(0, 240, 255, 0.05);
}

/* Live Ticker */
.ticker-container {
    display: flex;
    gap: 1.5rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 6px 16px;
    border-radius: 12px;
    align-items: center;
    overflow: hidden;
    max-width: 50%;
}

.ticker-item {
    display: flex;
    gap: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.ticker-label {
    color: var(--text-muted);
    font-weight: 600;
}

.ticker-val {
    color: var(--accent-cyan);
    font-weight: 800;
}

/* Workspace Panels Grid */
.terminal-workspace {
    flex: 1;
    display: grid;
    grid-template-columns: 300px 1fr 360px;
    gap: 1rem;
    padding: 1rem;
    height: calc(100vh - 70px);
    overflow: hidden;
}

.sidebar-left {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    height: 100%;
}

.main-desk {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
    height: 100%;
}

.desk-row-top {
    display: flex;
    gap: 1rem;
    height: 380px;
    min-height: 380px;
}

.sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
    height: 100%;
}

/* Volumetric Panels */
.panel-container {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-top: 1px solid var(--border-highlight);
    border-radius: 20px;
    padding: 1.25rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 240, 255, 0.12);
    padding-bottom: 8px;
    color: white;
}

.panel-title span.badge {
    font-size: 0.75rem;
    background: rgba(0, 240, 255, 0.06);
    color: var(--accent-cyan);
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-family: var(--font-body);
}

/* Account Card details */
.account-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 14px;
    padding: 12px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.info-row .label { color: var(--text-muted); }
.info-row .val { font-weight: bold; color: white; }

.api-badge {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 6px;
    color: var(--text-muted);
}

.api-badge.active {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.05);
}

.exchange-api-box {
    margin-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 8px;
}

/* 3D Tactile Buttons */
.wallet-btn, .tg-btn {
    width: 100%;
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 0.85rem;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
}

.wallet-btn {
    background: linear-gradient(180deg, var(--accent-cyan) 0%, var(--accent-turquoise-deep) 100%);
    color: #03060a;
    box-shadow: 
        0 3px 0 #005f8c,
        0 6px 12px rgba(0, 240, 255, 0.25);
}

.wallet-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 0 #005f8c, 0 8px 15px rgba(0, 240, 255, 0.35);
}

.wallet-btn:active {
    transform: translateY(3px);
    box-shadow: 0 0px 0 #005f8c;
}

.tg-btn {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: var(--accent-cyan);
    box-shadow: 0 3px 0 rgba(0, 240, 255, 0.1);
}

.tg-btn:hover {
    transform: translateY(-1px);
}

.tg-btn:active {
    transform: translateY(3px);
    box-shadow: 0 0px 0 rgba(0, 240, 255, 0.1);
}

/* Carved 3D Inputs */
.swap-card {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 1rem;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.5);
}

.swap-input-container {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: 10px;
    padding: 8px 12px;
    align-items: center;
    box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.7);
}

.swap-input-container input {
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 1.2rem;
    font-family: var(--font-body);
    font-weight: bold;
    flex: 1;
    width: 100%;
}

.swap-asset-select {
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 5px 10px;
    border-radius: 8px;
    font-weight: 800;
}

.swap-arrow {
    display: flex;
    justify-content: center;
    margin: -6px 0 8px 0;
}

.swap-arrow span {
    background: var(--bg-panel-solid);
    border: 1px solid var(--border-color);
    color: var(--accent-cyan);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

.swap-btn {
    width: 100%;
    background: linear-gradient(180deg, var(--accent-cyan) 0%, var(--accent-turquoise-deep) 100%);
    border: none;
    color: #03060a;
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 1rem;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: uppercase;
    box-shadow: 0 4px 0 #005f8c;
}

.swap-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 0 #005f8c, 0 8px 15px rgba(0, 240, 255, 0.3);
}

.swap-btn:active {
    transform: translateY(3px);
    box-shadow: 0 0px 0 #005f8c;
}

/* 3D Charts Card */
.chart-placeholder {
    background: rgba(0, 0, 0, 0.45);
    border-radius: 16px;
    border: 1px solid rgba(0, 240, 255, 0.1);
    box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.7);
    padding: 8px;
    overflow: hidden;
}

/* Custom Table style */
.table-container {
    overflow-y: auto;
    flex: 1;
}

.positions-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

.positions-table th {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: var(--text-muted);
    font-weight: 600;
}

.positions-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

/* Scroll List */
.traders-scroll-list {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.trader-card-mini {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 14px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.trader-card-mini:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.03);
}

.channels-mini-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.channel-btn-tab {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}

.channel-btn-tab.active {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

/* Verifier progression panel */
.verify-progress {
    background: rgba(0, 0, 0, 0.4);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
}

.verify-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.8);
}

.verify-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-turquoise-soft));
}

.verify-log {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--accent-cyan);
    height: 90px;
    overflow-y: auto;
    border-top: 1px solid rgba(0, 240, 255, 0.15);
    padding-top: 8px;
    margin-top: 8px;
    line-height: 1.3;
}

/* Collateral container */
.collateral-manager {
    background: rgba(0, 240, 255, 0.02);
    border: 1px dashed var(--border-color);
    border-radius: 14px;
    padding: 12px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

/* Switch toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    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: #222;
    transition: .3s;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
}

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

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

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

/* Signals list */
.signals-scroll-feed {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.signal-card-mini {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 10px;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.signal-card-mini.new {
    border-color: var(--accent-cyan);
    animation: pulseCyan 2s infinite;
}

/* Modal styling */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-panel-solid);
    border: 1px solid var(--accent-cyan);
    border-top: 1px solid var(--border-highlight);
    border-radius: 24px;
    padding: 2rem;
    width: 90%;
    max-width: 480px;
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.8),
        0 0 30px rgba(0, 240, 255, 0.25);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover {
    color: white;
}

.text-glow {
    text-shadow: 0 0 8px var(--accent-cyan);
}

/* Animations */
@keyframes rotateQi {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

@keyframes pulseCyan {
    0% { box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.3); }
    70% { box-shadow: 0 0 0 10px rgba(0, 240, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 240, 255, 0); }
}

/* Toast Message */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(8, 20, 30, 0.95);
    border-left: 4px solid var(--accent-cyan);
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.toast.success { border-left-color: var(--text-success); }
.toast.danger { border-left-color: var(--text-danger); }
.toast.warning { border-left-color: var(--accent-cyan); }

/* Responsive adjustments */
@media (max-width: 1200px) {
    body {
        overflow-y: auto;
    }
    .terminal-layout {
        height: auto;
        overflow: visible;
    }
    .terminal-workspace {
        grid-template-columns: 280px 1fr;
        height: auto;
        overflow: visible;
    }
    .sidebar-right {
        grid-column: span 2;
        height: 600px;
    }
}

@media (max-width: 800px) {
    .terminal-workspace {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }
    .sidebar-left, .main-desk, .sidebar-right {
        grid-column: span 1;
        height: auto;
    }
    .desk-row-top {
        flex-direction: column;
        height: auto;
    }
    .ticker-container {
        display: none;
    }
}
