/* RESET & GLOBAL TOKENS */
:root {
    --bg-dark: #131722;
    --bg-card: #1E222D;
    --bg-card-hover: #2A2E39;
    --border-color: #2A2E39;
    
    --text-primary: #D1D4DC;
    --text-muted: #787B86;
    --text-white: #FFFFFF;
    
    --bullish-green: #089981;
    --bearish-red: #F23645;
    
    --accent-blue: #2962FF;
    --accent-blue-hover: #1E53E5;
    
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-display: 'Outfit', sans-serif;

    --navbar-height: 54px;
    --ticker-height: 48px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-card-hover) transparent;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background-color: var(--bg-card-hover);
    border: 2px solid transparent;
    border-radius: 5px;
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background-color: #3A3E49;
}

::selection {
    background: rgba(41, 98, 255, 0.35);
    color: var(--text-white);
}

:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

/* TOP NAVBAR */
.navbar {
    height: var(--navbar-height);
    background-color: #171B26;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
}

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

.logo-badge {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 153, 129, 0.15);
    border: 1px solid rgba(8, 153, 129, 0.3);
    flex-shrink: 0;
}

.token-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.logo-icon {
    font-size: 18px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.token-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.token-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
    color: var(--text-white);
}

.token-symbol {
    font-weight: 600;
    font-size: 12px;
    color: var(--text-muted);
}

.chain-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background-color: rgba(42, 46, 57, 0.6);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-primary);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--text-muted);
}

.status-dot.online {
    background-color: var(--bullish-green);
    box-shadow: 0 0 6px var(--bullish-green);
}

.ca-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}

.ca-label {
    color: var(--text-muted);
}

.ca-address {
    font-family: var(--font-mono);
    color: #90A4AE;
    background: #12151E;
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-icon-copy {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.btn-icon-copy:hover {
    color: var(--text-white);
    background-color: var(--bg-card-hover);
}

.btn-icon-copy svg {
    width: 13px;
    height: 13px;
}

.link-explorer {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #2962FF;
    text-decoration: none;
    margin-left: 4px;
    transition: color 0.2s ease;
}

.link-explorer:hover {
    color: #5383FF;
}

.link-explorer svg {
    width: 12px;
    height: 12px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Trade on BasedBot Button */
.btn-trade-bot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #00C6FF 0%, #0072FF 100%);
    color: #FFFFFF;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 114, 255, 0.35);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-trade-bot:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 114, 255, 0.55);
    color: #FFFFFF;
}

.btn-trade-bot svg {
    width: 14px;
    height: 14px;
}

/* Built by Tag */
.built-by-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #1E222D;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 11px;
}

.built-by-label {
    color: var(--text-muted);
}

.built-by-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-white);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.built-by-link:hover {
    color: var(--accent-blue);
}

.built-by-link svg {
    fill: currentColor;
}

.simulation-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(8, 153, 129, 0.1);
    color: var(--bullish-green);
    border: 1px solid rgba(8, 153, 129, 0.3);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.simulation-badge svg {
    width: 14px;
    height: 14px;
}

.simulation-badge.is-paused {
    background: rgba(247, 147, 26, 0.1);
    color: #F7931A;
    border-color: rgba(247, 147, 26, 0.35);
}

.btn-icon {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background-color: var(--bg-card-hover);
    color: var(--text-white);
}

.btn-icon:disabled {
    cursor: wait;
    opacity: 0.55;
}

.btn-icon svg {
    width: 14px;
    height: 14px;
}

.live-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-icon-play {
    display: none;
}

.live-stream-toggle.is-paused {
    color: #F7931A;
    border-color: rgba(247, 147, 26, 0.5);
}

.live-stream-toggle.is-paused .live-icon-pause {
    display: none;
}

.live-stream-toggle.is-paused .live-icon-play {
    display: flex;
}

/* TICKER BAR */
.ticker-bar {
    height: var(--ticker-height);
    background-color: #131722;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ticker-bar::-webkit-scrollbar {
    display: none;
}

.ticker-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

.ticker-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-val-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-val {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 14px;
    color: var(--text-white);
}

.price-change {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
}

.price-change.positive {
    background-color: rgba(8, 153, 129, 0.15);
    color: var(--bullish-green);
}

