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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    color: #1a202c;
    line-height: 1.5;
}

/* Styles for invite and error pages */
.invite-container, .error-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    background: #f8fafc;
}

.invite-container .card, .error-container .card {
    background: #ffffff;
    padding: 48px;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 580px;
    width: 100%;
    border: 1px solid #e2e8f0;
}

.invite-container h1, .error-container h1 {
    font-size: 2.5em;
    margin-bottom: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.invite-container h2, .error-container h2 {
    font-size: 1.5em;
    margin-bottom: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.error-container h1 {
    background: linear-gradient(135deg, #dc2626 0%, #ff29ed 50%, #dc2626 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.invite-container p, .error-container p {
    color: #64748b;
    margin-bottom: 32px;
    font-size: 0.9em;
    line-height: 1.2;
}

.invite-container form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-field {
    padding: 16px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1.1em;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.2s;
    background: #ffffff;
    color: #1a202c;
}

.input-field:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Button styles */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #f1f5f9;
    color: #1a202c;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.error-message {
    color: #ef4444;
    margin-top: 15px;
    font-weight: 500;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 16px;
}

/* Main application styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 8px;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chat-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.chat-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.chat-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 16px;
    color: white;
}

.chat-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #1a202c;
}

.event-input {
    width: 100%;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 16px;
    resize: vertical;
    transition: border-color 0.2s;
    background: #ffffff;
    color: #1a202c;
}

.event-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.selected-tokens {
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.selected-tokens-count {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

.selected-tokens-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.selected-token-tag {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 4px 8px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.selected-token-tag .remove {
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.selected-token-tag .remove:hover {
    opacity: 1;
}

.max-tokens-warning {
    color: #ef4444;
    font-size: 12px;
    width: 100%;
}

.action-buttons {
    display: flex;
    gap: 12px;
    padding-bottom: 12px;
}

.tokens-section {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.tokens-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.tokens-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #1a202c;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
}

.tab {
    flex: 1;
    padding: 16px 24px;
    background: none;
    border: none;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tab:only-child {
    flex: none;
    width: 100%;
}

.tab.active {
    color: #6366f1;
    border-bottom: 2px solid #6366f1;
    background: rgba(99, 102, 241, 0.05);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.table-header {
    display: grid;
    grid-template-columns: 40px 1fr 120px 120px 100px 135px 100px;
    gap: 16px;
    padding: 16px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-header > div:nth-child(1) { text-align: center; }
.table-header > div:nth-child(3),
.table-header > div:nth-child(4) { text-align: right; }
.table-header .market-cap { text-align: right; }
.table-header .sparkline-header { text-align: center; }
.table-header .volume { text-align: right; }

.tokens-list {
    /* Remove max-height and overflow to show all tokens */
}

.token-row {
    display: grid;
    grid-template-columns: 40px 1fr 120px 120px 100px 135px 100px;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.15s;
    align-items: center;
    position: relative;
}

.token-row:hover {
    background: #f8fafc;
}

.token-row.selected {
    background: rgba(99, 102, 241, 0.05);
    border-left: 3px solid #6366f1;
}

.token-row.updated {
    background: rgba(34, 197, 94, 0.1);
    animation: flash 2s ease-out;
}

@keyframes flash {
    0% { background: rgba(34, 197, 94, 0.3); }
    100% { background: rgba(34, 197, 94, 0.1); }
}

.token-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #6366f1;
}

.token-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.token-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.token-icon-fallback {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 12px;
}

.token-details {
    display: flex;
    flex-direction: column;
}

.token-symbol {
    font-weight: 700;
    font-size: 14px;
    color: #1a202c;
}

.token-name {
    font-size: 12px;
    color: #64748b;
}

.token-price {
    font-weight: 600;
    font-size: 14px;
    color: #1a202c;
    text-align: right;
    position: relative;
}

.price-change-indicator {
    position: absolute;
    top: -2px;
    right: -8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s;
}

.price-change-indicator.up {
    background: #22c55e;
}

.price-change-indicator.down {
    background: #ef4444;
}

