/* Mobile Touch/Scroll Fixes for mstimaj.com - FINAL CORRECTED VERSION
   All mobile issues systematically fixed
   Created: January 11, 2025 - Launch Day
*/

/* ====================================
   CRITICAL SCROLL FIX - MINIMAL CHANGES
   ==================================== */

/* Enable smooth touch scrolling on iOS/Android */
html {
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
}

/* Fix body scrolling without breaking positioning */
body {
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
}

/* Prevent horizontal scroll only */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

/* ====================================
   NAVBAR POSITION FIX
   ==================================== */

/* Ensure navbar stays at top - DO NOT override position fixed */
header,
.nav-wrapper,
.main-nav {
    /* Do not change position property */
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1000 !important;
}

/* Fix body - NO padding-top since header is sticky (not fixed) */
/* The black section was caused by body padding pushing content down */
@media (max-width: 768px) {
    body {
        padding-top: 0 !important; /* Sticky header, no padding needed */
    }

    /* Main content flows naturally below sticky header */
    main {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
}

/* ====================================
   HAMBURGER MENU FIX
   ==================================== */

/* Ensure hamburger button is clickable */
.nav-toggle {
    pointer-events: auto !important;
    z-index: 1001 !important;
    position: relative !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
}

/* Fix nav links positioning on mobile */
@media (max-width: 768px) {
    .nav-links {
        pointer-events: auto !important;
        z-index: 999 !important;
    }
    
    .nav-links.show {
        pointer-events: auto !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
}

/* ====================================
   MATRIX BACKGROUND FIX
   ==================================== */

/* Keep matrix behind navbar */
.matrix-bg {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: -1 !important;
    pointer-events: none !important;
}

/* ====================================
   CONNECT PAGE SPECIFIC FIXES
   ==================================== */

/* Fix input colors on Connect page */
.contact-form input,
.contact-form textarea,
.newsletter-form input,
.newsletter-form textarea,
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
    background-color: rgba(10, 10, 15, 0.8) !important;
    color: #e0e0e0 !important;
    border: 1px solid rgba(0, 255, 157, 0.3) !important;
}

/* Fix input focus states */
input:focus,
textarea:focus {
    background-color: rgba(10, 10, 15, 0.9) !important;
    border-color: #00ff9d !important;
    outline: none !important;
}

/* Fix placeholder colors */
input::placeholder,
textarea::placeholder {
    color: rgba(224, 224, 224, 0.5) !important;
}

/* ====================================
   AI CHATBOX - COMPLETELY HANDS OFF
   ==================================== */

/* ENSURE AI CHATBOX GLOW WORKS ON MOBILE */
/* The original mstimaj-ai-chat.css handles:
   - Glow effect: box-shadow: 0 8px 25px rgba(0, 255, 157, 0.3);
   - Float animation: animation: ai-float 3s ease-in-out infinite;
   - Pulse rings: animation: ai-pulse 2s ease-out infinite;
*/

/* MOBILE AI GLOW FIX - Force the glow effect to work AND center it */
@media (max-width: 768px) {
    /* Ensure mobile AI chat has proper glow - force it if needed */
    .ai-avatar-button .ai-avatar-container {
        box-shadow: 0 8px 25px rgba(0, 255, 157, 0.3) !important;
        animation: ai-float 3s ease-in-out infinite !important;
        
        /* Center the glow effect for mobile size (60px) */
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .ai-avatar-button,
    .ai-avatar-container {
        /* Ensure animations and effects work */
        will-change: transform, opacity, box-shadow !important;
        -webkit-backface-visibility: hidden !important;
        backface-visibility: hidden !important;
        
        /* Ensure it's visible and clickable */
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        
        /* Ensure proper centering */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Fix pulse ring centering on mobile */
    .ai-pulse-ring {
        top: -10px !important;
        left: -10px !important;
        width: 80px !important; /* Adjusted for 60px mobile size */
        height: 80px !important; /* Adjusted for 60px mobile size */
    }
    
    /* Don't let any global animation overrides affect AI chat */
    .ai-avatar-button * {
        animation-duration: inherit !important;
        transition-duration: inherit !important;
    }
    
    /* Fix copyright to be exactly 2 lines on mobile ONLY */
    @media (max-width: 768px) {
        /* Target the last paragraph in footer (likely copyright) */
        footer p:last-of-type,
        .site-info,
        .site-info p {
            font-size: 0.7rem !important;
            line-height: 1.4 !important;
            text-align: center !important;
            max-width: 70% !important; /* Even narrower to force wrapping */
            margin: 0.5rem auto !important;
            display: block !important;
            word-break: break-word !important;
            white-space: normal !important;
        }
    }
}

/* ====================================
   AI CHATBOX INPUT ALIGNMENT FIX
   ==================================== */

/* Fix AI chat input alignment within wrapper for desktop and mobile */
.ai-input-wrapper {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important; /* Prevent input from overflowing */
}

.ai-chat-input {
    flex: 1 !important;
    background: none !important;
    border: none !important;
    outline: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    min-width: 0 !important; /* Allows flex item to shrink below content size */
}

.ai-send-button {
    flex-shrink: 0 !important; /* Prevent button from shrinking */
    margin-left: 8px !important; /* Space between input and button */
}

/* Mobile-specific AI chat input fixes */
@media (max-width: 768px) {
    .ai-input-wrapper {
        padding: 3px !important; /* Slightly less padding on mobile */
    }
    
    .ai-chat-input {
        padding: 10px 12px !important; /* Adjusted padding for mobile */
        font-size: 14px !important;
    }
    
    .ai-send-button {
        width: 36px !important;
        height: 36px !important;
        margin-left: 6px !important;
    }
}

/* ====================================
   HUMAN ALGORITHM ARCHIVE - MOBILE & TABLET FIXES
   ==================================== */

/* MOBILE ARCHIVE FIXES - SINGLE COLUMN LAYOUT */
@media (max-width: 768px) {
    /* Content containers */
    .content-container {
        padding: 0 0.5rem !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    
    .articles-display {
        padding: 0 !important;
        margin: 0 !important;
        overflow-x: hidden !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Featured and regular articles sections */
    .featured-articles-section,
    .regular-articles-section {
        margin: 1rem 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
        width: 100% !important;
    }
    
    /* FORCE SINGLE COLUMN ON MOBILE - SPECIFIC TO ARTICLES ONLY */
    .voiceitonce-articles-grid,
    .articles-grid,
    .content-grid,
    .regular-articles-section .voiceitonce-articles-grid,
    .featured-articles-section .voiceitonce-articles-grid {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
        gap: 1.5rem !important;
        margin: 1rem 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }
    
    /* Override any inline grid styles on mobile - ONLY FOR ARTICLES */
    .voiceitonce-articles-grid[style*="grid-template-columns"],
    .articles-grid[style*="grid-template-columns"],
    .content-grid[style*="grid-template-columns"] {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
    }
    
    /* Article cards mobile fixes - CONTAINER-AWARE SIZING */
    .voiceitonce-article-card,
    .human-algorithm-item,
    article.voiceitonce-article-card,
    article.human-algorithm-item {
        margin: 0 0 1.5rem 0 !important;
        padding: 1rem !important;
        aspect-ratio: auto !important; /* Remove fixed aspect ratio on mobile */
        min-height: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        height: auto !important;
        position: relative !important;
    }
    
    /* NUCLEAR OPTION - Override any inline aspect-ratio and sizing styles */
    .voiceitonce-article-card[style],
    .human-algorithm-item[style],
    article.voiceitonce-article-card[style],
    article.human-algorithm-item[style],
    article[style*="aspect-ratio"],
    article[class*="voiceitonce-article"][style] {
        aspect-ratio: auto !important;
        height: auto !important;
        min-height: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        left: auto !important;
        right: auto !important;
    }
    
    /* Ensure parent containers have proper mobile padding */
    .content-container,
    .articles-display,
    .featured-articles-section,
    .regular-articles-section {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        box-sizing: border-box !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
}

/* TABLET ARCHIVE FIXES */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Fix tablet article cards - remove aspect ratio constraints */
    .voiceitonce-article-card,
    .human-algorithm-item,
    article.voiceitonce-article-card,
    article.human-algorithm-item {
        aspect-ratio: auto !important; /* Remove fixed aspect ratio on tablet */
        min-height: auto !important;
        height: auto !important;
        padding: 1.25rem !important;
    }
    
    /* Override inline aspect-ratio styles for tablet */
    article[style*="aspect-ratio: 1/1"],
    article[style*="aspect-ratio: 2/1"],
    article[style*="aspect-ratio"] {
        aspect-ratio: auto !important;
        height: auto !important;
        min-height: auto !important;
    }
    
    /* Fix read more button alignment on tablet */
    .voiceitonce-article-meta .meta-right {
        display: flex !important;
        justify-content: flex-end !important;
        margin-left: auto !important;
    }
}

/* MOBILE & TABLET HEADER FIXES - DO NOT TOUCH DESKTOP */
@media (max-width: 768px) {
    /* Remove gap between navbar and page header on mobile */
    main {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    .page-header {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* Mobile header fixes - reduce excessive padding */
    .page-header .header-content,
    .header-content[style*="padding: 4rem 0"] {
        padding: 1rem 0 !important; /* Reduce from 4rem to 1rem on mobile */
    }
    
    /* Mobile title sizing */
    .page-header h1,
    #page-title {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.75rem !important;
    }
    
    .page-header .subtitle {
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    /* Remove gap between navbar and page header on tablet */
    main {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    .page-header {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* Tablet header fixes - reduce excessive padding */
    .page-header .header-content,
    .header-content[style*="padding: 4rem 0"] {
        padding: 1.5rem 0 !important; /* Reduce from 4rem to 1.5rem on tablet */
    }
    
    /* Tablet title sizing */
    .page-header h1,
    #page-title {
        font-size: 2rem !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
    }
    
    .page-header .subtitle {
        font-size: 1rem !important;
        line-height: 1.4 !important;
    }
}

/* ====================================
   SINGLE ARTICLE PAGE - MOBILE & TABLET FIXES
   ==================================== */

/* SINGLE ARTICLE MOBILE FIXES */
@media (max-width: 768px) {
    /* Fix horizontal scroll on single articles */
    .single-voice_article,
    .single-article {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    .single-voice_article main,
    .single-article main {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
    
    /* Article page header fixes */
    .single-voice_article .page-header,
    .single-article .page-header {
        margin-top: 0 !important;
        padding: 0 1rem !important;
    }
    
    .single-voice_article .header-content,
    .single-article .header-content {
        padding: 1rem 0 !important;
    }
    
    /* Article title sizing */
    .single-voice_article h1,
    .single-article h1,
    .article-title {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
        margin-bottom: 1rem !important;
    }
    
    /* Article content container */
    .article-content,
    .single-article-content,
    .voice-article-content {
        padding: 0 1rem !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    
    /* Article meta information */
    .article-meta,
    .voice-article-meta {
        padding: 0 1rem !important;
        font-size: 0.9rem !important;
        margin: 1rem 0 !important;
    }
    
    /* Article categories and tags */
    .article-categories,
    .article-tags,
    .voice-categories {
        margin: 1rem !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }
    
    .category-tag,
    .article-tag,
    .voice-category-tag {
        font-size: 0.8rem !important;
        padding: 0.3rem 0.7rem !important;
        margin: 0.2rem !important;
    }
    
    /* Article paragraphs and content */
    .article-content p,
    .voice-article-content p,
    .single-article-content p {
        font-size: 1rem !important;
        line-height: 1.6 !important;
        margin-bottom: 1.2rem !important;
        text-align: left !important;
    }
    
    /* Article navigation (prev/next) */
    .article-navigation,
    .post-navigation {
        padding: 0 1rem !important;
        margin: 2rem 0 !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .nav-previous,
    .nav-next {
        width: 100% !important;
        text-align: center !important;
        padding: 1rem !important;
        font-size: 0.9rem !important;
    }
    
    /* Comments section */
    .comments-section,
    .article-comments {
        padding: 0 1rem !important;
        margin: 2rem 0 !important;
    }
    
    /* Comment form styling */
    .comment-form,
    .post-comment-form {
        padding: 1rem !important;
        margin: 1rem 0 !important;
    }
    
    .comment-form h3,
    .comment-form h4 {
        font-size: 1.2rem !important;
        margin-bottom: 1rem !important;
    }
    
    .comment-form input,
    .comment-form textarea {
        width: 100% !important;
        padding: 0.75rem !important;
        font-size: 1rem !important;
        margin-bottom: 1rem !important;
        border-radius: 4px !important;
        box-sizing: border-box !important;
    }
    
    .comment-form textarea {
        min-height: 120px !important;
        resize: vertical !important;
    }
    
    .comment-form button,
    .comment-form input[type="submit"] {
        width: 100% !important;
        padding: 1rem !important;
        font-size: 1rem !important;
        font-weight: 600 !important;
        border-radius: 4px !important;
        cursor: pointer !important;
    }
    
    /* Newsletter signup form */
    .newsletter-signup,
    .human-algorithm-signup {
        padding: 1rem !important;
        margin: 2rem 0 !important;
        text-align: center !important;
    }
    
    .newsletter-signup h3,
    .newsletter-signup h4 {
        font-size: 1.2rem !important;
        margin-bottom: 1rem !important;
    }
    
    .newsletter-form,
    .signup-form {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
        max-width: 100% !important;
        margin: 1rem 0 !important;
    }
    
    .newsletter-form input,
    .signup-form input {
        width: 100% !important;
        padding: 0.75rem !important;
        font-size: 1rem !important;
        border-radius: 4px !important;
        box-sizing: border-box !important;
    }
    
    /* FORCE newsletter form alignment on MOBILE ONLY - preserve tablet layout */
    .newsletter-form,
    .newsletter-form div,
    .newsletter-form .form-group {
        padding-left: 0 !important;
        margin-left: 0 !important;
    }
    
    /* Ensure the checkbox container has no extra padding on MOBILE ONLY */
    .newsletter-form div[style*="display: flex"] {
        padding-left: 0 !important;
        margin-left: 0 !important;
    }
    
    /* FORCE both checkboxes to be identical on MOBILE ONLY */
    .newsletter-form input[type="checkbox"]#newsletter_privacy_consent,
    .contact-form input[type="checkbox"]#privacy_consent {
        padding: 0 !important;
        margin: 0 !important;
        width: auto !important;
        height: auto !important;
        position: static !important;
    }
    
    .contact-form {
        padding-left: 0 !important;
        margin-left: 0 !important;
    }
    
    .newsletter-form button,
    .signup-form button {
        width: 100% !important;
        padding: 1rem !important;
        font-size: 1rem !important;
        font-weight: 600 !important;
        border-radius: 4px !important;
        cursor: pointer !important;
    }
    
    
    /* Privacy policy and consent text */
    .privacy-consent,
    .newsletter-consent {
        font-size: 0.8rem !important;
        line-height: 1.4 !important;
        margin: 0.5rem 0 !important;
        text-align: center !important;
    }
    
    .privacy-consent label,
    .newsletter-consent label {
        display: flex !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
        text-align: left !important;
    }
    
    /* More from Human Algorithm section */
    .more-articles,
    .back-to-human-algorithm {
        padding: 0 1rem !important;
        margin: 2rem 0 !important;
        text-align: center !important;
    }
    
    .back-link,
    .more-articles a {
        display: inline-block !important;
        padding: 0.75rem 1.5rem !important;
        font-size: 1rem !important;
        font-weight: 600 !important;
        text-decoration: none !important;
        border-radius: 4px !important;
        margin: 0.5rem 0 !important;
    }
    
    /* Related articles */
    .related-articles {
        padding: 0 1rem !important;
        margin: 2rem 0 !important;
    }
    
    .related-articles-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

/* SINGLE ARTICLE TABLET FIXES */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Fix horizontal scroll on single articles - tablet */
    .single-voice_article,
    .single-article {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    .single-voice_article main,
    .single-article main {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
    
    /* Article title sizing for tablet */
    .single-voice_article h1,
    .single-article h1,
    .article-title {
        font-size: 2.2rem !important;
        line-height: 1.2 !important;
        margin-bottom: 1.2rem !important;
    }
    
    /* Article content container for tablet */
    .article-content,
    .single-article-content,
    .voice-article-content {
        padding: 0 2rem !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    
    /* Article paragraphs for tablet */
    .article-content p,
    .voice-article-content p,
    .single-article-content p {
        font-size: 1.1rem !important;
        line-height: 1.6 !important;
    }
    
    /* Comment form for tablet */
    .comment-form,
    .post-comment-form {
        padding: 1.5rem !important;
        max-width: 600px !important;
        margin: 1.5rem auto !important;
    }
    
    /* Newsletter form for tablet - FIXED */
    .newsletter-form,
    .signup-form {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
        max-width: 500px !important;
        margin: 1rem auto !important;
        align-items: stretch !important;
    }
    
    /* Fix form-row on tablet to stack vertically */
    .newsletter-form .form-row {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
        width: 100% !important;
    }
    
    .newsletter-form .form-row .form-group {
        width: 100% !important;
        margin: 0 !important;
    }
    
    .newsletter-form input,
    .signup-form input {
        width: 100% !important;
        padding: 0.75rem !important;
        margin-bottom: 0 !important;
        box-sizing: border-box !important;
    }
    
    .newsletter-form button,
    .signup-form button {
        width: 100% !important;
        padding: 1rem !important;
        margin-top: 0.5rem !important;
    }
    
    /* FORCE both checkboxes to be identical on TABLET too */
    .newsletter-form input[type="checkbox"]#newsletter_privacy_consent,
    .contact-form input[type="checkbox"]#privacy_consent {
        padding: 0 !important;
        margin: 0 !important;
        width: auto !important;
        height: auto !important;
        position: static !important;
    }
    
    
    /* Related articles grid for tablet */
    .related-articles-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }
}
    
    /* Fix article titles on mobile */
    .voiceitonce-article-title {
        font-size: 1.1rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* Fix article excerpts */
    .voiceitonce-article-excerpt {
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
        margin-bottom: 1rem !important;
    }
    
    /* Fix article meta - make read more right-aligned */
    .voiceitonce-article-meta {
        flex-direction: column !important;
        gap: 0.75rem !important;
        align-items: stretch !important;
    }
    
    .voiceitonce-article-meta .meta-left {
        justify-content: center !important;
        font-size: 0.8rem !important;
    }
    
    .voiceitonce-article-meta .meta-right {
        display: flex !important;
        justify-content: flex-end !important; /* Right-align read more */
        align-self: flex-end !important;
    }
    
    .read-more-link {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.8rem !important;
        white-space: nowrap !important;
    }
    
    /* Fix pagination on mobile */
    .voiceitonce-pagination {
        flex-wrap: wrap !important;
        gap: 0.25rem !important;
        margin: 2rem 0 1rem 0 !important;
        padding: 0 1rem !important;
    }
    
    .voiceitonce-page-btn {
        padding: 0.3rem 0.7rem !important;
        font-size: 0.85rem !important;
        min-width: 35px !important;
    }
    
    /* Fix category tags */
    .voiceitonce-category-tag {
        font-size: 0.7rem !important;
        padding: 0.2rem 0.6rem !important;
    }
    
    /* Fix badges */
    .voiceitonce-badge {
        font-size: 0.65rem !important;
        padding: 0.15rem 0.5rem !important;
    }
}

/* ====================================
   HUMAN ALGORITHM SIDEBAR MOBILE FIXES
   ==================================== */

@media (max-width: 768px) {
    /* Fix Browse Categories boxes */
    .browse-categories,
    .categories-section,
    .category-grid {
        padding: 1rem !important;
        margin: 1rem 0 !important;
    }
    
    .category-item,
    .category-card {
        width: 100% !important;
        margin: 0.5rem 0 !important;
        padding: 0.75rem !important;
        font-size: 0.9rem !important;
    }
    
    /* Fix Support My Work boxes */
    .support-section,
    .support-work,
    .donation-section {
        padding: 1rem !important;
        margin: 1rem 0 !important;
        text-align: center !important;
    }
    
    .support-button,
    .donate-button {
        display: block !important;
        width: 100% !important;
        max-width: 250px !important;
        margin: 0.5rem auto !important;
        padding: 0.75rem 1rem !important;
        font-size: 0.9rem !important;
    }
    
    /* Fix Recent Articles links */
    .recent-articles,
    .sidebar-recent,
    .recent-posts {
        padding: 1rem !important;
        margin: 1rem 0 !important;
    }
    
    .recent-article-item,
    .recent-post-item {
        margin: 0.75rem 0 !important;
        padding: 0.5rem 0 !important;
        border-bottom: 1px solid rgba(0, 255, 157, 0.1) !important;
    }
    
    .recent-article-title,
    .recent-post-title {
        font-size: 0.9rem !important;
        line-height: 1.3 !important;
    }
    
    .recent-article-date,
    .recent-post-date {
        font-size: 0.75rem !important;
        margin-top: 0.25rem !important;
    }
}

/* ====================================
   HOME PAGE BOX ALIGNMENT FIX
   ==================================== */

/* Fix hero CTA button alignment */
.hero-cta {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 1rem !important;
    margin-top: 2rem !important;
}

/* Ensure both buttons have equal width and alignment */
.hero-cta .btn-primary,
.hero-cta .btn-secondary {
    flex: 1 1 auto !important;
    max-width: 300px !important;
    min-width: 250px !important;
    text-align: center !important;
    padding: 1rem 2rem !important;
    margin: 0 !important;
    
    /* Ensure equal height */
    box-sizing: border-box !important;
    height: auto !important;
    line-height: 1.2 !important;
}

/* Mobile stacking for hero buttons */
@media (max-width: 768px) {
    .hero-cta {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
    }
    
    .hero-cta .btn-primary,
    .hero-cta .btn-secondary {
        width: 100% !important;
        max-width: 300px !important;
        margin: 0 auto !important;
    }
}

/* ====================================
   FOOTER SPACING FIX - SOCIAL SECTION
   ==================================== */

/* Fix ONLY social links spacing - DO NOT TOUCH OTHER FOOTER ELEMENTS */
.social-links,
.social-links-container,
.social-link {
    line-height: 1.6 !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important; 
    padding: 0 !important;
    margin: 0 !important;
}

/* NUCLEAR OPTION - REMOVE ALL SPACING FROM SOCIAL LINKS */
a.social-link,
.social-links-container a.social-link,
.social-links a.social-link {
    padding: 0 !important;
    margin: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    gap: 0.1rem !important;
    display: inline-flex !important;
    align-items: center !important;
    line-height: 1 !important;
}

/* NUCLEAR OPTION - REMOVE ALL SPACING FROM SVG ICONS */
a.social-link svg,
.social-links-container a.social-link svg,
.social-links a.social-link svg {
    margin: 0 !important;
    padding: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    margin-left: 0 !important;
    margin-right: 0.1rem !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Fix ONLY social links text elements - DO NOT TOUCH QUICK LINKS */
.social-links p,
.social-links a,
.social-links span {
    line-height: 1.6 !important;
    margin-bottom: 0.5rem !important;
}

/* Fix ONLY social links list spacing - DO NOT TOUCH MAIN FOOTER NAVIGATION */
.social-links ul {
    line-height: 1.6 !important;
}

.social-links li {
    line-height: 1.6 !important;
    margin-bottom: 0.25rem !important;
}

/* ====================================
   PAGE TITLE OVERLAP FIX
   ==================================== */

@media (max-width: 768px) {
    /* Fix page titles not overlapping with navbar */
    .page-header,
    .page-title,
    .hero,
    .hero-section,
    h1:first-child {
        margin-top: 1rem !important;
        padding-top: 1rem !important;
    }
    
    /* Connect page specific title fix */
    .connect-page h1,
    .connect-header h1 {
        margin-top: 1rem !important;
    }
}

/* ====================================
   LAUNCH BANNER - HIDDEN ON MOBILE
   ==================================== */

/* Hide launch banner completely on mobile */
@media (max-width: 768px) {
    #launch-special-banner {
        display: none !important;
    }
}

/* ====================================
   PORTFOLIO PAGE MOBILE FIXES
   ==================================== */

@media (max-width: 768px) {
    /* Portfolio grid mobile improvements */
    .portfolio-grid {
        padding: 1rem !important;
        gap: 1.5rem !important;
    }
    
    /* Project cards mobile spacing */
    .project-card {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* Project content mobile adjustments */
    .project-content h2 {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
        margin-bottom: 1rem !important;
    }
    
    /* Plugin grid mobile - force single column */
    .plugins-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        margin: 1.5rem 0 !important;
    }
    
    /* Plugin cards mobile padding */
    .plugin-card {
        padding: 1rem !important;
        text-align: center !important;
    }
    
    /* Beta form mobile improvements */
    .tester-form {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .tester-form div {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .tester-form input[type="text"],
    .tester-form input[type="email"] {
        width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
    }
    
    /* Form container mobile padding */
    .tester-form div[style*="background: linear-gradient"] {
        padding: 1.5rem 1rem !important;
        margin: 1.5rem 0 !important;
    }
    
    /* Project meta mobile stacking */
    .project-meta {
        flex-direction: column !important;
        gap: 0.5rem !important;
        align-items: flex-start !important;
    }
    
    /* Status and category mobile sizing */
    .status, .category {
        font-size: 0.8rem !important;
        padding: 0.4rem 0.8rem !important;
    }
    
    /* Project actions mobile stacking */
    .project-actions {
        flex-direction: column !important;
        gap: 1rem !important;
        margin-top: 1.5rem !important;
    }
    
    .btn-primary, .btn-secondary {
        width: 100% !important;
        text-align: center !important;
        padding: 1rem !important;
        font-size: 0.9rem !important;
    }
    
    /* Project features mobile list */
    .project-features ul {
        padding-left: 0 !important;
        margin: 1rem 0 !important;
    }
    
    .project-features li {
        padding-left: 1rem !important;
        margin: 0.75rem 0 !important;
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
    }
    
    /* Checkbox labels mobile layout */
    .tester-form label[style*="display: flex"] {
        flex-wrap: wrap !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
        font-size: 0.8rem !important;
        line-height: 1.4 !important;
    }
    
    /* Privacy consent mobile layout */
    .tester-form div[style*="display: flex; align-items: center"] {
        flex-direction: row !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
        text-align: left !important;
    }
    
    /* Mobile form button */
    .tester-form button {
        width: 100% !important;
        padding: 1rem !important;
        font-size: 1rem !important;
        margin-top: 1rem !important;
    }
    
    /* ARTICLE NEWSLETTER CONSENT FIX - Mobile-specific override */
    .single-voice_article .newsletter-section {
        text-align: center !important;
    }
    
    .single-voice_article .newsletter-section form > div:last-of-type {
        display: flex !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        text-align: left !important;
        gap: 8px !important;
        margin: 0 auto 1rem auto !important;
        width: 100% !important;
        max-width: 90% !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    
    .single-voice_article .newsletter-section input[type="checkbox"]#article_newsletter_privacy_consent {
        flex: 0 0 auto !important;
        margin: 2px 8px 0 0 !important;
        padding: 0 !important;
        width: auto !important;
        height: auto !important;
    }
    
    .single-voice_article .newsletter-section label[for="article_newsletter_privacy_consent"] {
        flex: 1 !important;
        text-align: left !important;
        line-height: 1.4 !important;
        margin: 0 !important;
        padding: 0 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        width: auto !important;
    }
}

/* ====================================
   FAQ PAGE MOBILE FIXES
   ==================================== */

@media (max-width: 768px) {
    /* FAQ page container mobile padding */
    .faq-page {
        padding: 1rem 0.5rem !important;
        max-width: 100% !important;
    }
    
    /* FAQ hero section mobile */
    .faq-hero {
        padding: 2rem 1rem !important;
        margin-bottom: 2rem !important;
        border-radius: 8px !important;
    }
    
    .faq-hero h1 {
        font-size: 1.8rem !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
    }
    
    .faq-hero .tagline {
        font-size: 1rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0.75rem !important;
    }
    
    .faq-hero .mission {
        font-size: 0.9rem !important;
        letter-spacing: 1px !important;
    }
    
    /* FAQ sections mobile spacing */
    .faq-section {
        margin-bottom: 2rem !important;
    }
    
    .faq-section h2 {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
        margin-bottom: 1.5rem !important;
        padding-bottom: 0.5rem !important;
    }
    
    /* FAQ items mobile layout */
    .faq-item {
        margin-bottom: 1rem !important;
        border-radius: 6px !important;
    }
    
    /* FAQ questions mobile */
    .faq-question {
        padding: 1rem !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
    }
    
    .faq-question h3 {
        font-size: 0.95rem !important;
        line-height: 1.4 !important;
        margin: 0 !important;
        flex: none !important;
        width: 100% !important;
    }
    
    .faq-toggle {
        align-self: flex-end !important;
        margin-left: 0 !important;
        margin-top: -2rem !important;
        position: relative !important;
        z-index: 1 !important;
    }
    
    /* FAQ answers mobile */
    .faq-answer {
        padding: 0 1rem !important;
    }
    
    .faq-answer.active {
        padding: 1rem !important;
        max-height: 2000px !important;
    }
    
    .faq-answer p {
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
        margin-bottom: 1rem !important;
    }
    
    .faq-answer ul {
        padding-left: 1.5rem !important;
        margin: 0.75rem 0 !important;
    }
    
    .faq-answer li {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* FAQ highlight boxes mobile */
    .faq-answer .highlight {
        padding: 0.75rem !important;
        margin: 0.75rem 0 !important;
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
    }
    
    /* Contact CTA mobile */
    .contact-cta {
        padding: 2rem 1rem !important;
        margin-top: 2rem !important;
        border-radius: 8px !important;
        text-align: center !important;
    }
    
    .contact-cta h2 {
        font-size: 1.5rem !important;
        margin-bottom: 1rem !important;
    }
    
    .contact-cta p {
        font-size: 1rem !important;
        line-height: 1.5 !important;
        margin-bottom: 1.5rem !important;
    }
    
    .contact-cta .btn-primary {
        width: 100% !important;
        max-width: 300px !important;
        padding: 1rem 1.5rem !important;
        font-size: 1rem !important;
        display: block !important;
        margin: 0 auto !important;
    }
}

/* FAQ page tablet fixes */
@media (min-width: 769px) and (max-width: 1024px) {
    .faq-page {
        padding: 1.5rem 1rem !important;
    }
    
    .faq-hero {
        padding: 2.5rem 1.5rem !important;
    }
    
    .faq-hero h1 {
        font-size: 2.5rem !important;
    }
    
    .faq-question {
        padding: 1.25rem !important;
    }
    
    .faq-answer.active {
        padding: 1.25rem !important;
    }
    
    .contact-cta {
        padding: 2.5rem 1.5rem !important;
    }
}

/* ====================================
   SUPPORT & LEGAL PAGES MOBILE FIXES
   ==================================== */

@media (max-width: 768px) {
    /* ACTUAL page class names used in the templates */
    .accessibility-page,
    .privacy-policy,
    .terms-of-service,
    .cookie-policy,
    .bug-report-page,
    .feedback-page,
    .sitemap-page,
    .testimonials-page,
    .gratitude-page {
        padding: 1rem 0.5rem !important;
        max-width: 100% !important;
        line-height: 1.6 !important;
    }
    
    /* Hero sections - like FAQ page */
    .accessibility-hero,
    .testimonials-hero,
    .bug-report-hero,
    .privacy-hero,
    .terms-hero,
    .cookie-hero,
    .support-hero {
        padding: 2rem 1rem !important;
        margin-bottom: 2rem !important;
        border-radius: 8px !important;
        text-align: center !important;
    }
    
    .accessibility-hero h1,
    .testimonials-hero h1,
    .bug-report-hero h1,
    .privacy-hero h1,
    .terms-hero h1,
    .cookie-hero h1,
    .support-hero h1,
    .gratitude-hero h1,
    .accessibility-page h1,
    .privacy-policy h1,
    .terms-of-service h1,
    .cookie-policy h1,
    .testimonials-page h1,
    .bug-report-page h1,
    .gratitude-page h1 {
        font-size: 1.8rem !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
    }
    
    /* Page content headings */
    .accessibility-page h2,
    .privacy-policy h2,
    .terms-of-service h2,
    .cookie-policy h2,
    .bug-report-page h2,
    .feedback-page h2,
    .sitemap-page h2,
    .testimonials-page h2,
    .gratitude-page h2 {
        font-size: 1.4rem !important;
        line-height: 1.3 !important;
        margin: 2rem 0 1rem 0 !important;
    }
    
    .accessibility-page h3,
    .privacy-policy h3,
    .terms-of-service h3,
    .cookie-policy h3,
    .bug-report-page h3,
    .feedback-page h3,
    .sitemap-page h3,
    .testimonials-page h3,
    .gratitude-page h3 {
        font-size: 1.2rem !important;
        line-height: 1.3 !important;
        margin: 1.5rem 0 0.75rem 0 !important;
    }
    
    .accessibility-page p,
    .privacy-policy p,
    .terms-of-service p,
    .cookie-policy p,
    .bug-report-page p,
    .feedback-page p,
    .sitemap-page p,
    .testimonials-page p,
    .gratitude-page p {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
        margin-bottom: 1rem !important;
    }
    
    /* Forms in support pages */
    .support-form,
    .feedback-form,
    .bug-report-form,
    .newsletter-form {
        padding: 1rem !important;
        margin: 1.5rem 0 !important;
        border-radius: 6px !important;
    }
    
    .support-form input,
    .support-form textarea,
    .support-form select {
        width: 100% !important;
        padding: 0.75rem !important;
        margin-bottom: 1rem !important;
        font-size: 1rem !important;
        box-sizing: border-box !important;
    }
    
    .support-form textarea {
        min-height: 120px !important;
        resize: vertical !important;
    }
    
    .support-form button,
    .support-form input[type="submit"] {
        width: 100% !important;
        padding: 1rem !important;
        font-size: 1rem !important;
        margin-top: 1rem !important;
    }
    
    /* Lists in support/legal pages */
    .accessibility-page ul,
    .privacy-policy ul,
    .terms-of-service ul,
    .cookie-policy ul,
    .bug-report-page ul,
    .feedback-page ul,
    .sitemap-page ul,
    .testimonials-page ul,
    .gratitude-page ul {
        padding-left: 1.5rem !important;
        margin: 1rem 0 !important;
    }
    
    .accessibility-page li,
    .privacy-policy li,
    .terms-of-service li,
    .cookie-policy li,
    .bug-report-page li,
    .feedback-page li,
    .sitemap-page li,
    .testimonials-page li,
    .gratitude-page li {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* Tables in support pages */
    .support-table-wrapper {
        overflow-x: auto !important;
        margin: 1rem 0 !important;
        border-radius: 6px !important;
    }
    
    .support-table,
    .legal-table {
        min-width: 500px !important;
        font-size: 0.8rem !important;
    }
    
    .support-table th,
    .support-table td,
    .legal-table th,
    .legal-table td {
        padding: 0.5rem !important;
        text-align: left !important;
    }
    
    /* Contact cards */
    .contact-card,
    .support-card {
        padding: 1rem !important;
        margin: 1rem 0 !important;
        border-radius: 6px !important;
        text-align: center !important;
    }
    
    .contact-card h3,
    .support-card h3 {
        font-size: 1.2rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* Testimonials specific */
    .testimonial-card {
        padding: 1rem !important;
        margin: 1rem 0 !important;
        border-radius: 6px !important;
    }
    
    .testimonial-text {
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
        margin-bottom: 1rem !important;
    }
    
    .testimonial-author {
        font-size: 0.85rem !important;
        text-align: right !important;
    }
    
    /* Newsletter preferences */
    .preference-group {
        margin: 1.5rem 0 !important;
        padding: 1rem !important;
        border-radius: 6px !important;
    }
    
    .preference-group h3 {
        font-size: 1.1rem !important;
        margin-bottom: 1rem !important;
    }
    
    .checkbox-group {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .checkbox-group label {
        display: flex !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
    }
    
    /* Success/Error messages */
    .success-message,
    .error-message,
    .info-message {
        padding: 1rem !important;
        margin: 1rem 0 !important;
        border-radius: 6px !important;
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
    }
    
    /* Navigation breadcrumbs */
    .page-breadcrumbs {
        padding: 0.5rem 1rem !important;
        margin-bottom: 1rem !important;
        font-size: 0.8rem !important;
    }
    
    .page-breadcrumbs a {
        margin-right: 0.5rem !important;
    }
    
    /* Back to top buttons */
    .back-to-top {
        bottom: 20px !important;
        right: 20px !important;
        width: 45px !important;
        height: 45px !important;
        font-size: 1.2rem !important;
    }
}

/* Tablet fixes for support/legal pages */
@media (min-width: 769px) and (max-width: 1024px) {
    .accessibility-page,
    .privacy-page,
    .terms-page,
    .cookie-page,
    .bug-report-page,
    .feedback-page,
    .sitemap-page,
    .testimonials-page,
    .gratitude-page {
        padding: 1.5rem 1rem !important;
    }
    
    .support-page-header,
    .legal-page-header {
        padding: 2.5rem 1.5rem !important;
    }
    
    .support-page-header h1,
    .legal-page-header h1 {
        font-size: 2.2rem !important;
    }
    
    .support-content,
    .legal-content {
        padding: 0 1.5rem !important;
    }
    
    .support-form,
    .feedback-form {
        padding: 1.5rem !important;
        max-width: 600px !important;
        margin: 1.5rem auto !important;
    }
}

/* ====================================
   COURSES PAGE FIX (404 Error)
   ==================================== */

/* Ensure courses page content is properly styled */
.courses-page {
    padding-top: 2rem !important;
}

.course-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap: 2rem !important;
    margin: 2rem 0 !important;
}

@media (max-width: 768px) {
    .course-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

/* ====================================
   SCROLL ENHANCEMENT WITHOUT BREAKING
   ==================================== */

/* Hardware acceleration for smooth scroll */
@media (max-width: 768px) {
    .container,
    .content-wrapper,
    main,
    section {
        -webkit-overflow-scrolling: touch;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
}

/* ====================================
   iOS SPECIFIC FIXES (SAFE)
   ==================================== */

@supports (-webkit-touch-callout: none) {
    /* iOS only - fix scroll without breaking layout */
    body {
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Prevent zoom on input focus */
    input,
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* ====================================
   NEURAL CANVAS TABLET GRID FIX
   ==================================== */

/* Fix Neural Canvas content grid for tablet - 2 columns instead of 3 */
@media (min-width: 769px) and (max-width: 1199px) {
    /* Target the content grid sections on Neural Canvas page */
    .content-grid,
    .storyboard-grid,
    .templates-grid,
    .tutorials-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem !important;
    }
    
    /* Ensure grid items have proper spacing */
    .content-grid .grid-item,
    .storyboard-grid .grid-item,
    .templates-grid .grid-item,
    .tutorials-grid .grid-item {
        margin-bottom: 1.5rem !important;
    }
    
    /* Fix any flex-based grids that might be used */
    .grid-container {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem !important;
    }
}

/* ====================================
   OVERRIDE PROBLEMATIC RULES
   ==================================== */

/* Remove all the problematic !important height/position overrides */
@media (max-width: 768px) {
    html {
        position: static !important;
        height: auto !important;
    }
    
    body {
        position: relative !important;
        height: auto !important;
        min-height: 100vh !important;
    }
    
    /* Preserve original animations except for specific optimizations */
    * {
        animation-duration: inherit !important;
        transition-duration: inherit !important;
    }
    
    /* Only optimize heavy matrix animations */
    .matrix-rain,
    .matrix-char {
        animation-duration: 0.5s !important;
    }
    
    /* DO NOT TOUCH AI CHAT - removed all AI chat overrides */
}