.ticker-val {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.ticker-val.highlight {
    color: var(--text-white);
}

.skeleton {
    display: inline-block;
    min-width: 92px;
    min-height: 14px;
    color: transparent !important;
    border-radius: 4px;
    background: linear-gradient(
        90deg,
        var(--bg-card) 25%,
        var(--bg-card-hover) 50%,
        var(--bg-card) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.price-val.skeleton {
    min-width: 86px;
}

@keyframes skeleton-pulse {
    from {
        background-position: 200% 0;
    }
    to {
        background-position: -200% 0;
    }
}

.badge-chain {
    color: #90CAF9;
}

.ticker-divider {
    width: 1px;
    height: 20px;
    background-color: var(--border-color);
}

/* MAIN TERMINAL GRID */
.terminal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    height: calc(100vh - var(--navbar-height) - var(--ticker-height));
    width: 100%;
    transition: grid-template-columns 0.25s ease;
}

.terminal-grid.trades-collapsed {
    grid-template-columns: minmax(0, 1fr) 0;
}

.terminal-grid.trades-collapsed .side-panel {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* CHART SECTION */
.chart-section {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    height: 100%;
    background-color: var(--bg-dark);
}

.chart-toolbar {
    height: 38px;
    min-height: 38px;
    flex-shrink: 0;
    background-color: #171B26;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.chart-toolbar::-webkit-scrollbar {
    display: none;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.tf-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tf-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.04);
}

.tf-btn.active {
    color: var(--accent-blue);
    background-color: rgba(41, 98, 255, 0.12);
}

.btn-action-sm {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action-sm:hover {
    background-color: var(--bg-card-hover);
    color: var(--text-white);
}

.btn-action-sm.active {
    background-color: var(--accent-blue);
    color: var(--text-white);
    border-color: var(--accent-blue);
}

.btn-action-sm svg {
    width: 12px;
    height: 12px;
}

.indicator-menu {
    position: relative;
}

.indicator-menu summary {
    list-style: none;
}

.indicator-menu summary::-webkit-details-marker {
    display: none;
}

.indicator-popover {
    position: fixed;
    z-index: 500;
    top: 142px;
    right: 352px;
    width: 230px;
    max-height: min(520px, calc(100vh - 160px));
    overflow-y: auto;
    padding: 10px;
    background: rgba(23, 27, 38, 0.98);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
}

.trades-collapsed .indicator-popover {
    right: 12px;
}

.indicator-popover-title {
    margin-bottom: 7px;
    color: var(--text-white);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.indicator-popover label {
    display: grid;
    grid-template-columns: 16px 10px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    min-height: 28px;
    color: var(--text-primary);
    font-size: 11px;
    cursor: pointer;
}

.indicator-popover label:hover {
    color: var(--text-white);
}

.indicator-popover input {
    accent-color: var(--accent-blue);
}

.indicator-swatch {
    width: 10px;
    height: 3px;
    border-radius: 999px;
}

.swatch-ath { background: #F5C542; }
.swatch-atl { background: #FF7043; }
.swatch-24h { background: #26C6DA; }
.swatch-ema20 { background: #42A5F5; }
.swatch-ema50 { background: #AB47BC; }
.swatch-vwap { background: #00BCD4; }
.swatch-sma20 { background: #66BB6A; }
.swatch-sma50 { background: #FFA726; }
.swatch-sma200 { background: #EC407A; }
.swatch-bollinger { background: #7E57C2; }
.swatch-sr { background: #B0BEC5; }
.swatch-pivot { background: #FFCA28; }

.chart-main-wrapper {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
}

.tv-chart-container {
    width: 100%;
    height: 100%;
}

/* Initial blockchain loading state */
.chart-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(19, 23, 34, 0.92);
    backdrop-filter: blur(3px);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.chart-loading-overlay.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--bg-card-hover);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: loading-spin 0.8s linear infinite;
}

.loading-spinner.small {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.loading-text {
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
}

.loading-progress {
    appearance: none;
    -webkit-appearance: none;
    width: min(280px, 70%);
    height: 5px;
    border: 0;
    border-radius: 999px;
    overflow: hidden;
    background: var(--bg-card);
}

.loading-progress::-webkit-progress-bar {
    background: var(--bg-card);
}

.loading-progress::-webkit-progress-value {
    background: var(--accent-blue);
    border-radius: 999px;
}

.loading-progress::-moz-progress-bar {
    background: var(--accent-blue);
    border-radius: 999px;
}

.loading-percent {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 10px;
}

@keyframes loading-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Floating OHLC Legend */
.ohlc-legend {
    position: absolute;
    top: 10px;
    left: 14px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    pointer-events: none;
    background: rgba(19, 23, 34, 0.75);
    padding: 4px 10px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(42, 46, 57, 0.5);
}

.legend-symbol {
    font-weight: 700;
    color: var(--text-white);
}

.legend-item b {
    color: var(--text-primary);
    font-weight: 600;
}

/* SIDE PANEL */
.side-panel {
    display: flex;
    flex-direction: column;
    background-color: #171B26;
    height: 100%;
    overflow: hidden;
    min-width: 0;
    opacity: 1;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.trades-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 38px;
    padding: 0 10px 0 12px;
    border-bottom: 1px solid var(--border-color);
    background-color: #131722;
    flex-shrink: 0;
}

.trades-panel-title {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-blue);
    font-size: 12px;
    font-weight: 700;
}

.trades-panel-title svg,
.panel-close-btn svg {
    width: 14px;
    height: 14px;
}

.panel-close-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.panel-close-btn:hover {
    color: var(--text-white);
    border-color: var(--border-color);
    background: var(--bg-card);
}

.trades-content {
    display: flex;
    flex-direction: column;
    height: calc(100% - 38px);
    overflow: hidden;
}

.trades-filter {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    background-color: #171B26;
}

.filter-btn {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-btn:hover {
    color: var(--text-primary);
}

.filter-btn.active {
    background-color: var(--accent-blue);
    color: var(--text-white);
    border-color: var(--accent-blue);
}

.filter-btn.active.green {
    background-color: var(--bullish-green);
    border-color: var(--bullish-green);
}

.filter-btn.active.red {
    background-color: var(--bearish-red);
    border-color: var(--bearish-red);
}

.trades-table-header {
    display: grid;
    grid-template-columns: 48px 34px minmax(0, 1fr) 56px 52px 20px;
    column-gap: 6px;
    padding: 6px 12px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
    background-color: #131722;
}

.trades-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.trades-loading {
    min-height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 11px;
}

.trade-row {
    display: grid;
    grid-template-columns: 48px 34px minmax(0, 1fr) 56px 52px 20px;
    column-gap: 6px;
    padding: 6px 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    border-bottom: 1px solid rgba(42, 46, 57, 0.4);
    align-items: center;
    transition: background 0.15s ease;
}

.trade-row[hidden] {
    display: none;
}

.trade-row span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trade-row:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.trade-row.buy {
    color: var(--bullish-green);
}

.trade-row.sell {
    color: var(--bearish-red);
}

.trade-type {
    font-weight: 700;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 2px;
    display: inline-block;
    text-align: center;
}

.trade-row.buy .trade-type {
    background: rgba(8, 153, 129, 0.15);
    color: var(--bullish-green);
}

.trade-row.sell .trade-type {
    background: rgba(242, 54, 69, 0.15);
    color: var(--bearish-red);
}

.trade-link {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
}

.trade-link:hover {
    color: var(--text-white);
}

.trade-link svg {
    width: 12px;
    height: 12px;
}

.info-card {
    background: #131722;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-card h3 {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 4px;
}

.info-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
}

.info-key {
    color: var(--text-muted);
}

.info-val {
    font-weight: 600;
    color: var(--text-primary);
}

.code-val {
    font-family: var(--font-mono);
    color: #90A4AE;
}

.btn-block-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--accent-blue);
    color: var(--text-white);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.btn-block-link:hover {
    background: var(--accent-blue-hover);
}

.btn-block-link.highlight {
    background: linear-gradient(135deg, #00C6FF 0%, #0072FF 100%);
    box-shadow: 0 2px 8px rgba(0, 114, 255, 0.3);
}

.btn-block-link.highlight:hover {
    box-shadow: 0 4px 12px rgba(0, 114, 255, 0.5);
}

.btn-block-link.secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-block-link.secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-white);
}

.btn-block-link svg {
    width: 13px;
    height: 13px;
}

/* TOKEN OVERVIEW */
.token-overview {
    padding: 34px clamp(16px, 4vw, 64px) 48px;
    background:
        radial-gradient(circle at 15% 10%, rgba(41, 98, 255, 0.1), transparent 34%),
        #10141E;
    border-top: 1px solid var(--border-color);
}

.token-overview-heading {
    max-width: 1120px;
    margin: 0 auto 18px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.section-eyebrow {
    display: block;
    margin-bottom: 6px;
    color: var(--accent-blue);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.2px;
}

.token-overview h2 {
    color: var(--text-white);
    font-family: var(--font-display);
    font-size: clamp(22px, 3vw, 30px);
}

.section-anchor-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 11px;
    text-decoration: none;
}

.section-anchor-link:hover {
    color: var(--text-white);
}

.section-anchor-link svg {
    width: 13px;
    height: 13px;
}

.token-overview-grid {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    gap: 16px;
}

.token-overview .info-card {
    padding: 18px;
    border-radius: 10px;
    background: rgba(19, 23, 34, 0.82);
}

.token-overview .info-card h3 {
    font-size: 14px;
}

.token-overview .info-row {
    padding-bottom: 7px;
    border-bottom: 1px solid rgba(42, 46, 57, 0.55);
    font-size: 12px;
}

.token-overview .info-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.token-links-card p {
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.55;
}

/* Flash Animations for Price Updates */
@keyframes flashGreen {
    0% { background-color: rgba(8, 153, 129, 0.4); }
    100% { background-color: transparent; }
}

@keyframes flashRed {
    0% { background-color: rgba(242, 54, 69, 0.4); }
    100% { background-color: transparent; }
}

.flash-up {
    animation: flashGreen 0.8s ease-out;
}

.flash-down {
    animation: flashRed 0.8s ease-out;
}

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

.toast {
    background: #1E222D;
    color: #FFFFFF;
    border: 1px solid #2A2E39;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease;
}

.toast svg {
    width: 14px;
    height: 14px;
    color: var(--bullish-green);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE STYLES (DEXScreener / TradingView Mobile App style)
   ========================================================================== */
@media (max-width: 768px) {
    :root {
        --navbar-height: 50px;
        --ticker-height: 44px;
    }

    body {
        overflow: auto;
        overflow-x: hidden;
        height: auto;
        min-height: 100vh;
    }

    .app-container {
        height: auto;
        min-height: 100vh;
        width: 100%;
        overflow: visible;
    }

    .navbar {
        padding: 0 10px;
        height: 50px;
    }

    .brand {
        flex: 1;
        min-width: 0;
    }

    .brand-text,
    .token-title,
    .ca-wrapper {
        min-width: 0;
    }

    .ca-address {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .link-explorer,
    .btn-trade-bot {
        display: none;
    }

    .header-actions {
        flex-shrink: 0;
        gap: 8px;
    }

    .logo-badge {
        width: 32px;
        height: 32px;
    }

    .token-name {
        font-size: 13px;
    }

    .chain-tag {
        display: none; /* Hide chain tag on small screens to save space */
    }

    .built-by-tag span:not(.built-by-link), .built-by-label {
        display: none; /* Hide 'Built by:' label on small screens */
    }

    .simulation-badge span {
        display: none; /* Show icon only for badge on small screens */
    }

    .simulation-badge {
        padding: 4px 6px;
    }

    .ticker-bar {
        padding: 0 10px;
        gap: 14px;
        height: 44px;
    }

    .ticker-label {
        font-size: 9px;
    }

    .price-val {
        font-size: 13px;
    }

    .ticker-val {
        font-size: 12px;
    }

    .terminal-grid {
        grid-template-columns: 1fr; /* Single column layout for mobile */
        height: auto;
        display: flex;
        flex-direction: column;
    }

    .terminal-grid.trades-collapsed .side-panel {
        display: none;
    }

    .chart-section {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        height: 55vh;
        min-height: 360px;
    }

    .chart-toolbar {
        padding: 0 8px;
    }

    .tf-btn {
        padding: 6px 8px;
        font-size: 11px;
    }

    .btn-action-sm {
        padding: 5px 8px;
        font-size: 10px;
    }

    .indicator-popover,
    .trades-collapsed .indicator-popover {
        top: 136px;
        right: 10px;
        width: min(230px, calc(100vw - 20px));
        max-height: calc(100vh - 150px);
    }

    .ohlc-legend {
        top: 6px;
        left: 8px;
        font-size: 10px;
        padding: 2px 6px;
        gap: 6px;
    }

    .side-panel {
        height: 45vh;
        min-height: 320px;
    }

    .trades-table-header, .trade-row {
        grid-template-columns: 46px 32px minmax(0, 1fr) 52px 48px 18px;
        column-gap: 4px;
        padding: 6px 8px;
        font-size: 10px;
    }

    .toast-container {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }

    .toast {
        width: 100%;
        justify-content: center;
    }

    .token-overview {
        padding: 28px 14px 36px;
    }

    .token-overview-heading {
        align-items: flex-start;
    }

    .section-anchor-link {
        margin-top: 6px;
    }

    .token-overview-grid {
        grid-template-columns: 1fr;
    }
}
