/* 
 * Wealth Gap Calculator - Custom CSS
 * Main stylesheet for the wealth gap calculator landing page
 */

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Enhanced container padding for better text margin */
.container {
    padding-left: 20px;
    padding-right: 20px;
}

/* Main content padding */
main p, main li, main h1, main h2, main h3, main h4, main h5, main h6 {
    padding-right: 5px;
    padding-left: 5px;
}

/* Add padding inside content blocks */
.calculator-container, .sidebar-section, .action-card {
    padding-left: 15px !important;
    padding-right: 15px !important;
}

.site-title {
    font-weight: 700;
    font-size: 2.2rem;
    margin-bottom: 0;
}

.site-tagline {
    font-style: italic;
    opacity: 0.9;
}

.section-title {
    font-weight: 700;
    margin-bottom: 1rem;
    border-bottom: 2px solid #dc3545;
    padding-bottom: 0.5rem;
    display: inline-block;
}

/* Urgent Banner */
.urgent-banner {
    font-size: 1.1rem;
    font-weight: 500;
}

.urgent-banner strong {
    font-weight: 800;
}

/* News Ticker Styling */
.news-ticker-section {
    border-bottom: 1px solid #dee2e6;
    overflow: hidden; /* Ensure no horizontal scrollbar */
}

.ticker-label {
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 3px;
    white-space: nowrap;
}

.ticker-container {
    position: relative;
    height: 1.8rem; /* Slightly taller for better readability */
    overflow: hidden;
    width: 100%;
}

.ticker-content {
    position: absolute;
    white-space: nowrap;
    animation: ticker 30s linear infinite;
    animation-play-state: running;
    padding-left: 100%; /* Start offscreen */
}

/* Improved animation with smoother keyframes */
@keyframes ticker {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Links in ticker */
.ticker-content a {
    margin-right: 40px; /* More space between items */
    color: #333;
    text-decoration: none;
    position: relative;
    padding-left: 12px; /* Space for separator */
}

/* Visual separator between items */
.ticker-content a:not(:first-child)::before {
    content: "•";
    position: absolute;
    left: -15px;
    color: #007bff;
}

/* Hover effect */
.ticker-content a:hover {
    color: #007bff;
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ticker-content a {
        margin-right: 50px; /* Even more space on mobile */
    }
    
    .ticker-container {
        height: 2rem; /* Taller on mobile */
    }
    
    .ticker-content a:not(:first-child)::before {
        left: -20px; /* Adjust separator position */
    }
}

/* Loading indicator for news */
.news-loading {
    display: inline-block;
    padding: 0.5rem 1rem;
    color: #6c757d;
    font-style: italic;
}

/* Calculator Section */
.calculator-container {
    border: 1px solid #dee2e6;
}

.visualization-container {
    height: 400px;
    margin-bottom: 1.5rem;
}

.findings-list li {
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
    border-left: 3px solid #007bff;
}

/* Counter Styles */
.counter-card {
    text-align: center;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.counter-value {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

/* Ad Spaces */
.ad-banner-horizontal {
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    text-align: center;
}

.ad-tower {
    text-align: center;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
}

/* Action Section */
.action-card {
    text-align: center;
    transition: transform 0.2s ease-in-out;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.action-card i {
    color: #007bff;
}

/* Sidebar Sections */
.sidebar-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.latest-news-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.latest-news-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.news-date {
    font-size: 0.8rem;
    color: #6c757d;
}

.fact-list li {
    margin-bottom: 0.8rem;
}

/* Responsive Adjustments */
@media (max-width: 991px) {
    .site-title {
        font-size: 1.8rem;
    }
    
    .counter-value {
        font-size: 1.5rem;
    }
    
    .urgent-banner {
        font-size: 0.9rem;
    }
    
    .visualization-container {
        height: 300px;
    }
    
    /* Stack ad banners properly */
    .ad-banner-horizontal {
        margin-top: 1rem;
    }
    
    /* Improve sidebar spacing */
    .sidebar-section {
        margin-top: 1.5rem;
    }
}

/* Enhanced mobile responsiveness */
@media (max-width: 767px) {
    .site-title {
        font-size: 1.5rem;
        text-align: center;
        margin-top: 0.5rem;
    }
    
    /* Additional padding for mobile */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .site-tagline {
        text-align: center;
    }
    
    .urgent-banner {
        font-size: 0.85rem;
        padding: 0.5rem 0;
    }
    
    /* Adjust header layout */
    header .row {
        flex-direction: column;
    }
    
    /* Make tabs more touch-friendly */
    .nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Adjust chart size */
    .visualization-container {
        height: 250px;
    }
    
    /* Make news ticker more readable */
    .ticker-container {
        height: 2rem;
    }
    
    .ticker-content a {
        font-size: 0.9rem;
        margin-right: 40px;  /* More space between headlines */
    }
    
    /* Improve counter display */
    .counter-value {
        font-size: 1.3rem;
    }
    
    .counter-card h4 {
        font-size: 1rem;
    }
    
    /* Better spacing for action items */
    .action-items .col-md-4 {
        margin-bottom: 1rem;
    }
    
    /* Adjust findings text */
    .findings-list li {
        font-size: 0.9rem;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .site-title {
        font-size: 1.3rem;
    }
    
    .visualization-container {
        height: 220px;
    }
    
    /* Make tabs stack on very small screens */
    .nav-tabs {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-tabs .nav-item {
        margin-bottom: 0.25rem;
        width: 100%;
    }
    
    .nav-tabs .nav-link {
        border-radius: 0.25rem;
        text-align: center;
        border: 1px solid #dee2e6;
    }
    
    /* Simplify news ticker on very small screens */
    .ticker-label {
        font-size: 0.8rem;
        padding: 0.1rem 0.5rem;
    }
    
    /* Adjust section titles */
    .section-title {
        font-size: 1.3rem;
    }
    
    /* Optimize ad display */
    .ad-tower img {
        max-width: 100%;
        height: auto;
    }
}

/* Animation for counters */
@keyframes countUp {
    from {
        opacity: 0.5;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.counter-animated {
    animation: countUp 0.3s ease-out;
}