/* --- Core Variables --- */
:root {
    --nav-bg: #111827;        
    --page-bg: #f4f5f7;       
    --card-bg: #ffffff;       
    --primary: #2563eb;       
    --primary-hover: #1d4ed8;
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --border: #e5e7eb;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--page-bg);
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    padding: 0 20px;
}

/* ==========================================================================
   --- TOP NAVIGATION BAR (Fixed & Bulletproof) ---
   ========================================================================== */
.top-bar {
    background-color: var(--nav-bg);
    color: white;
    border-bottom: 3px solid var(--primary);
    position: relative;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 75px;
    width: 100%;
}

.logo {
    font-size: 22px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-family: 'JetBrains Mono', monospace;
    background: var(--primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 16px;
    color: white;
}

.highlight { color: var(--primary); }

.nav-links { 
    display: flex; 
    gap: 15px; 
    align-items: center;
}

.nav-links a {
    color: #9ca3af;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-links a:hover { 
    color: white; 
    background: rgba(255,255,255,0.1); 
}

/* Active Highlight Styling (Just add class="active" to any HTML link) */
.nav-links a.active { 
    color: white; 
    background: var(--primary); 
}

#mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 8px;
}

/* --- MOBILE LAYOUT MATCHING SCREENSHOTS --- */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        padding-top: 20px;
        padding-bottom: 0;
    }

    .logo {
        margin-bottom: 15px;
    }

    #mobile-menu-btn {
        display: block;
        margin-bottom: 15px;
    }

    .nav-links {
        display: none; /* Hidden until clicked */
        width: 100%;
        flex-direction: column;
        background-color: var(--nav-bg);
        border-top: 1px solid #1f2937;
        gap: 0;
    }

    .nav-links.active {
        display: flex; /* Shown when clicked */
    }

    .nav-links a {
        width: 100%;
        text-align: center;
        padding: 18px 20px;
        font-size: 16px;
        border-radius: 0;
        border-bottom: 1px solid #1f2937;
    }
    
    .nav-links a:last-child {
        border-bottom: none;
    }
}

/* ==========================================================================
   --- MAIN CONTENT & HERO CARD ---
   ========================================================================== */
.main-content {
    flex: 1;
    padding: 40px 20px;
}

.solver-hero {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.05);
    margin-bottom: 50px;
}

.solver-header { text-align: center; margin-bottom: 35px; }
.solver-header h2 { font-size: 32px; font-weight: 800; margin-bottom: 8px; letter-spacing: -0.5px;}
.subtitle { color: var(--text-gray); font-size: 16px;}

/* --- INPUTS --- */
.input-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    margin-bottom: 35px;
}

.input-group label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 14px;}
.input-group small { display: block; color: var(--text-gray); margin-top: 8px; font-size: 13px; }

input {
    width: 100%;
    padding: 18px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    transition: border-color 0.2s;
    background: #f8fafc;
}

input:focus { outline: none; border-color: var(--primary); background: white; box-shadow: 0 0 0 3px rgba(37,99,235,0.1);}
#patternInput { font-size: 28px; letter-spacing: 12px; text-transform: lowercase; text-align: center;}
#deadLetters { font-size: 20px; letter-spacing: 6px; text-transform: lowercase; }

/* --- RESULTS AREA --- */
.results-area { border-top: 1px solid var(--border); padding-top: 25px; }
.results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.results-header h3 { font-size: 18px; font-weight: 700;}
.badge { background: var(--primary); color: white; padding: 6px 14px; border-radius: 20px; font-size: 14px; font-weight: 700; }

.word-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    list-style: none;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 10px;
}

.word-grid::-webkit-scrollbar { width: 6px; }
.word-grid::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 4px; }
.word-grid::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.word-grid li { 
    background: #f8fafc; 
    border: 1px solid var(--border);
    padding: 12px; 
    border-radius: 6px; 
    text-align: center; 
    font-family: 'JetBrains Mono', monospace; 
    font-weight: 700; 
    text-transform: uppercase;
    font-size: 15px;
}
.empty-state { 
    grid-column: 1 / -1; 
    background: transparent !important; 
    border: none !important;
    color: var(--text-gray); 
    text-transform: none !important; 
    font-family: 'Inter', sans-serif !important;
}

