/* ================================================
   Predictions - cypherpunk minimal
   ================================================ */

/* Network Badge */
.network-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--accent);
    font-size: 11px;
    color: var(--accent);
}

.network-badge.wrong-network {
    border-color: var(--warning);
    color: var(--warning);
}

.network-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

.network-badge.wrong-network .network-dot {
    background: var(--warning);
}

/* Transaction Modal */
.tx-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.tx-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.tx-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 24px;
    max-width: 360px;
    width: 90%;
    text-align: center;
}

.tx-modal-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
}

.tx-modal-icon.loading {
    animation: spin 1s linear infinite;
}

.tx-modal-icon.success { color: var(--accent); }
.tx-modal-icon.error { color: var(--error); }

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

.tx-modal-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.tx-modal-message {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.tx-modal-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-size: 12px;
    margin-bottom: 16px;
}

.tx-modal-link:hover { text-decoration: underline; }

.tx-modal-btn {
    padding: 10px 24px;
    background: var(--accent);
    color: var(--bg);
    font-size: 12px;
    font-weight: 600;
}

/* Predictions Main */
.predictions-main {
    padding-top: var(--header-h);
    min-height: 100vh;
    padding-bottom: 40px;
}

/* Hero - Hidden */
.predictions-hero {
    display: none;
}

/* Chart Section */
.chart-section {
    padding: 20px;
}

.chart-container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
}

/* Asset Info Bar */
.asset-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

.asset-info-left {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.asset-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: border-color 0.15s;
}

.asset-selector:hover,
.asset-selector.open {
    border-color: var(--accent);
}

.asset-selector.open .asset-dropdown-arrow {
    transform: rotate(180deg);
}

.asset-dropdown-arrow {
    width: 14px;
    height: 14px;
    color: var(--text-dim);
    transition: transform 0.15s;
}

.asset-symbol {
    font-size: 16px;
    font-weight: 700;
}

.asset-name {
    font-size: 12px;
    color: var(--text-dim);
}

/* Asset Dropdown */
.asset-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 240px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.15s;
    max-height: 400px;
    overflow-y: auto;
}

.asset-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-group {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.dropdown-group:last-child {
    border-bottom: none;
}

.dropdown-group-label {
    display: block;
    padding: 4px 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
}

.dropdown-item {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.dropdown-item:hover {
    background: var(--bg);
    color: var(--accent);
}

/* Drawing Tools */
.drawing-tools {
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--border);
    padding: 4px;
}

.tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--text-dim);
    transition: all 0.15s;
}

.tool-btn svg {
    width: 16px;
    height: 16px;
}

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

.tool-btn.active {
    background: var(--accent-dim);
    color: var(--accent);
}

.tool-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 4px;
}

/* Price Display */
.asset-info-right {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.asset-price {
    font-size: 20px;
    font-weight: 700;
}

.asset-change {
    font-size: 13px;
    font-weight: 600;
}

.asset-change.positive { color: var(--accent); }
.asset-change.negative { color: var(--error); }

/* Expiry Display */
.expiry-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.expiry-label {
    color: var(--text-dim);
}

.expiry-date {
    color: var(--accent);
    font-weight: 600;
}

/* Timeline Container */
.timeline-scroll-container {
    position: relative;
    height: 400px;
    overflow-x: auto;
    overflow-y: hidden;
    background: var(--bg);
}

.timeline-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.timeline-scroll-container::-webkit-scrollbar-track {
    background: var(--bg);
}

.timeline-scroll-container::-webkit-scrollbar-thumb {
    background: var(--accent);
}

.timeline-content {
    display: flex;
    flex-direction: column;
    min-width: 100%;
    min-height: 100%;
}

.timeline-charts-row {
    display: flex;
    flex: 1;
    min-width: 100%;
    height: 370px;
}

/* Chart Area */
.chart-area {
    flex-shrink: 0;
    width: 70%;
    min-width: 400px;
    height: 100%;
    position: relative;
    background: var(--bg);
}

.chart-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-dim);
    font-size: 12px;
}

.chart-loading.hidden {
    display: none;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Now Divider */
.now-divider {
    flex-shrink: 0;
    width: 2px;
    position: relative;
    background: var(--accent);
    z-index: 10;
}

.now-label {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: var(--bg);
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Prediction Area */
.prediction-area {
    flex-shrink: 0;
    width: 50%;
    min-width: 250px;
    height: 100%;
    position: relative;
    background: var(--bg);
}

#predictionCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.prediction-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-dim);
    pointer-events: none;
    transition: opacity 0.2s;
}

.prediction-overlay.hidden {
    opacity: 0;
}

.draw-icon {
    width: 36px;
    height: 36px;
    opacity: 0.5;
}

.prediction-overlay p {
    font-size: 13px;
}

.prediction-overlay .hint {
    font-size: 11px;
    opacity: 0.7;
}

/* X-Axis */
.unified-x-axis {
    position: relative;
    height: 30px;
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    background: var(--bg);
    border-top: 1px solid var(--border);
}

.x-axis-label {
    position: absolute;
    transform: translateX(-50%);
    font-size: 10px;
    color: var(--text-dim);
    white-space: nowrap;
}

.x-axis-label:first-child { transform: translateX(0); }
.x-axis-label:last-child { transform: translateX(-100%); }

.x-axis-label.divider-label {
    color: var(--accent);
    font-weight: 600;
}

.x-axis-label.future {
    opacity: 0.7;
}

/* Prediction Locked Notification */
.prediction-locked-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: 13px;
    z-index: 1000;
    opacity: 0;
    transition: transform 0.2s, opacity 0.2s;
}

