:root {
    /* Light theme variables */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f7fa;
    --text-primary: #333333;
    --text-secondary: #666666;
    --accent-color: #4285f4;
    --border-color: #e0e0e0;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --header-bg: #ffffff;
    --footer-bg: #f5f7fa;
}

[data-theme="dark"] {
    /* Dark theme variables */
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --accent-color: #64b5f6;
    --border-color: #333333;
    --card-bg: #1e1e1e;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --header-bg: #1a1a1a;
    --footer-bg: #1a1a1a;
}

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

/* Top Banner for ForesightRadio */
.top-banner {
    background-color: #ff6b6b; /* Bright color to stand out */
    padding: 10px 0;
    text-align: center;
    color: white;
    font-weight: 600;
    width: 100%;
    position: relative;
    z-index: 101; /* Above the header */
}

.banner-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 0 20px;
}

.banner-content p {
    margin: 0;
}

.banner-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.banner-button {
    display: inline-block;
    background-color: white;
    color: #e74c3c;
    padding: 5px 15px;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.banner-button:hover {
    background-color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.site-info-banner-btn {
    background-color: #f8f9fa;
    color: #2d8e46;
    border: 1px solid #2d8e46;
}

/* Make the banner responsive */
@media (max-width: 576px) {
    .banner-content {
        flex-direction: column;
        gap: 8px;
        padding: 5px 0;
    }
    
    .banner-content p {
        font-size: 14px;
    }
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background-color: var(--header-bg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo h1 {
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--accent-color);
}

/* Ask Tom Digital Twin Navigation */
.digital-twin-nav {
    display: flex;
    align-items: center;
}

.ask-tom {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 500;
}

.ask-tom span {
    color: var(--text-primary);
}

.ask-tom-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    margin-left: 8px;
}

.ask-tom-button:hover {
    background-color: #3367d6; /* Darker shade of the accent color */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Responsive styles for the Ask Tom section */
@media (max-width: 768px) {
    .ask-tom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 10px 0;
    }
    
    .ask-tom span {
        font-size: 14px;
    }
}

/* Theme Toggle Button */
.theme-toggle button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-secondary);
    transition: background-color 0.3s ease;
}

.theme-toggle button:hover {
    background-color: var(--border-color);
}

/* Show/hide sun and moon icons based on theme */
[data-theme="light"] .fa-sun {
    display: none;
}

[data-theme="dark"] .fa-moon {
    display: none;
}

/* Main Content Styles */
main {
    padding: 40px 0;
}

/* Hero Article Styles */
.hero-section {
    margin-bottom: 40px;
}

.hero-article {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-article:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.hero-article img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.hero-article-content {
    padding: 25px;
}

.hero-article-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.hero-article-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.source-info {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    height: auto;
    min-height: 24px;
}

.source-logo {
    display: none !important; /* Hide source logos to fix artifacts */
    width: auto;
    height: 28px;
    max-width: 120px;
    margin-right: 10px;
    object-fit: contain;
}

.source-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 2px 0;
}