/* --- SEO ARTICLE HUB --- */
.hub-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 25px; }
.hub-header h3 { font-size: 22px; font-weight: 800;}
.view-all { color: var(--primary); text-decoration: none; font-weight: 600; font-size: 15px;}
.view-all:hover { text-decoration: underline; }

.article-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 25px; }
.article-card { 
    background: var(--card-bg); 
    border: 1px solid var(--border); 
    border-radius: 12px; 
    padding: 25px; 
    transition: transform 0.2s, box-shadow 0.2s; 
}
.article-card:hover { transform: translateY(-5px); box-shadow: 0 12px 20px -5px rgba(0,0,0,0.08); }
.article-category { font-size: 12px; font-weight: 800; color: var(--primary); text-transform: uppercase; margin-bottom: 12px; letter-spacing: 0.5px;}
.article-card h4 { line-height: 1.4; margin-bottom: 10px;}
.article-card h4 a { color: var(--text-dark); text-decoration: none; font-size: 19px; font-weight: 700;}
.article-card p { color: var(--text-gray); font-size: 15px; margin-bottom: 20px; line-height: 1.6; }
.read-more { color: var(--text-dark); font-weight: 700; text-decoration: none; border-bottom: 2px solid var(--primary); padding-bottom: 2px;}

/* --- ARTICLE SPECIFIC STYLING --- */
.breadcrumbs {
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 20px;
}
.breadcrumbs a { color: var(--primary); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

.seo-article {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 50px;
    margin-bottom: 50px;
}
.article-header { border-bottom: 1px solid var(--border); padding-bottom: 25px; margin-bottom: 30px; }
.article-header h1 { font-size: 36px; font-weight: 800; line-height: 1.2; margin-bottom: 10px; }
.author-date { color: var(--text-gray); font-size: 14px; }

.article-body p { font-size: 18px; margin-bottom: 24px; line-height: 1.8; color: #374151; }
.article-body h2 { font-size: 28px; margin: 40px 0 20px 0; font-weight: 700; color: var(--text-dark); }
.article-body h3 { font-size: 22px; margin: 30px 0 15px 0; }

.static-grid { margin-bottom: 40px; max-height: none; overflow-y: visible; }
.static-grid li { background: #f8fafc; border: 1px solid var(--border); color: var(--primary); }

.cta-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    margin-top: 50px;
}
.cta-box h3 { margin-top: 0; color: #166534; }
.cta-box .primary-btn { display: inline-block; background: var(--primary); color: white; padding: 12px 24px; border-radius: 8px; text-decoration: none; font-weight: bold; margin-top: 15px; }

/* ==========================================================================
   --- WORDPRESS HEADER OVERRIDES (Isolated to avoid breaking static HTML) ---
   ========================================================================== */

body, .main-navigation a, .main-title, .main-title a, h1, h2, h3, h4, p {
    font-family: 'Inter', sans-serif !important;
}

.site-header {
    border-bottom: 3px solid var(--primary);
    background-color: var(--nav-bg) !important;
    padding: 0 !important; 
}

.inside-header {
    max-width: 1000px !important; 
    margin: 0 auto !important;
    padding: 0 20px !important;
    height: auto !important; 
    min-height: 70px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.site-branding, .site-logo {
    margin-bottom: 0 !important;
    padding: 0 !important;
}

.main-title {
    font-size: 22px !important;
    font-weight: 800 !important;
    margin: 0 !important;
    line-height: 1 !important;
    display: flex;
    align-items: center;
}

.main-title a {
    color: #ffffff !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
}

.main-title a::before {
    content: "_a_";
    font-family: 'JetBrains Mono', monospace;
    background: var(--primary);
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 18px;
    color: white;
    margin-right: 12px; 
    line-height: 1;
}

.main-title a::after {
    content: "Pro";
    color: var(--primary);
    margin-left: 6px; 
}

/* General Mobile Layout Adjustments for App Content */
@media (max-width: 768px) {
    .input-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .solver-hero, .seo-article, .article-card {
        padding: 20px;
    }
    .solver-header h2, .article-header h1, .hub-hero-header h1 {
        font-size: 26px;
        line-height: 1.3;
    }
    .word-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
    .breadcrumbs {
        font-size: 13px;
        line-height: 1.5;
    }
}