/**
 * ===================================================================
 *  PRISM PROTOCOL // QUANTUM TRACKER AESTHETICS
 *  Copyright (c) 2026 Prism Protocol. All rights reserved.
 *  Licensed under the MIT License.
 * ===================================================================
 */

:root {
    --core-dark: #060810;
    --terminal-bg: rgba(9, 14, 25, 0.92);
    --neon-blue: #00d2ff;
    --electric-glow: #0055ff;
    --neon-green: #00ffaa;
    --neon-red: #ff3366;
    --border-line: rgba(0, 210, 255, 0.22);
    --muted-color: #64748b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'JetBrains Mono', monospace;
}

body {
    background-color: var(--core-dark);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    overflow-x: hidden;
    position: relative;
    color: #e2e8f0;
}

#ambient-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.terminal-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    background: var(--terminal-bg);
    border: 1px solid var(--border-line);
    border-radius: 20px;
    padding: 22px;
    backdrop-filter: blur(20px);
    box-shadow: 0 0 45px rgba(0, 85, 255, 0.18), inset 0 0 25px rgba(0, 210, 255, 0.04);
    overflow: hidden;
}

.laser-scanner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-blue), transparent);
    animation: scannerCycle 4s linear infinite;
    pointer-events: none;
}

@keyframes scannerCycle {
    0% { top: 0%; opacity: 0.2; }
    50% { opacity: 0.8; }
    100% { top: 100%; opacity: 0.2; }
}

.terminal-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-hex {
    width: 40px;
    height: 40px;
    background: #09152b;
    border: 2px solid var(--neon-blue);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
}

.brand-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.telemetry {
    font-size: 0.65rem;
    color: var(--neon-blue);
    display: flex;
    align-items: center;
    gap: 6px;
}

.blinking-node {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--neon-blue);
    box-shadow: 0 0 8px var(--neon-blue);
    animation: blinkGlow 1.4s infinite;
}

@keyframes blinkGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.btn-action {
    background: #0c1424;
    border: 1px solid var(--border-line);
    color: var(--neon-blue);
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: 0.2s ease;
}

.btn-action:hover {
    background: var(--neon-blue);
    color: #000;
    box-shadow: 0 0 12px var(--neon-blue);
}

.asset-card {
    background: linear-gradient(180deg, #091020 0%, #040812 100%);
    border: 1px solid rgba(0, 210, 255, 0.16);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
}

.asset-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.66rem;
    color: var(--muted-color);
}

.badge-quantum {
    color: var(--neon-blue);
    background: rgba(0, 210, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(0, 210, 255, 0.25);
}

.valuation-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    margin: 8px 0 14px;
    text-shadow: 0 0 15px rgba(0, 210, 255, 0.3);
}

.input-matrix {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 6px;
}

.input-matrix input, .search-wrapper input {
    background: #0a1120;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 0.75rem;
    outline: none;
    transition: 0.2s;
}

.input-matrix input:focus, .search-wrapper input:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.25);
}

.btn-prime {
    background: linear-gradient(135deg, var(--electric-glow), var(--neon-blue));
    border: none;
    color: #fff;
    font-weight: 800;
    font-size: 0.72rem;
    padding: 0 12px;
    border-radius: 7px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-prime:hover {
    box-shadow: 0 0 14px rgba(0, 85, 255, 0.7);
}

.search-wrapper {
    position: relative;
    margin-bottom: 14px;
}

.search-wrapper input {
    width: 100%;
    padding-left: 32px;
}

.search-badge {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-color);
    font-size: 1rem;
}

.token-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 290px;
    overflow-y: auto;
    padding-right: 4px;
}

.token-container::-webkit-scrollbar {
    width: 3px;
}

.token-container::-webkit-scrollbar-thumb {
    background: rgba(0, 210, 255, 0.25);
}

.token-row {
    background: #091122;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s ease;
}

.token-row:hover {
    background: #0f1c36;
    border-color: rgba(0, 210, 255, 0.3);
    transform: translateY(-1px);
}

.token-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.token-symbol {
    font-weight: 800;
    font-size: 0.9rem;
    color: #fff;
}

.token-label {
    font-size: 0.65rem;
    color: var(--muted-color);
}

.token-stats {
    text-align: right;
}

.price-text {
    font-weight: 700;
    font-size: 0.9rem;
}

.delta-text {
    font-size: 0.72rem;
    font-weight: 600;
}

.positive { color: var(--neon-green); }
.negative { color: var(--neon-red); }

.feed-spinner-box {
    text-align: center;
    padding: 30px;
    color: var(--muted-color);
    font-size: 0.72rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.matrix-loader {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(0, 210, 255, 0.15);
    border-top-color: var(--neon-blue);
    border-radius: 50%;
    animation: rotateLoop 0.8s linear infinite;
}

@keyframes rotateLoop {
    to { transform: rotate(360deg); }
  }



/* ===================================================================
   Additions: animations, icons, footer, mobile
   =================================================================== */

.terminal-shell { animation: shellIn 0.7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes shellIn {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: none; }
}

/* rotating neon border */
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.terminal-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: conic-gradient(from var(--angle), transparent 60%, var(--neon-blue), #6c63ff, transparent 90%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: borderSpin 6s linear infinite;
    pointer-events: none;
}
@keyframes borderSpin { to { --angle: 360deg; } }

.brand-hex { animation: hexPulse 3s ease-in-out infinite; }
@keyframes hexPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 210, 255, 0.35); }
    50%      { box-shadow: 0 0 22px rgba(108, 99, 255, 0.7); }
}

.telemetry-sep { color: var(--muted-color); }
#last-sync { color: var(--muted-color); }

.btn-action:disabled { cursor: wait; opacity: 0.8; }
.btn-action .sync-symbol { display: inline-block; }
.btn-action.is-loading .sync-symbol { animation: rotateLoop 0.8s linear infinite; }

.token-row { animation: rowIn 0.4s ease both; }
@keyframes rowIn {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 1; transform: none; }
}

.token-rank {
    width: 20px;
    font-size: 0.62rem;
    color: var(--muted-color);
    text-align: center;
}

.token-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #0a1120;
}

.feed-spinner-box.is-error { color: var(--neon-red); }

.input-matrix input { min-width: 0; }

.terminal-footer {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 14px;
    font-size: 0.62rem;
    color: var(--muted-color);
}
.terminal-footer a { color: var(--neon-blue); text-decoration: none; }
.terminal-footer a:hover { text-decoration: underline; }

@media (max-width: 420px) {
    .input-matrix { grid-template-columns: 1fr 1fr 1fr; }
    .btn-prime { grid-column: 1 / -1; padding: 9px 0; }
    .valuation-number { font-size: 1.7rem; }
    .terminal-footer { flex-direction: column; align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before { animation: none !important; transition: none !important; }
}

.telemetry { white-space: nowrap; }