.price-change-indicator.show {
    opacity: 1;
    animation: pulse 1.5s ease-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.token-market-cap {
    font-size: 14px;
    color: #1a202c;
    text-align: right;
}

.token-change {
    font-weight: 600;
    font-size: 14px;
    text-align: right;
}

.token-change.positive {
    color: #22c55e;
}

.token-change.negative {
    color: #ef4444;
}

.token-change.neutral {
    color: #64748b;
}

.sparkline {
    width: 135px;
    height: 32px;
}

.volume {
    font-size: 14px;
    color: #1a202c;
    text-align: right;
}

/* Enhanced Direction Column Styling */
.volume.direction {
    text-transform: uppercase;
    font-weight: 700;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    text-align: center;
}

.volume.direction.bullish {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border: 1px solid #22c55e;
}

.volume.direction.bearish {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #ef4444;
}

.volume.direction.neutral {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.loading {
    display: none;
    text-align: center;
    padding: 24px;
}

.spinner {
    border: 3px solid #f1f5f9;
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.results-section {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-top: 24px;
    display: none;
}

/* FIXED: Better results header - less gradient, more readable */
.results-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.results-title {
    font-size: 1.3em;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 8px;
}

/* FIXED: Better readable meta text */
.results-meta {
    font-size: 14px;
    color: #475569;
    font-weight: 500;
    line-height: 1.4;
}

.results-content {
    padding: 24px;
}

.result-token {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    background: #f8fafc;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.result-symbol {
    font-size: 1.2em;
    font-weight: 700;
    color: #1a202c;
}

.result-prediction {
    display: flex;
    gap: 12px;
    align-items: center;
}

.price-change {
    font-size: 1em;
    font-weight: 600;
}

/* FIXED: More subtle confidence badges */
.confidence-badge {
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    margin-top: 7px;
    text-align: center;
    border: 1px solid;
}

.confidence-high {
    background: rgba(34, 197, 94, 0.1);
    color: #166534;
    border-color: rgba(34, 197, 94, 0.3);
}

.confidence-medium {
    background: rgba(249, 115, 22, 0.1);
    color: #9a3412;
    border-color: rgba(249, 115, 22, 0.3);
}

.confidence-low {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
    border-color: rgba(239, 68, 68, 0.3);
}

/* FIXED: Better grid layout for desktop and mobile */
.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
    background: #f8fafc;
    padding: 16px;
    border-radius: 8px;
}

/* Desktop: 3 columns for wider screens */
@media (min-width: 1024px) {
    .result-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 16px;
    }
}

.result-field {
    background: #ffffff;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e2e8f0;
}

.result-field-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: 600;
}

.result-field-value {
    font-size: 14px;
    color: #1a202c;
    font-weight: 600;
}

/* FIXED: Enhanced result field styling for better layout */
.result-field-enhanced {
    background: #ffffff;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 8px;
}

.result-field-enhanced .result-field-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    font-weight: 600;
    display: block;
}

.result-field-enhanced .result-field-value {
    font-size: 14px;
    color: #1f2937;
    line-height: 1.4;
    word-wrap: break-word;
}

.result-field-enhanced .result-field-value.positive {
    color: #166534;
    font-weight: 600;
}

.result-field-enhanced .result-field-value.negative {
    color: #991b1b;
    font-weight: 600;
}

/* Additional info fields outside grid */
.result-additional-info {
    margin-top: 16px;
}

.reasoning-section {
    background: rgba(99, 102, 241, 0.05);
    border-radius: 8px;
    padding: 16px;
    border-left: 3px solid #6366f1;
}

.reasoning-title {
    font-weight: 600;
    color: #6366f1;
    margin-bottom: 8px;
}

.reasoning-text {
    color: #374151;
    line-height: 1.5;
    font-size: 14px;
}

.price-tooltip {
    position: absolute;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: #ffffff;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
    transform: translateX(-50%);
}

.price-tooltip.show {
    opacity: 1;
}

.price-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -4px;
    border: 4px solid transparent;
    border-top-color: #1f2937;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .header h1 {
        font-size: 2em;
        margin-bottom: 0;
    }

    .table-header,
    .token-row {
        grid-template-columns: 40px 1fr 80px 80px;
        gap: 8px;
        padding: 12px 16px;
    }

    .table-header .market-cap,
    .table-header .sparkline-header,
    .table-header .volume,
    .token-row .market-cap,
    .token-row .sparkline,
    .token-row .volume {
        display: none;
    }

    /* Mobile: single column grid */
    .result-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px;
    }

    .selected-tokens {
        flex-direction: column;
        align-items: stretch;
    }

    .selected-tokens-count {
        align-self: flex-start;
    }

    .invite-container, .error-container {
        padding: 16px;
    }

    .invite-container .card, .error-container .card {
        padding: 32px 24px;
        border-radius: 20px;
    }

    .invite-container h1, .error-container h1 {
        font-size: 2em;
    }

    .invite-container p, .error-container p {
        font-size: 1em;
    }

    .input-field {
        padding: 14px 16px;
        font-size: 1em;
    }

    .action-buttons {
        flex-direction: column;
    }

    .result-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

.footer {
    text-align: center;
    margin-top: 26px;
    font-size: 14px;
    color: #64748b;
}

.copy-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10B981;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.copy-notification.show {
    opacity: 1;
    transform: translateX(0);
}

/* Share Section Styles */
.share-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    display: none;
}

.share-section h3 {
    color: #1a202c;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.share-section p {
    color: #64748b;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.share-button {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.share-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.share-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.share-link-container {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #d1d5db;
}

.share-link-container strong {
    color: #1a202c;
    font-size: 0.9rem;
}

.share-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.share-url {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #f9fafb;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    color: #374151;
}

.copy-button {
    padding: 0.5rem 1rem;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.2s;
}