.read-more {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.read-more:hover {
    background-color: #3367d6;
}

/* Featured Articles Styles */
.featured-section {
    margin-bottom: 40px;
}

.featured-section h2 {
    font-size: 1.8rem;
    margin-bottom: 0;
    display: inline-block;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.article-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.article-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.article-card-content {
    padding: 20px;
}

.article-card-content h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.article-card-content p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

/* Footer Styles */
footer {
    background-color: var(--footer-bg);
    padding: 50px 0 20px;
    color: var(--text-primary);
    transition: background-color 0.3s ease;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-logo h2 {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.footer-logo p {
    color: var(--text-secondary);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
}

.download-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-btn:hover {
    background-color: #3367d6;
}

.download-btn i {
    font-size: 1rem;
}

.footer-links h3, .footer-newsletter h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.footer-links ul {
    list-style: none;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links ul li a {
    text-decoration: none;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.footer-links ul li a:hover {
    color: var(--accent-color);
}

.newsletter-form {
    display: flex;
    margin-top: 15px;
}

.newsletter-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px 0 0 4px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.newsletter-form button {
    padding: 10px 15px;
    background-color: var(--accent-color);
    border: none;
    color: white;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.newsletter-form button:hover {
    background-color: #3367d6;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Loading Animation */
.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* Responsive Styles */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        height: auto;
        padding: 15px 20px;
    }

    nav {
        margin: 15px 0;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    nav ul li {
        margin: 5px 10px;
    }

    .theme-toggle {
        position: absolute;
        top: 15px;
        right: 20px;
    }

    .hero-article img {
        height: 250px;
    }

    .hero-article-content h2 {
        font-size: 1.6rem;
    }

    .article-grid {
        grid-template-columns: 1fr;
    }
}

/* Popup Styles */
.popup-container {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--card-bg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    z-index: 1000;
    max-width: 400px;
    animation: slideIn 0.5s ease-in-out;
}

/* Forced Subscription Popup Styles */
.popup-container.force-subscription {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    bottom: auto;
    right: auto;
    background-color: rgba(0, 0, 0, 0.85);
    border-radius: 0;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1002; /* Higher than the content overlay */
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Content Overlay to block the page */
.content-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
}

.content-overlay::after {
    content: 'Please subscribe to continue reading';
    font-size: 24px;
    color: var(--text-primary);
    font-weight: bold;
}

.content-overlay.hidden {
    display: none;
}

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

.popup-content {
    padding: 25px;
    position: relative;
}

/* Forced subscription popup content styles */
.force-subscription .popup-content {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: var(--card-shadow);
}

/* Direct subscription form styles */
.direct-form {
    margin-top: 20px;
}

#subscription-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 auto;
    max-width: 100%;
}

#subscriber-email {
    padding: 12px 15px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 16px;
    width: 100%;
}

#subscription-form button {
    padding: 12px 15px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

#subscription-form button:hover {
    background-color: #3367d6;
    transform: translateY(-2px);
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.close-popup:hover {
    color: var(--accent-color);
}

.popup-container h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.popup-container p {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

/* Site info popup specific styles */
.site-info-details {
    text-align: left;
    max-height: 400px;
    overflow-y: auto;
}

.site-info-details ul {
    margin-left: 20px;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.site-info-details li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.site-info-content {
    max-width: 600px;
    width: 90%;
}

.popup-container form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.popup-container input[type="email"] {
    padding: 12px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.popup-container button {
    padding: 12px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.popup-container button:hover {
    background-color: #3367d6;
}

.success-message {
    color: #4CAF50;
    font-weight: 500;
    text-align: center;
    padding: 10px 0;
    margin-top: 15px;
    font-size: 16px;
}

/* Newsletter Form Improvements */
.newsletter-form form {
    display: flex;
    gap: 5px;
}

.newsletter-form input[type="email"] {
    flex: 1;
    padding: 10px 12px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.newsletter-form button {
    padding: 10px 15px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

/* Email Popup Modal Styles */
.email-popup-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0,0,0,0.55) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 99999 !important;
}
.email-popup-content {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 2.5rem 2rem 2rem 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    min-width: 340px;
    max-width: 95vw;
    width: 400px;
    text-align: center;
    position: relative;
    border: 1px solid var(--border-color);
    word-break: break-word;
}
.email-popup-content h2 {
    margin-bottom: 1.2rem;
    font-size: 1.25rem;
    white-space: normal;
    word-break: break-word;
}
#close-email-popup {
    right: 10px !important;
    top: 8px !important;
    font-size: 2.2rem !important;
}
.email-popup-content form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.email-popup-content input[type="email"] {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    outline: none;
    transition: border 0.2s;
}
.email-popup-content input[type="email"]:focus {
    border: 1.5px solid var(--accent-color);
}
.email-popup-content button[type="submit"] {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}
.email-popup-content button[type="submit"]:hover {
    background: #3367d6;
}

/* Radical approach to hide any element that contains just TechCrunch text */
body *:not(.source-name):not(h2):not(h3) {
    position: relative;
}

/* Hide any element that contains TechCrunch text without specific classes */
body *:not(.source-name):not(h2):not(h3):contains('TechCrunch') {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Hide image elements with TechCrunch in alt that are not properly contained */
img[alt*="TechCrunch"]:not(.source-logo) {
    display: none !important;
}

/* Specifically fix the article page */
.article-grid img[alt*="TechCrunch"],
.article-grid img[alt*="VentureBeat"],
.article-grid img[alt*="Wired"] {
    display: none !important;
}

/* Add spacing to ensure layout doesn't break when those elements are hidden */
.article-card {
    min-height: 400px;
}

/* Alternatively, you could try using the before pseudoelement to add extra spacing */
.article-card:before {
    content: '';
    display: block;
    height: 1px;
    margin-bottom: 10px;
}
