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

/* Smooth scrolling and performance optimization */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Account for sticky ticker + top nav */
}

/* Hardware acceleration for better performance */
body {
    will-change: scroll-position;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fafafa;
}

/* Polymarket Ticker */
.polymarket-ticker-container {
    position: sticky;
    top: 0;
    z-index: 1001;
    width: 100%;
    background: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.polymarket-ticker-container iframe {
    display: block;
    width: 100%;
}

/* Top Navigation Bar */
.top-nav {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 0;
}

.top-nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: flex-end;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

header {
    background: white;
    padding: 2rem 0;
    text-align: center;
    border-bottom: 1px solid #eee;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 0.5rem;
}

header p {
    color: #666;
    font-size: 1.1rem;
}

#last-updated {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #888;
    text-align: center;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

#search {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    min-width: 200px;
}

#sort-by, #filter-sector {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background: white;
    min-width: 150px;
}

.nav-btn {
    padding: 0.75rem 1rem;
    border: 1px solid #2563eb;
    border-radius: 4px;
    background: #2563eb;
    color: white;
    font-size: 1rem;
    text-decoration: none;
    transition: background-color 0.2s;
    display: inline-block;
}

.nav-btn:hover {
    background: #1d4ed8;
    color: white;
}

.sort-direction-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.sort-direction-btn:hover {
    background: #f8fafc;
    border-color: #2563eb;
}

.sort-direction-btn:active {
    transform: scale(0.98);
}

.sort-direction-btn .sort-icon {
    font-size: 1.2rem;
    font-weight: bold;
    transition: transform 0.3s;
}

.sort-direction-btn.ascending .sort-icon {
    transform: rotate(180deg);
}

.sort-direction-btn .sort-label {
    font-size: 0.9rem;
    color: #666;
}

.info-note {
    background: #f0f9ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.info-note strong {
    color: #2563eb;
}

.stats-bar {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.stat span:last-child {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2563eb;
}

#chart-view {
    background: white;
    padding: 2rem;
    border: 1px solid #eee;
    border-radius: 8px;
    text-align: center;
}

#capex-chart {
    max-width: 100%;
    height: auto;
}

#company-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transform: translateZ(0); /* Force hardware acceleration */
    will-change: contents; /* Optimize for content changes */
}

.company-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 1.5rem;
    transition: box-shadow 0.3s, transform 0.2s;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transform: translateZ(0); /* Force hardware acceleration */
    will-change: transform; /* Optimize for potential transforms */
}

.company-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.company-info {
    flex: 1;
}

.company-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.company-symbol {
    color: #666;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Enhanced metrics grid layout */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    padding: 0.5rem 0;
}

.metric-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.metric-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a1a;
}

/* Specific metric value colors */
.metric-value.earnings {
    color: #7c3aed;
}

.metric-value.fcf {
    color: #059669;
}

.metric-value.capex {
    color: #2563eb;
}

.metric-value.market-cap {
    color: #ea580c;
}

.metric-value.ratio,
.metric-value.margin {
    color: #0891b2;
}

/* Card metadata */
/* Analyst Forecasts Section */
.analyst-forecasts {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 8px;
    border: 1px solid #bae6fd;
}

.forecast-header {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0369a1;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.forecast-item {
    text-align: center;
}

.forecast-label {
    font-size: 0.75rem;
    color: #0369a1;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.forecast-value {
    font-size: 1rem;
    font-weight: 700;
    color: #0c4a6e;
}

.forecast-value.rating {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    display: inline-block;
}

.forecast-value.rating-buy {
    background: #dcfce7;
    color: #166534;
}

.forecast-value.rating-hold {
    background: #fef3c7;
    color: #92400e;
}

.forecast-value.rating-sell {
    background: #fee2e2;
    color: #991b1b;
}

.forecast-meta {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #0369a1;
    text-align: center;
    font-style: italic;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0f0;
    font-size: 0.8rem;
    color: #888;
}

.data-year {
    font-weight: 500;
}

.data-source {
    font-weight: 600;
    color: #059669;
}

.rank-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: #888;
    min-width: 40px;
    text-align: center;
}