.prediction-locked-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

#predictionCanvas.locked {
    cursor: not-allowed !important;
}

/* Prediction Info - Simplified */
.prediction-info-section {
    padding: 20px;
}

.prediction-info-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 16px;
}

.info-card-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    margin-bottom: 16px;
}

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

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-label {
    font-size: 12px;
    color: var(--text-dim);
}

.info-value {
    font-size: 13px;
    font-weight: 600;
}

.info-value.highlight {
    color: var(--accent);
}

.info-value.positive { color: var(--accent); }
.info-value.negative { color: var(--error); }

/* Payoff Display */
.payoff-display {
    text-align: center;
    padding: 16px;
    background: var(--bg);
    margin-bottom: 16px;
}

.payoff-amount {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
}

.payoff-multiplier {
    font-size: 12px;
    color: var(--text-dim);
}

.payoff-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
}

.breakdown-label {
    font-size: 12px;
    color: var(--text-dim);
}

.breakdown-value {
    font-size: 12px;
    font-weight: 600;
}

.breakdown-value.highlight {
    color: var(--accent);
}

.payoff-note {
    font-size: 11px;
    color: var(--text-dim);
    text-align: center;
}

/* Hide scoring explanation card */
.scoring-explanation,
.scoring-method,
.scoring-formula,
.scoring-details,
.detail-item,
.detail-icon,
.formula-label {
    display: none;
}

/* Submit Section */
.submit-section {
    padding: 0 20px 20px;
    text-align: center;
}

.submit-prediction-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: var(--accent);
    color: var(--bg);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: opacity 0.15s;
}

.submit-prediction-btn:hover:not(:disabled) {
    opacity: 0.8;
}

.submit-prediction-btn:disabled {
    background: var(--border);
    color: var(--text-dim);
    cursor: not-allowed;
}

.submit-prediction-btn .btn-icon {
    width: 16px;
    height: 16px;
}

/* Active Predictions */
.active-predictions-section {
    padding: 0 20px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header-row {
    margin-bottom: 16px;
}

.section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
}

.predictions-list {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.empty-predictions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-dim);
    text-align: center;
}

.empty-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-predictions p {
    font-size: 14px;
    margin-bottom: 4px;
}

.empty-predictions span {
    font-size: 12px;
    opacity: 0.8;
}

/* Prediction Item */
.prediction-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.prediction-item:last-child {
    border-bottom: none;
}

.prediction-item:hover {
    background: var(--bg);
}

.prediction-asset {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 120px;
}

.prediction-asset-icon {
    width: 32px;
    height: 32px;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-dim);
}

.prediction-asset-info {
    display: flex;
    flex-direction: column;
}

.prediction-asset-symbol {
    font-size: 13px;
    font-weight: 600;
}

.prediction-asset-window {
    font-size: 11px;
    color: var(--text-dim);
}

.prediction-prices {
    flex: 1;
    display: flex;
    gap: 24px;
}

.prediction-price-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.prediction-price-label {
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
}

.prediction-price-value {
    font-size: 13px;
    font-weight: 600;
}

.prediction-price-value.up { color: var(--accent); }
.prediction-price-value.down { color: var(--error); }

.prediction-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 80px;
}

.status-badge {
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.pending {
    background: rgba(255, 170, 0, 0.1);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.status-badge.won {
    background: rgba(0, 255, 0, 0.1);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.status-badge.lost {
    background: rgba(255, 51, 51, 0.1);
    color: var(--error);
    border: 1px solid var(--error);
}

.prediction-time-left {
    font-size: 11px;
    color: var(--text-dim);
}

/* Chart Error */
.chart-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 250px;
    gap: 12px;
    color: var(--text-dim);
    text-align: center;
    padding: 20px;
}

.chart-error svg {
    color: var(--error);
    opacity: 0.6;
}

.chart-error-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.chart-error-message {
    font-size: 12px;
    color: var(--text-dim);
    max-width: 280px;
}

.chart-error-retry {
    padding: 8px 16px;
    background: var(--accent);
    color: var(--bg);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.chart-error-retry:hover {
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 1024px) {
    .timeline-scroll-container {
        height: 350px;
    }

    .timeline-charts-row {
        height: 320px;
    }

    .chart-area {
        min-width: 300px;
    }

    .prediction-area {
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .asset-info-bar {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .asset-info-right {
        width: 100%;
        justify-content: space-between;
    }

    .prediction-prices {
        flex-direction: column;
        gap: 8px;
    }

    .prediction-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .prediction-status {
        align-items: flex-start;
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
    }
}