.copy-button:hover {
    background: #059669;
}

.copy-button.copied {
    background: #6b7280;
}

.share-info {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

/* Shared view specific styles */
.share-header {
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: center;
}

.share-header h1 {
    margin: 0;
    color: white;
    background: none;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
    background-clip: initial;
}

.share-meta {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid #6366f1;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.loading-spinner .spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #6366f1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

.view-only-badge {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.shared-content {
    opacity: 0.95;
}

.shared-content .chat-section,
.shared-content .action-buttons {
    pointer-events: none;
    opacity: 1;
}

.create-own-section {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.create-own-section .btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Enhanced CSS for better historical references display */
.historical-references {
    margin: 16px 0;
    padding: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-left: 4px solid #6366f1;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.historical-references h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
}

.historical-references h4:before {
    content: "📊";
    margin-right: 8px;
}

.historical-reference {
    margin: 12px 0;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.historical-reference:hover {
    border-color: #6366f1;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.event-ref {
    color: #1a202c;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 6px;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.event-ref.positive {
    border-left: 4px solid #10b981;
    padding-left: 12px;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.05) 0%, transparent 100%);
}

.event-ref.negative {
    border-left: 4px solid #ef4444;
    padding-left: 12px;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.05) 0%, transparent 100%);
}

.event-ref.neutral {
    border-left: 4px solid #64748b;
    padding-left: 12px;
    background: linear-gradient(90deg, rgba(100, 116, 139, 0.05) 0%, transparent 100%);
}

.event-ref:hover {
    color: #6366f1;
    text-decoration: underline;
    transform: translateX(2px);
}

.impact {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
    font-weight: 500;
}

.impact:before {
    content: "📈";
    margin-right: 4px;
}

.relevance {
    display: block;
    font-size: 11px;
    color: #475569;
    font-style: italic;
    margin-top: 4px;
}

.relevance:before {
    content: "🎯";
    margin-right: 4px;
}

/* Enhanced reasoning text styling */
.reasoning-text {
    line-height: 1.7;
    color: #374151;
    font-size: 14px;
}

.reasoning-text p {
    margin: 12px 0;
    text-align: justify;
}

.reasoning-text h4 {
    color: #1f2937;
    margin: 20px 0 8px 0;
    font-size: 15px;
    font-weight: 600;
    padding-bottom: 4px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
}

.reasoning-text h4:first-child {
    margin-top: 0;
}

/* Add icons to reasoning section headers */
.reasoning-text h4:before {
    margin-right: 8px;
    font-size: 16px;
}

.reasoning-text h4:nth-of-type(1):before {
    content: "📊"; /* Historical Analysis */
}

.reasoning-text h4:nth-of-type(2):before {
    content: "🧮"; /* Quantitative Assessment */
}

.reasoning-text h4:nth-of-type(3):before {
    content: "⚠️"; /* Risk Factors */
}

.reasoning-text h4:nth-of-type(4):before {
    content: "🎯"; /* Conclusion */
}

/* Historical impact average badge */
.historical-impact-average {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    color: #475569;
    margin-left: 8px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
}

.historical-impact-average.positive {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border-color: #10b981;
}

.historical-impact-average.negative {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-color: #ef4444;
}

.historical-impact-average:before {
    content: "📈";
    margin-right: 4px;
}

/* Enhanced results section */
.results-section {
    margin-top: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.results-content {
    padding: 24px;
}

/* Enhanced result token cards */
.result-token {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.result-token:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f1f5f9;
}

.result-symbol {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-prediction {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.price-change {
    font-size: 16px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid;
}

.price-change.positive {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border-color: #10b981;
}

.price-change.negative {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-color: #ef4444;
}

/* Reasoning section styling */
.reasoning-section {
    margin-top: 20px;
    background: #f8fafc;
    border-radius: 8px;
    overflow: hidden;
}

.reasoning-title {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    color: white;
    padding: 12px 16px;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.reasoning-title:before {
    content: "🧠";
    margin-right: 8px;
}

.reasoning-text {
    padding: 16px;
}

/* Links within reasoning text */
.reasoning-text a.event-ref {
    color: #6366f1;
    text-decoration: underline;
    font-weight: 600;
    transition: all 0.2s ease;
    padding: 2px 4px;
    border-radius: 4px;
}

.reasoning-text a.event-ref:hover {
    background: rgba(99, 102, 241, 0.1);
    text-decoration: none;
}

/* Animation for new results */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-token {
    animation: slideInUp 0.4s ease-out;
}

/* Improved tooltips for data attributes */
[data-impact]:hover:after {
    content: "Impact: " attr(data-impact);
    position: absolute;
    background: #1f2937;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    z-index: 1000;
    margin-top: 24px;
    margin-left: -20px;
    white-space: nowrap;
}

/* Enhanced loading states */
.loading {
    display: none;
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f1f5f9;
    border-top: 4px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}