.hidden {
    display: none;
}

#loading, #error {
    text-align: center;
    padding: 2rem;
    font-size: 1.1rem;
}

#error {
    color: #dc2626;
}

footer {
    margin-top: 4rem;
    padding: 2rem;
    text-align: center;
    border-top: 1px solid #eee;
    color: #666;
}

.donate {
    margin-top: 1rem;
}

.credit {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.credit a {
    color: #2563eb;
    text-decoration: none;
}

.credit a:hover {
    text-decoration: underline;
}

/* Financial Disclaimer Styles */
.disclaimer {
    margin-top: 2rem;
    padding: 1rem;
    background: #fef3c7;
    border: 2px solid #f59e0b;
    border-radius: 8px;
    text-align: center;
}

.disclaimer p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #92400e;
}

.disclaimer strong {
    color: #d97706;
}

#eth-address {
    background: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Insights View Styles */
.insights-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.insight-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.insight-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #2563eb;
}

.insight-card p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.insight-data {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.insight-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: 4px;
    font-size: 0.9rem;
}

.insight-item .rank {
    color: #666;
    font-weight: 600;
    min-width: 30px;
}

.insight-item .company {
    font-weight: 600;
    color: #2563eb;
}

.insight-item .sector {
    font-weight: 500;
    color: #333;
}

.insight-item .value {
    font-weight: 600;
    color: #059669;
}

.insight-item .ratio {
    font-weight: 600;
    color: #dc2626;
    font-size: 0.85rem;
}

.key-insights {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.insight-point {
    padding: 1rem;
    background: #f0f9ff;
    border-left: 4px solid #2563eb;
    border-radius: 4px;
    line-height: 1.6;
}

.insight-point strong {
    color: #1e40af;
}

/* Chart Dashboard Styles */
#charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.chart-section {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.chart-section h2 {
    margin: 0 0 1rem 0;
    color: #2563eb;
    font-size: 1.3rem;
    font-weight: 600;
}

.chart-wrapper {
    position: relative;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chart-wrapper canvas {
    max-width: 100%;
    max-height: 100%;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    #charts-container {
        grid-template-columns: 1fr;
    }
    
    .chart-wrapper {
        height: 350px;
    }
}


@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .sort-direction-btn {
        width: 100%;
        justify-content: center;
    }
    
    .company-card {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        padding: 1rem 1rem 3rem 1rem;
    }
    
    .company-metrics {
        align-items: flex-start;
        text-align: left;
        width: 100%;
        margin-top: 0.5rem;
    }
}

/* Crypto address styling */
.crypto-addresses {
    margin-top: 1rem;
}

.address-item {
    margin-bottom: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.chain-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crypto-address {
    background-color: #f1f3f4;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
    max-width: 100%;
    word-break: break-all;
    position: relative;
}

.crypto-address:hover {
    background-color: #e3f2fd;
    border-color: #2196f3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

.crypto-address:active {
    transform: translateY(0);
    background-color: #bbdefb;
}

.copy-feedback {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #4caf50;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    animation: copyFeedback 2s ease-in-out;
}

@keyframes copyFeedback {
    0% { opacity: 0; transform: translateX(-50%) translateY(5px); }
    20% { opacity: 1; transform: translateX(-50%) translateY(0); }
    80% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-5px); }
}

@media (max-width: 768px) {
    .crypto-address {
        font-size: 0.75rem;
        padding: 0.5rem 0.8rem;
        word-break: break-all;
    }
}
/* Sector Grouping Styles */
.sector-group {
    margin-bottom: 20px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.sector-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background-color 0.2s ease;
}

.sector-header:hover {
    background: #e9ecef;
}

.sector-header.collapsed {
    border-bottom: none;
}

.sector-toggle {
    font-size: 12px;
    color: #666;
    transition: transform 0.2s ease;
    width: 16px;
    text-align: center;
}

