/* StockCraft Styles - Shared CSS for empor.top */

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

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #1a1a1a;
    background: #fefefe;
    font-size: 18px;
}

/* Magazine Layout */
.magazine-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Index page wider layout */
.index-layout .magazine-container {
    max-width: 1100px;
    padding: 30px 20px;
}

.magazine-header {
    text-align: center;
    border-bottom: 3px solid #000;
    padding-bottom: 30px;
    margin-bottom: 40px;
}

.magazine-title {
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: -2px;
    margin-bottom: 10px;
    color: #000;
    text-transform: uppercase;
}

.magazine-subtitle {
    font-size: 1.2rem;
    color: #666;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Navigation */
.navigation-links {
    text-align: center;
    margin-bottom: 30px;
}

.index-layout .navigation-links {
    margin-bottom: 40px;
}

.navigation-links a {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 15px;
}

.navigation-links a:hover, .navigation-links a.active {
    color: #000;
    font-weight: bold;
}

/* Language Bars */
.index-language-bar {
    text-align: center;
    margin: 20px 0;
}

.index-language-bar a {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
    transition: all 0.2s ease;
}

.index-language-bar a:hover {
    color: #000;
    border-color: #999;
    background: #fff;
}

.article-language-bar {
    text-align: center;
    margin: 15px 0;
}

.article-language-bar a {
    color: #666;
    text-decoration: none;
    font-size: 0.85rem;
    font-style: italic;
    transition: color 0.2s ease;
}

.article-language-bar a:hover {
    color: #000;
}

/* Article Layout */
.article-header {
    margin-bottom: 50px;
    text-align: center;
}

.article-title {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.1;
    color: #000;
    margin-bottom: 20px;
    font-family: 'Georgia', serif;
}

.article-subtitle {
    font-size: 1.4rem;
    color: #666;
    font-style: italic;
    margin-bottom: 30px;
    line-height: 1.4;
}

.byline {
    font-size: 0.9rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    padding: 15px 0;
    margin-bottom: 40px;
}

/* Article Content */
.article-content {
    font-size: 1.1rem;
    line-height: 1.3;
    color: #333;
}

.article-content p {
    margin-bottom: 1.8rem;
    text-align: justify;
}

.article-content p:first-of-type::first-letter {
    float: left;
    font-size: 4rem;
    line-height: 3.2rem;
    padding-right: 8px;
    margin-top: 4px;
    font-weight: bold;
    color: #000;
}

.article-content h1, .article-content h2, .article-content h3 {
    font-family: 'Georgia', serif;
    font-weight: 700;
    color: #000;
    margin: 2.5rem 0 1.5rem 0;
    line-height: 1.2;
}

.article-content h1 {
    font-size: 2.2rem;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
}

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

.article-content h3 {
    font-size: 1.4rem;
}

.article-content blockquote {
    font-size: 1.3rem;
    font-style: italic;
    color: #555;
    border-left: 4px solid #000;
    padding-left: 30px;
    margin: 2.5rem 0;
    line-height: 1.6;
}

.article-content ul, .article-content ol {
    margin: 1.5rem 0 1.5rem 2rem;
}

.article-content li {
    margin-bottom: 0.8rem;
}

/* Table of Contents */
.table-of-contents {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 25px;
    margin: 30px 0 40px 0;
    border-radius: 4px;
}

.toc-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 15px;
    text-align: center;
    border-bottom: 1px solid #ccc;
    padding-bottom: 10px;
}

.table-of-contents ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.table-of-contents li {
    margin-bottom: 8px;
}

.table-of-contents a {
    color: #333;
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.4;
    display: block;
    padding: 4px 0;
    transition: color 0.3s ease;
}

.table-of-contents a:hover {
    color: #000;
    text-decoration: underline;
}

/* Back to Top Links */
.back-to-top-link {
    text-align: center;
    margin: 2rem 0;
    padding-top: 1rem;
}

