/* ====== GLOBAL ====== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: #05060a;
    color: #f5f5f5;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    padding: 16px;
}

/* ====== TOP BAR ====== */

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 16px;
}

.controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn {
    border-radius: 999px;
    border: 1px solid #5a4cff;
    padding: 8px 18px;
    font-size: 14px;
    cursor: pointer;
    background: transparent;
    color: #e5e5ff;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn.primary {
    background: linear-gradient(135deg, #8b5cff, #4c8dff);
    border-color: #a78bfa;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(128, 90, 213, 0.5);
}

.btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(129, 140, 248, 0.7);
}

.btn.secondary {
    background: rgba(31, 41, 55, 0.8);
    border-color: #374151;
    color: #e5e7eb;
}

.btn.secondary.active {
    border-color: #8b5cff;
    background: rgba(55, 65, 81, 0.9);
}

.btn.disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* ====== PROGRESS ====== */

.progress-wrap {
    flex: 1;
    min-width: 220px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #111827;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 4px;
}

#progressFill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #22c55e, #a3e635);
    transition: width 0.2s ease;
}

#progressText {
    font-size: 12px;
    color: #9ca3af;
}

/* ====== OVERLAY ====== */

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.overlay.hidden {
    display: none;
}

.overlay-text {
    font-size: 20px;
    font-weight: 600;
    color: #e5e7eb;
    padding: 12px 24px;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.9);
    border: 1px solid #4b5563;
}

/* ====== TOKENS LIST ====== */

.token-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.token-card {
    background: radial-gradient(circle at top left, #111827, #020617);
    border-radius: 18px;
    border: 1px solid rgba(55, 65, 81, 0.8);
    padding: 16px 18px 10px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.55);
}

.token-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.token-title .symbol {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.token-title .quote {
    font-size: 13px;
    color: #9ca3af;
    margin-left: 4px;
}

.token-spreads {
    text-align: right;
    font-size: 13px;
    color: #9ca3af;
}

.token-spreads span {
    font-weight: 600;
}

.pos {
    color: #22c55e;
}

.neg {
    color: #f97373;
}

.token-body {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 960px) {
    .token-body {
        grid-template-columns: 1fr;
    }
}

/* ====== LEG CARD ====== */

.leg-card {
    background: #020617;
    border-radius: 16px;
    padding: 10px 12px;
    border: 1px solid #1f2937;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.leg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.exchange-name {
    color: #e5e7eb;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.04em;
    font-size: 13px;
}

.exchange-name:hover {
    text-decoration: underline;
}

.badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    border-width: 1px;
    border-style: solid;
}

.badge-long {
    background: rgba(34, 197, 94, 0.12);
    border-color: #22c55e;
    color: #bbf7d0;
}

.badge-short {
    background: rgba(239, 68, 68, 0.12);
    border-color: #ef4444;
    color: #fecaca;
}

.leg-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.label {
    color: #9ca3af;
}

.value {
    color: #e5e7eb;
    font-variant-numeric: tabular-nums;
}

/* ====== SUMMARY CARD ====== */

.summary-card {
    background: #020617;
    border-radius: 16px;
    padding: 10px 12px;
    border: 1px solid #1f2937;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
}

/* ====== MORE SPREADS ====== */

.more-toggle {
    margin-top: 10px;
    font-size: 12px;
    color: #9ca3af;
    cursor: pointer;
}

.more-toggle:hover {
    color: #e5e7eb;
}

.more-container {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.more-container.hidden {
    display: none;
}

.more-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

@media (max-width: 960px) {
    .more-row {
        grid-template-columns: 1fr;
    }
}

/* ====== MISC ====== */

.empty {
    color: #6b7280;
    text-align: center;
    padding: 40px 0;
}