.sector-info {
    flex: 1;
}

.sector-name {
    font-weight: 600;
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 4px;
}

.sector-stats {
    font-size: 14px;
    color: #666;
}

.sector-companies {
    padding: 0;
}

.sector-company {
    margin: 0;
    border-radius: 0;
    border-bottom: 1px solid #f1f3f4;
}

.sector-company:last-child {
    border-bottom: none;
}

/* Market Status Styles */
#market-status {
    text-align: center;
    margin-top: 0.5rem;
}

.market-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

.market-status.open {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.market-status.closed {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-indicator {
    font-weight: 600;
}

.market-time {
    font-size: 12px;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .sector-header {
        padding: 12px 15px;
    }
    
    .sector-name {
        font-size: 15px;
    }
    
    .sector-stats {
        font-size: 13px;
    }
}

/* News Modal Styles */
.news-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    /* Fallback for older browsers */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Modern browsers */
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    /* Add vendor prefixes */
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    align-items: center;
    justify-content: center;
}

/* When modal is shown, use flexbox centering */
.news-modal.modal-shown,
.price-modal.modal-shown,
.news-modal.filings-modal.modal-shown,
.news-modal.statements-modal.modal-shown {
    display: flex !important;
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-radius: 8px;
    padding: 16px 20px;
}

.news-count {
    font-weight: 600;
    color: #1e40af;
    font-size: 16px;
}

.news-timestamp {
    font-size: 12px;
    color: #64748b;
    font-style: italic;
}

.news-item-number {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.news-item-title-container {
    flex: 1;
    min-width: 0;
}

.news-item-meta-inline {
    margin-top: 4px;
    font-size: 12px;
    color: #64748b;
}

.news-title-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.news-title-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

.news-item-actions {
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    margin-top: 12px;
}

.news-modal-content {
    background-color: white;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.news-modal-header {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}

.news-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
}

.news-refresh-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-refresh-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

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

.news-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.news-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.news-modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.news-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.news-loading-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.news-error {
    text-align: center;
    padding: 40px 20px;
    color: #dc2626;
}

.news-error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.news-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.news-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.news-item-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.news-item-icon {
    font-size: 18px;
    color: #2563eb;
    margin-top: 2px;
}

.news-item-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
    margin: 0 0 8px 0;
}

.news-item-summary {
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 12px;
    font-size: 14px;
}

.news-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.news-item-time {
    color: #6b7280;
    font-size: 13px;
}

.news-item-source {
    color: #2563eb;
    font-size: 13px;
    font-weight: 500;
}

.news-item-link {
    background: #2563eb;
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.news-item-link:hover {
    background: #1d4ed8;
    color: white;
}

.news-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.news-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    color: #d1d5db;
}

/* News Button Styles */
.company-card {
    position: relative;
}

.news-button {
    /* Inline button below stock price */
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
    margin-top: 6px;
    display: block;
    width: fit-content;
}

.news-button:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.4);
}

.news-button:active {
    transform: translateY(0);
}

/* Live News Indicators */
.live-indicator {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    animation: pulse 2s infinite;
}

.live-badge {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 8px;
    animation: pulse 2s infinite;
}