.back-to-top-link a {
    font-size: 0.85rem;
    color: #666;
    text-decoration: none;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.back-to-top-link a:hover {
    color: #000;
    text-decoration: none;
}

/* Search Functionality (Index Page) */
.search-container {
    max-width: 400px;
    margin: 0 auto 30px auto;
    text-align: center;
    position: relative;
}

/* Desktop search with lucky button inline */
.search-lucky-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.search-lucky-container .search-container {
    margin: 0;
    flex: 0 0 400px;
}

.lucky-separator {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.search {
    width: 100%;
    padding: 12px 40px 12px 16px;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: #fefefe;
    font-family: 'Georgia', 'Times New Roman', serif;
    transition: border-color 0.3s ease;
}

.search:focus {
    outline: none;
    border-color: #000;
}

.search::placeholder {
    color: #999;
    font-style: italic;
}

.clear-button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 5px;
    display: none;
    line-height: 1;
}

.clear-button:hover {
    color: #000;
}

.search-container.has-text .clear-button {
    display: block;
}

/* Lucky Button Styling */
.lucky-button {
    background: transparent;
    border: 1px solid #666;
    color: #666;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-family: 'Georgia', 'Times New Roman', serif;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: normal;
}

.lucky-button:hover {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* Mobile lucky button - subtle below search */
.lucky-container-mobile {
    text-align: center;
    margin: 15px 0 30px 0;
    display: none;
}

.lucky-container-mobile .lucky-button {
    font-size: 0.8rem;
    padding: 6px 12px;
    color: #999;
    border-color: #ddd;
}

.lucky-container-mobile .lucky-button:hover {
    color: #666;
    border-color: #666;
    background: transparent;
}

/* ChatGPT Link Styling */
.chatgpt-link {
    margin: 20px 0;
    text-align: center;
}

.chatgpt-link a {
    display: inline-block;
    background: transparent;
    color: #666;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: normal;
    font-style: italic;
    padding: 4px 0;
    transition: color 0.2s ease;
    font-family: 'Georgia', 'Times New Roman', serif;
}

.chatgpt-link a:hover {
    color: #333;
    text-decoration: underline;
}

/* Social Sharing Buttons */
.social-sharing {
    margin: 15px 0;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.social-btn, .reddit-btn-link, .twitter-btn-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #666;
    text-decoration: none;
    font-size: 0.8rem;
    font-family: 'Georgia', 'Times New Roman', serif;
    transition: all 0.2s ease;
    font-weight: normal;
}

.social-btn:hover, .reddit-btn-link:hover, .twitter-btn-link:hover {
    border-color: #999;
    color: #333;
    background: #f9f9f9;
    text-decoration: none;
}

.social-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.twitter-icon {
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
}

.reddit-btn:hover, .reddit-btn-link:hover {
    border-color: #ff4500;
    color: #ff4500;
    background: #fff5f2;
}

.twitter-btn:hover, .twitter-btn-link:hover {
    border-color: #1da1f2;
    color: #1da1f2;
    background: #f0f8ff;
}

/* Mobile responsive for social buttons */
@media (max-width: 480px) {
    .social-sharing {
        margin: 12px 0;
        gap: 10px;
    }
    
    .social-btn {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
    
    .social-icon {
        width: 12px;
        height: 12px;
    }
    
    .twitter-icon {
        font-size: 12px;
    }
}

/* Company Listings (Index Page) */
.company-group {
    margin-bottom: 15px;
}

.group-letter {
    font-size: 1.4rem;
    font-weight: 700;
    color: #000;
    border-bottom: 1px solid #ccc;
    padding-bottom: 6px;
    margin-bottom: 12px;
}

.company-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
}

.company-card {
    padding: 6px 8px;
    background: transparent;
    transition: background-color 0.2s ease;
    border-radius: 3px;
}

.company-card:hover {
    background-color: #f5f5f5;
}

.company-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.company-name {
    font-size: 0.95rem;
    font-weight: bold;
    color: #000;
    margin-bottom: 2px;
    line-height: 1.2;
}

.company-symbol {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.3;
}

.company-meta {
    font-size: 0.75rem;
    color: #999;
    margin-top: 2px;
}

/* Footer */
.footer {
    margin-top: 80px;
    padding-top: 30px;
    border-top: 2px solid #000;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

.footer p {
    margin-bottom: 10px;
}

.footer a {
    color: #000;
    text-decoration: none;
    font-weight: bold;
}

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

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .magazine-container {
        padding: 20px 15px;
    }

    .magazine-title {
        font-size: 2.5rem;
    }

    .article-title {
        font-size: 2rem;
    }

    .article-content {
        font-size: 1rem;
    }

    .article-content p:first-of-type::first-letter {
        font-size: 3rem;
        line-height: 2.5rem;
    }

    .company-list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 6px;
    }

    /* Mobile search layout */
    .search-lucky-container {
        display: block;
    }
    
    .search-lucky-container .search-container {
        flex: none;
        max-width: 400px;
        margin: 0 auto 15px auto;
    }
    
    .lucky-separator {
        display: none;
    }
    
    .lucky-container {
        display: none;
    }
    
    .lucky-container-mobile {
        display: block;
    }
}

/* Tab Styles */
.tab-container {
    margin-bottom: 30px;
    border-bottom: 2px solid #ddd;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
}

.tab-button {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-bottom: none;
    color: #666;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 0;
    min-width: 120px;
    text-align: center;
}

.tab-button:first-child {
    border-radius: 8px 0 0 0;
}

.tab-button:last-child {
    border-radius: 0 8px 0 0;
}

.tab-button:hover {
    background-color: #e9e9e9;
    color: #333;
}

.tab-button.active {
    background-color: #fff;
    color: #000;
    border-bottom: 2px solid #fff;
    margin-bottom: -2px;
    font-weight: 700;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

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

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

/* Experimental/Beta marker for tabs */
.experimental-marker {
    font-size: 0.65rem;
    font-weight: 400;
    color: #999;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 4px;
    opacity: 0.8;
    vertical-align: super;
    line-height: 1;
}

.tab-button:hover .experimental-marker {
    color: #666;
}

.tab-button.active .experimental-marker {
    color: #333;
    font-weight: 500;
}

/* Responsive Tab Styles */
@media (max-width: 600px) {
    .tab-button {
        flex: 1;
        min-width: auto;
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .tab-button:first-child,
    .tab-button:last-child {
        border-radius: 0;
    }
}

/* 404 Page Styles */
.error-container {
    max-width: 800px;
    margin: 50px auto;
    padding: 20px;
    text-align: center;
    background: #f9f9f9;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.error-code {
    font-size: 6em;
    font-weight: bold;
    color: #e74c3c;
    margin: 0;
}

.error-message {
    font-size: 1.5em;
    color: #2c3e50;
    margin: 20px 0;
}

.kandinsky-trivia {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
    border-left: 4px solid #3498db;
}

.kandinsky-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.countdown {
    font-size: 1.2em;
    color: #e74c3c;
    font-weight: bold;
    margin: 30px 0;
}

.redirect-button {
    background: #3498db;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s;
}

.redirect-button:hover {
    background: #2980b9;
}

/* PWA Install Button */
.pwa-install-button {
    background: transparent;
    color: #666;
    border: 1px solid #666;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: 'Georgia', 'Times New Roman', serif;
    cursor: pointer;
    margin: 15px auto;
    display: none;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: normal;
    text-align: center;
}

.pwa-install-button:hover {
    background: #000;
    color: #fff;
    border-color: #000;
}


/* Connection Status Toast */
.connection-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 6px;
    color: white;
    font-weight: bold;
    z-index: 1000;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

.connection-toast.success {
    background: #28a745;
}

.connection-toast.warning {
    background: #ffc107;
    color: #333;
}

.connection-toast.error {
    background: #dc3545;
}

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

/* Offline mode styles */
body.offline {
    filter: grayscale(20%);
}

body.offline::before {
    content: "📡 Offline Mode - Using cached content";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ffc107;
    color: #333;
    text-align: center;
    padding: 8px;
    font-size: 0.85rem;
    font-weight: bold;
    z-index: 999;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

body.offline .magazine-container {
    margin-top: 40px;
}

/* Text Selection Tweet Popup */
.selection-tweet-popup {
    position: absolute;
    background: #000;
    color: #fff;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.selection-tweet-popup.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.selection-tweet-popup:hover {
    background: #1da1f2;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.selection-tweet-popup:active {
    transform: scale(0.95);
    opacity: 0.7;
}

.selection-tweet-popup .bird-icon {
    font-size: 16px;
    line-height: 1;
}

.selection-tweet-popup::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #000;
    transition: border-bottom-color 0.2s ease;
}

.selection-tweet-popup:hover::after {
    border-bottom-color: #1da1f2;
}

/* PWA specific styles */
@media (display-mode: standalone) {
    /* Hide install button when already installed */
    .pwa-install-button {
        display: none;
    }
    
    /* Add some padding for PWA mode */
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* iOS PWA specific adjustments */
@media (display-mode: standalone) and (max-width: 768px) {
    .magazine-container {
        padding-top: max(40px, env(safe-area-inset-top) + 20px);
    }
}

/* Image Gallery Styles - Magazine Layout */
.image-gallery {
    margin: 40px 0;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.gallery-header {
    background: #000;
    color: #fff;
    padding: 15px 20px;
    text-align: center;
}

.gallery-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Georgia', serif;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 25px;
}

.gallery-item {
    margin: 0;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.gallery-item img:hover {
    opacity: 0.9;
}

.gallery-item figcaption {
    padding: 15px;
    font-size: 0.9rem;
    color: #333;
    line-height: 1.4;
    background: #fff;
    border-top: 1px solid #eee;
    text-align: center;
    font-style: italic;
}

.gallery-attribution {
    padding: 15px 25px;
    margin: 0;
    font-size: 0.8rem;
    color: #666;
    text-align: center;
    background: #f0f0f0;
    border-top: 1px solid #ddd;
    font-style: italic;
}

.gallery-attribution em {
    font-weight: 500;
    color: #000;
}

/* Image Loading and Error States */
.gallery-item img[src=""] {
    display: none;
}

.gallery-item img:not([src]),
.gallery-item img[src=""],
.gallery-item img:not([src*="/"]) {
    background: #f0f0f0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.gallery-item img:not([src])::before {
    content: "🖼️ Image loading...";
}

/* Responsive Gallery Layout */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 15px;
        padding: 20px;
    }
    
    .gallery-item img {
        height: 180px;
    }
    
    .gallery-item figcaption {
        padding: 12px;
        font-size: 0.85rem;
    }
    
    .gallery-header h3 {
        font-size: 1.1rem;
    }
    
    .gallery-attribution {
        padding: 12px 20px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 15px;
    }
    
    .gallery-item img {
        height: 160px;
    }
    
    .image-gallery {
        margin: 30px 0;
    }
}

/* Single column layout for very narrow screens */
@media (max-width: 320px) {
    .gallery-grid {
        padding: 12px;
    }
    
    .gallery-item img {
        height: 140px;
    }
    
    .gallery-item figcaption {
        padding: 10px;
        font-size: 0.8rem;
    }
}

/* Magazine-style alternating layout for larger screens */
@media (min-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .gallery-item:nth-child(4n+1),
    .gallery-item:nth-child(4n+2) {
        grid-column: span 1;
    }
    
    .gallery-item:nth-child(4n+3) {
        grid-column: span 2;
    }
    
    .gallery-item:nth-child(4n+3) img {
        height: 160px;
    }
}

/* Print styles for images */
@media print {
    .image-gallery {
        break-inside: avoid;
        margin: 20px 0;
        background: #fff;
        border: 1px solid #ccc;
    }
    
    .gallery-header {
        background: #000;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 15px;
    }
    
    .gallery-item img {
        height: 120px;
    }
    
    .gallery-item figcaption {
        font-size: 0.7rem;
        padding: 8px;
    }
}

/* PWA Help System Styles - much more subtle */
.pwa-help-container {
    display: none; /* Hide completely on desktop */
}

.pwa-help-icon {
    width: 16px;
    height: 16px;
    border: 1px solid #ccc;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #999;
    cursor: pointer;
    background: transparent;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: 'Georgia', 'Times New Roman', serif;
}

.pwa-help-icon:hover {
    background: #f0f0f0;
    color: #666;
    border-color: #999;
}

/* Only show PWA help on mobile devices */
@media (max-width: 768px) {
    .pwa-help-container {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        margin: 5px auto;
        text-align: center;
    }
}

/* PWA Help Modal/Overlay */
.pwa-help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pwa-help-overlay.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.pwa-help-modal {
    background: #fff;
    max-width: 600px;
    max-height: 80vh;
    margin: 20px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.pwa-help-overlay.show .pwa-help-modal {
    transform: translateY(0);
}

.pwa-help-header {
    padding: 25px 30px 20px 30px;
    border-bottom: 2px solid #000;
    background: #f9f9f9;
}

.pwa-help-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #000;
    margin: 0 0 10px 0;
    text-align: center;
    font-family: 'Georgia', serif;
}

.pwa-help-subtitle {
    font-size: 1rem;
    color: #666;
    text-align: center;
    font-style: italic;
    margin: 0;
}

.pwa-help-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.pwa-help-close:hover {
    background: #000;
    color: #fff;
}

.pwa-help-content {
    padding: 30px;
}

.pwa-help-section {
    margin-bottom: 30px;
}

.pwa-help-section:last-child {
    margin-bottom: 0;
}

.pwa-help-section h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #000;
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #ddd;
    font-family: 'Georgia', serif;
}

.pwa-help-section p {
    font-size: 1rem;
    line-height: 1.5;
    color: #333;
    margin-bottom: 15px;
    text-align: justify;
}

.pwa-help-section ol {
    padding-left: 20px;
    margin-bottom: 15px;
}

.pwa-help-section li {
    font-size: 1rem;
    line-height: 1.5;
    color: #333;
    margin-bottom: 8px;
}

.pwa-benefits {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 6px;
    border-left: 4px solid #000;
    margin: 20px 0;
}

.pwa-benefits h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #000;
    margin: 0 0 10px 0;
    font-family: 'Georgia', serif;
}

.pwa-benefits ul {
    margin: 0;
    padding-left: 20px;
}

.pwa-benefits li {
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.4;
}

/* iOS Education Banner - much more subtle */
.ios-pwa-banner {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #ddd;
    padding: 8px 15px;
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.3;
    margin: 10px 0;
    border-radius: 4px;
    display: none;
}

.ios-pwa-banner.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

/* Hide PWA banner on desktop completely */
@media (min-width: 1024px) {
    .ios-pwa-banner {
        display: none;
    }
}

.ios-pwa-banner .banner-icon {
    font-size: 1.2em;
    margin-right: 8px;
}

.ios-pwa-banner .banner-close {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    font-size: 18px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.ios-pwa-banner .banner-close:hover {
    background: #000;
    color: #fff;
}

.ios-pwa-banner {
    position: relative;
}

/* Desktop PWA Hint - much more subtle */
.desktop-pwa-hint {
    background: transparent;
    border: none;
    padding: 6px 12px;
    text-align: center;
    font-size: 0.75rem;
    color: #999;
    margin: 10px 0;
    border-radius: 4px;
    display: none;
}

.desktop-pwa-hint.show {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* Hide PWA hints on desktop screens completely */
@media (min-width: 1024px) {
    .desktop-pwa-hint {
        display: none;
    }
}


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

/* Mobile responsive adjustments for help modal */
@media (max-width: 768px) {
    .pwa-help-modal {
        margin: 10px;
        max-height: 90vh;
    }
    
    .pwa-help-header {
        padding: 20px 25px 15px 25px;
    }
    
    .pwa-help-title {
        font-size: 1.5rem;
    }
    
    .pwa-help-content {
        padding: 20px 25px;
    }
    
    .pwa-help-section h3 {
        font-size: 1.2rem;
    }
    
    .pwa-help-close {
        top: 12px;
        right: 15px;
    }
    
    .ios-pwa-banner {
        margin: 15px 0;
        padding: 12px 45px 12px 15px;
        font-size: 0.85rem;
    }
    
    .desktop-pwa-hint {
        display: none;
    }
}

/* Alphabetical Sidebar Styles */
.alphabetical-sidebar {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    transition: all 0.3s ease;
    width: 80px;
}

.alphabetical-sidebar:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.sidebar-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #000;
    text-align: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Georgia', serif;
}

.sidebar-letters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    justify-items: center;
}

.sidebar-letter {
    display: flex;
    width: 26px;
    height: 26px;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #666;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-family: 'Georgia', serif;
    background: transparent;
    border: 1px solid transparent;
}

.sidebar-letter:hover {
    background: #f0f0f0;
    color: #000;
    border-color: #ddd;
    transform: scale(1.1);
}

.sidebar-letter:active {
    background: #000;
    color: #fff;
    transform: scale(0.95);
}

/* Desktop and large tablets - keep sidebar on right, hide tablet nav */
@media (min-width: 1201px) {
    .alphabetical-sidebar {
        right: 20px;
        width: 80px;
        padding: 12px;
        display: block;
    }
    
    .tablet-alphabet-nav {
        display: none;
    }
}

/* Medium screens and large tablets - keep sidebar on right, hide tablet nav */
@media (max-width: 1200px) and (min-width: 769px) {
    .alphabetical-sidebar {
        right: 10px;
        padding: 10px;
        width: 70px;
        display: block;
    }
    
    .tablet-alphabet-nav {
        display: none;
    }
    
    .sidebar-letter {
        width: 22px;
        height: 22px;
        font-size: 0.8rem;
    }
    
    .sidebar-title {
        font-size: 0.7rem;
        margin-bottom: 6px;
    }
}

/* Tablet alphabet navigation - hidden by default everywhere except tablets */
.tablet-alphabet-nav {
    display: none;
}

/* Tablets in portrait and landscape - hide fixed sidebar, show horizontal version */
@media (max-width: 768px) and (min-width: 481px) {
    .alphabetical-sidebar {
        display: none;
    }
    
    /* Add horizontal alphabet navigation for tablets */
    .tablet-alphabet-nav {
        display: block;
        text-align: center;
        margin: 20px 0;
        padding: 15px 20px;
        background: #f9f9f9;
        border: 1px solid #ddd;
        border-radius: 8px;
    }
    
    .tablet-alphabet-nav .nav-title {
        font-size: 0.9rem;
        font-weight: 700;
        color: #000;
        margin-bottom: 10px;
        text-transform: uppercase;
        letter-spacing: 1px;
        font-family: 'Georgia', serif;
    }
    
    .tablet-alphabet-nav .nav-letters {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .tablet-alphabet-nav .nav-letter {
        display: flex;
        width: 32px;
        height: 32px;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #666;
        font-size: 0.9rem;
        font-weight: 600;
        border-radius: 4px;
        background: #fff;
        border: 1px solid #ccc;
        transition: all 0.2s ease;
        font-family: 'Georgia', serif;
    }
    
    .tablet-alphabet-nav .nav-letter:hover,
    .tablet-alphabet-nav .nav-letter:active {
        background: #000;
        color: #fff;
        border-color: #000;
        transform: scale(1.05);
    }
}

/* Mobile phones - completely hide alphabet navigation */
@media (max-width: 480px) {
    .alphabetical-sidebar {
        display: none;
    }
    
    .tablet-alphabet-nav {
        display: none;
    }
}

/* Hide sidebar when search is active to avoid confusion */
.search-container.has-text ~ * .alphabetical-sidebar,
.magazine-container .search-container.has-text ~ .alphabetical-sidebar {
    opacity: 0.3;
    pointer-events: none;
}

/* Show sidebar only on index pages */
body:not(.index-layout) .alphabetical-sidebar {
    display: none;
}


/* Missing Stock Message Styles */
.missing-stock-message {
    margin: 30px 0;
    padding: 0;
    text-align: center;
    animation: fadeIn 0.3s ease-in;
}

.missing-stock-content {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px 25px;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.missing-stock-content h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #000;
    margin: 0 0 15px 0;
    font-family: 'Georgia', serif;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.missing-stock-content p {
    font-size: 1rem;
    color: #333;
    margin: 0 0 20px 0;
    line-height: 1.4;
}

.missing-stock-content strong {
    color: #000;
    font-weight: 600;
}

.missing-stock-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid #666;
    border-radius: 4px;
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    font-family: 'Georgia', 'Times New Roman', serif;
    transition: all 0.2s ease;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.missing-stock-link:hover {
    background: #000;
    color: #fff;
    border-color: #000;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.missing-stock-link .twitter-icon {
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .missing-stock-message {
        margin: 20px 0;
    }
    
    .missing-stock-content {
        padding: 25px 20px;
        margin: 0 15px;
    }
    
    .missing-stock-content h3 {
        font-size: 1.2rem;
    }
    
    .missing-stock-content p {
        font-size: 0.95rem;
    }
    
    .missing-stock-link {
        font-size: 0.85rem;
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    .missing-stock-content {
        margin: 0 10px;
        padding: 20px 15px;
    }
    
    .missing-stock-content h3 {
        font-size: 1.1rem;
    }
}

/* Podcast Player Styles */
.podcast-player {
    margin: 20px 0;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.podcast-player h3 {
    margin-top: 0;
    color: #333;
    font-family: 'Georgia', serif;
}

.podcast-player iframe {
    width: 100%;
    height: 152px;
    border-radius: 12px;
}

.podcast-player p {
    margin: 10px 0 0 0;
    font-size: 0.9em;
    color: #666;
    text-align: center;
}

/* Podcast Grid Styles (Index Page) */
.podcast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin: 20px 0;
}

.podcast-card {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.podcast-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.podcast-embed-container {
    padding: 15px 15px 10px 15px;
    background: #fff;
}

.podcast-embed-container iframe {
    width: 100%;
    height: 152px;
    border-radius: 12px;
}

.podcast-info {
    padding: 15px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
}

.podcast-info a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.podcast-info:hover {
    background: #f5f5f5;
}

.podcast-info .company-name {
    font-size: 1rem;
    font-weight: bold;
    color: #000;
    margin-bottom: 4px;
    line-height: 1.2;
}

.podcast-info .company-symbol {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.3;
    margin-bottom: 4px;
}

.podcast-info .company-meta {
    font-size: 0.8rem;
    color: #999;
    line-height: 1.3;
    margin-top: 4px;
}

/* Responsive podcast grid */
@media (max-width: 768px) {
    .podcast-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .podcast-grid {
        gap: 15px;
    }

    .podcast-card {
        margin: 0;
    }

    .podcast-embed-container {
        padding: 12px;
    }

    .podcast-info {
        padding: 12px;
    }
}

/* Company Logo and Founder Portrait Styles - Simplified Design */

/* Company Logo Styles - Improved */
.company-logo {
    margin: 20px 0;
    text-align: center;
    padding: 15px;
    background: transparent;
    border: none;
    border-radius: 6px;
}

.company-logo img {
    max-width: 150px;
    max-height: 80px;
    height: auto;
    width: auto;
    object-fit: contain;
    background: transparent;
    transition: opacity 0.2s ease;
    border: none;
}

.company-logo img:hover {
    opacity: 0.85;
}

/* Fallback for missing/broken logos */
.company-logo img:not([src]),
.company-logo img[src=""],
.company-logo img[alt*="logo"]:after {
    display: none;
}

/* Founder Portrait Styles */
.founder-portrait {
    float: right;
    margin: 0 0 20px 25px;
    max-width: 280px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.founder-portrait:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.founder-portrait figure {
    margin: 0;
}

.founder-portrait img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    object-position: top;
    background: #f8f8f8;
    display: block;
    transition: opacity 0.2s ease;
}

.founder-portrait figcaption {
    padding: 15px;
    font-size: 0.85rem;
    color: #333;
    line-height: 1.4;
    background: #fff;
    text-align: center;
    font-style: italic;
    border-top: 1px solid #eee;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .company-logo {
        margin: 15px 0;
        padding: 10px;
    }
    
    .company-logo img {
        max-width: 120px;
        max-height: 60px;
    }
    
    .founder-portrait {
        float: none;
        margin: 20px auto;
        max-width: 100%;
        width: 280px;
    }
}

@media (max-width: 480px) {
    .founder-portrait {
        width: 100%;
        max-width: 100%;
        margin: 15px 0;
    }
}

/* Podcast Icon Styles - for footer links */
.podcast-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin: 0 2px;
}

/* Podcast Subscription Header Styles */
.podcast-subscription-header {
    background: #f9f9f9;
    border-top: 2px solid #000;
    border-bottom: 2px solid #000;
    padding: 30px 25px;
    margin: 0 0 40px 0;
    text-align: center;
}

.podcast-subscription-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #000;
    margin: 0 0 20px 0;
    font-family: 'Georgia', serif;
}

.podcast-platforms {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.platform-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: transparent;
    border: 1px solid #666;
    border-radius: 4px;
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    font-family: 'Georgia', 'Times New Roman', serif;
    transition: all 0.2s ease;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.platform-button:hover {
    background: #000;
    color: #fff;
    border-color: #000;
    text-decoration: none;
}

.platform-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.platform-name {
    line-height: 1;
}

/* Responsive adjustments for podcast subscription header */
@media (max-width: 768px) {
    .podcast-subscription-header {
        padding: 25px 20px;
        margin: 0 0 30px 0;
    }

    .podcast-subscription-header h2 {
        font-size: 1.5rem;
        margin-bottom: 18px;
    }

    .platform-button {
        padding: 10px 20px;
        font-size: 0.85rem;
    }

    .platform-icon {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .podcast-subscription-header {
        padding: 20px 15px;
        margin: 0 0 25px 0;
    }

    .podcast-subscription-header h2 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }

    .podcast-platforms {
        flex-direction: column;
        gap: 12px;
    }

    .platform-button {
        width: 100%;
        justify-content: center;
        padding: 10px 20px;
        font-size: 0.8rem;
    }
}