.live-news {
    border-left: 4px solid #ef4444;
    background: linear-gradient(135deg, #fef2f2, #fafafa);
}

.live-link {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    animation: pulse 2s infinite;
}

.live-link:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.news-footer {
    text-align: center;
    padding: 16px 0 0 0;
    border-top: 1px solid #e2e8f0;
    margin-top: 16px;
}

.news-footer small {
    color: #6b7280;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Google Finance Link Styles */
.google-finance-link {
    display: block;
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.3);
    margin-top: 6px;
    width: fit-content;
    cursor: pointer;
    border: none;
}

.google-finance-link:hover {
    background: linear-gradient(135deg, #047857, #065f46);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(5, 150, 105, 0.4);
    color: white;
    text-decoration: none;
}

.google-finance-link:active {
    transform: translateY(0);
}

/* Price Modal Styles */
.price-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    /* Fallback for older browsers */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Modern browsers */
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    /* Add vendor prefixes */
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    align-items: center;
    justify-content: center;
}

.price-modal-content {
    background-color: white;
    padding: 0;
    border-radius: 12px;
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

.price-modal-header {
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
}

.price-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.price-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.price-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.price-modal-body {
    padding: 0;
    height: 80vh;
    max-height: 80vh;
    overflow: hidden;
    position: relative;
}

.price-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.price-loading-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #059669;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

/* Price iframe styles */
.price-iframe-container {
    background: white;
    height: 100%;
    width: 100%;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.price-iframe-container iframe {
    border-radius: 8px;
}

.price-attribution {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #eee;
}

.price-attribution a {
    color: #2962FF;
    text-decoration: none;
}

.price-attribution a:hover {
    text-decoration: underline;
}

/* Legacy TradingView widget styles (kept for compatibility) */
.tradingview-widget-container {
    background: white;
    height: 100%;
    width: 100%;
    position: relative;
}

.tradingview-widget {
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
    width: 100%;
}

.blue-text {
    color: #2962FF;
}

/* Mobile responsiveness for price modal */
@media (max-width: 768px) {
    .price-modal-content {
        width: calc(100% - 10px);
        max-height: 95vh;
    }
    
    .price-modal-header {
        padding: 16px 20px;
    }
    
    .price-modal-title {
        font-size: 18px;
    }
    
    .price-modal-body {
        height: 85vh;
        max-height: 85vh;
    }
}

/* Mobile responsiveness for news modal */
@media (max-width: 768px) {
    .news-modal-content {
        width: calc(100% - 20px);
        max-height: 90vh;
    }
    
    .news-modal-header {
        padding: 16px 20px;
    }
    
    .news-modal-title {
        font-size: 18px;
    }
    
    .news-modal-body {
        padding: 20px 16px;
        max-height: 70vh;
    }
    
    .news-item {
        padding: 12px;
    }
    
    .news-item-title {
        font-size: 15px;
    }
    
    .news-item-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    /* Ensure news button has proper spacing on mobile */
    .news-button {
        left: 8px;
        bottom: 8px;
        font-size: 11px;
        padding: 5px 8px;
    }
}

/* Load More Button Styles */
#load-more-btn {
    text-align: center;
    margin: 2rem 0;
    padding: 1rem 0;
    will-change: transform, opacity;
    transform: translateZ(0); /* Force hardware acceleration */
}

.load-more-button {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    will-change: transform, box-shadow;
    transform: translateZ(0); /* Force hardware acceleration */
}

.load-more-button:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-2px) translateZ(0);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.load-more-button:active {
    transform: translateY(0) translateZ(0);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

@media (max-width: 768px) {
    .load-more-button {
        width: 100%;
        max-width: 300px;
        font-size: 15px;
        padding: 14px 20px;
    }
}

/* Stock Price Styles */
.stock-price {
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-price {
    color: #1f2937;
    font-weight: 700;
}

.price-change {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.price-change.positive {
    background-color: #dcfce7;
    color: #166534;
}

.price-change.negative {
    background-color: #fee2e2;
    color: #dc2626;
}

.stock-price.positive .current-price {
    color: #059669;
}

.stock-price.negative .current-price {
    color: #dc2626;
}

.stock-price.unavailable {
    color: #9ca3af;
    font-style: italic;
}

.price-unavailable {
    font-size: 0.75rem;
    color: #9ca3af;
}

.price-source {
    display: block;
    font-size: 0.7rem;
    color: #888;
    margin-top: 2px;
    font-style: italic;
}

/* Loading animation for prices */
.stock-price:contains("Loading") {
    color: #6b7280;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Company Action Buttons */
.company-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.action-btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.action-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.4);
    color: white;
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn.news-btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.action-btn.filings-btn {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.action-btn.filings-btn:hover {
    background: linear-gradient(135deg, #6d28d9, #5b21b6);
}

.action-btn.statements-btn {
    background: linear-gradient(135deg, #059669, #047857);
}

.action-btn.statements-btn:hover {
    background: linear-gradient(135deg, #047857, #065f46);
}

.action-btn.price-btn {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.action-btn.price-btn:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
}

/* News Rain Animations */
.news-stream {
    max-height: 60vh;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.news-item-new {
    animation: newsRainSlide 0.5s ease-out forwards;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe) !important;
    border-left: 4px solid #3b82f6 !important;
    transform: translateX(-20px);
    opacity: 0;
}

@keyframes newsRainSlide {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.news-item {
    transition: all 0.3s ease;
}

.news-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Enhanced Live Indicators */
.live-indicator {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    animation: livePulse 2s infinite;
    margin-left: 8px;
}

.live-badge {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 8px;
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.live-news {
    border-left: 4px solid #ef4444;
    background: linear-gradient(135deg, #fef2f2, #fefefe);
    position: relative;
}

.live-news::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, #ef4444, #dc2626);
    animation: liveBorder 3s infinite;
}

@keyframes liveBorder {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Streaming Header */
.news-header {
    background: linear-gradient(135deg, #1f2937, #374151);
    color: white;
    padding: 16px 20px;
    margin: -24px -24px 16px -24px;
    border-radius: 12px 12px 0 0;
}

.news-count {
    font-weight: 600;
    color: white;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-timestamp {
    font-size: 12px;
    color: #d1d5db;
    font-style: italic;
    margin-top: 4px;
}

/* Auto-scroll for news rain */
.news-stream::-webkit-scrollbar {
    width: 6px;
}

.news-stream::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 10px;
}

.news-stream::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 10px;
}

.news-stream::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

/* Enhanced news footer */
.news-footer {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-top: 1px solid #e2e8f0;
    margin: 16px -24px -24px -24px;
    padding: 12px 20px;
    text-align: center;
    border-radius: 0 0 12px 12px;
}

.news-footer small {
    color: #64748b;
    font-weight: 500;
}

/* Financial Metrics Styling */
.financial-metrics {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 8px 0;
    border-left: 3px solid #3b82f6;
}

.metric-value {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.metric-label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.metric-amount {
    font-weight: 700;
    color: #1f2937;
    font-size: 16px;
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.metric-change {
    font-weight: 600;
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.metric-change.positive {
    background: #dcfce7;
    color: #166534;
}

.metric-change.negative {
    background: #fee2e2;
    color: #dc2626;
}

/* Clickable Source Links */
.news-source-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
    border-bottom: 1px solid transparent;
}

.news-source-link:hover {
    color: #1d4ed8;
    text-decoration: none;
    border-bottom: 1px solid #1d4ed8;
}

/* News Action Links */
.news-item-actions {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
}

.news-action-link {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.news-action-link:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
    color: white;
    text-decoration: none;
}

.news-action-link:active {
    transform: translateY(0);
}

/* Resources Section */
.resources-section {
    margin: 2rem 0;
    padding: 2rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.resources-section h3 {
    margin: 0 0 1.5rem 0;
    color: #1f2937;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.resource-category {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.resource-category h4 {
    margin: 0 0 1rem 0;
    color: #374151;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.resource-category ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.resource-category li {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.resource-category li:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.resource-category a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.resource-category a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.resource-category li {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Community Section */
.community-section {
    margin: 2rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    text-align: center;
}

.community-section h3 {
    margin: 0 0 1.5rem 0;
    color: #1f2937;
    font-size: 1.3rem;
    font-weight: 600;
}

.community-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.community-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.community-link:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.community-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Specific hover colors */
.community-link:nth-child(1):hover,
.community-link:nth-child(2):hover {
    background: #0088cc;
    border-color: #0088cc;
}

.community-link:nth-child(3):hover {
    background: #5865f2;
    border-color: #5865f2;
}

/* Header Action Buttons */
.header-btn {
    padding: 0.5rem 1rem;
    border: 2px solid;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.community-btn {
    border-color: #0088cc;
    color: #0088cc;
}

.community-btn:hover {
    background: #0088cc;
    color: white;
}

.donate-btn {
    border-color: #f59e0b;
    color: #f59e0b;
}

.donate-btn:hover {
    background: #f59e0b;
    color: white;
}

.disclaimer-btn {
    border-color: #ef4444;
    color: #ef4444;
}

.disclaimer-btn:hover {
    background: #ef4444;
    color: white;
}

/* Mobile responsiveness for top nav */
@media (max-width: 768px) {
    .top-nav-content {
        justify-content: center;
    }
    
    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .header-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Mobile responsiveness for community */
@media (max-width: 768px) {
    .community-links {
        flex-direction: column;
        align-items: center;
    }
    
    .community-link {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
}

/* Privacy Notice Popup */
.privacy-notice {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 400px;
    background: white;
    border: 2px solid #2563eb;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    transform: translateY(100px) scale(0.9);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.privacy-notice.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.privacy-notice-content {
    padding: 1.5rem;
}

.privacy-notice-header {
    margin-bottom: 1rem;
    text-align: center;
}

.privacy-notice-header h3 {
    color: #1f2937;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.privacy-notice-body {
    margin-bottom: 1.5rem;
    color: #374151;
    line-height: 1.5;
}

.privacy-notice-body p {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
}

.privacy-notice-body ul {
    margin: 0.75rem 0;
    padding-left: 1rem;
}

.privacy-notice-body li {
    margin: 0.25rem 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
}

.privacy-notice-body > ul > li {
    color: #374151;
}

.privacy-notice-body > ul > li:nth-child(1),
.privacy-notice-body > ul > li:nth-child(2),
.privacy-notice-body > ul > li:nth-child(3) {
    color: #059669;
}

.privacy-notice-body > ul > li:nth-child(4),
.privacy-notice-body > ul > li:nth-child(5),
.privacy-notice-body > ul > li:nth-child(6) {
    color: #d97706;
}

.privacy-notice-body ul ul {
    margin-top: 0.5rem;
    padding-left: 1.5rem;
}

.privacy-notice-body ul ul li {
    color: #6b7280;
    font-size: 0.8rem;
    margin: 0.1rem 0;
}

.privacy-notice-footer {
    text-align: center;
}

.privacy-accept-btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.privacy-accept-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.privacy-accept-btn:active {
    transform: translateY(0);
}

/* Mobile responsiveness for privacy notice */
@media (max-width: 768px) {
    .privacy-notice {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .privacy-notice-content {
        padding: 1rem;
    }
    
    .privacy-notice-header h3 {
        font-size: 1.1rem;
    }
    
    .privacy-notice-body p {
        font-size: 0.85rem;
    }
    
    .privacy-notice-body li {
        font-size: 0.8rem;
    }
}

/* Mobile responsiveness for resources */
@media (max-width: 768px) {
    .resources-grid {
        grid-template-columns: 1fr;
    }
    
    .resources-section {
        padding: 1.5rem;
    }
    
    .resource-category {
        padding: 1rem;
    }
}

/* Disclaimer Footnote */
.disclaimer-footnote {
    background: #fef3c7;
    border-top: 2px solid #f59e0b;
    padding: 0.75rem 1rem;
    text-align: center;
    position: relative;
    bottom: 0;
    width: 100%;
}

.disclaimer-footnote p {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.4;
    color: #92400e;
    max-width: 1200px;
    margin: 0 auto;
}

.disclaimer-footnote strong {
    color: #d97706;
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .disclaimer-footnote {
        padding: 0.6rem 0.8rem;
    }
    
    .disclaimer-footnote p {
        font-size: 0.7rem;
    }
    
    .disclaimer-footnote strong {
        font-size: 0.75rem;
    }
}