/* --- 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 --- */
.top-bar {
    background-color: var(--nav-bg);
    color: white;
    border-bottom: 3px solid var(--primary);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.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: 20px; }

.nav-links a {
    color: #9ca3af;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-links a:hover { color: white; background: rgba(255,255,255,0.1); }
.nav-links a.active { color: white; background: var(--primary); }

/* --- 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;}

/* --- FOOTER --- */
.bottom-bar { background: var(--nav-bg); color: white; padding: 40px 0; margin-top: auto; }
.footer-container { display: flex; justify-content: space-between; align-items: center;}
.footer-brand p { color: #9ca3af; font-size: 14px; margin-top: 5px;}
.footer-links a { color: #9ca3af; text-decoration: none; margin-left: 25px; font-size: 14px;}
.footer-links a:hover { color: white; }

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .input-grid { grid-template-columns: 1fr; gap: 20px;}
    .nav-links { display: none; /* In a real app, replace with hamburger menu */ }
    .footer-container { flex-direction: column; text-align: center; gap: 20px;}
    .footer-links a { margin: 0 10px;}
}

/* --- 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; }


/* --- WORD LISTS HUB SPECIFIC STYLING --- */
.hub-hero {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 50px;
    margin-bottom: 50px;
}

.hub-hero-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 40px auto;
}

.hub-hero-header h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.hub-hero-header p {
    font-size: 16px;
    color: var(--text-gray);
    line-height: 1.6;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* Make the entire card a clickable link */
.category-card {
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 30px 25px;
    text-decoration: none;
    transition: all 0.2s ease;
    height: 100%;
}

.category-card:hover {
    background: #ffffff;
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.1);
}

.card-icon {
    font-size: 40px;
    margin-bottom: 20px;
}

.category-card h3 {
    color: var(--text-dark);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}

.category-card p {
    color: var(--text-gray);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1; /* Pushes the link to the bottom */
}

.card-link {
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
    transition: color 0.2s;
}

.category-card:hover .card-link {
    color: var(--primary-hover);
}

/* --- Fix the Grid Layout --- */
.full-width {
    grid-column: 1 / -1;
}

/* --- Premium Dropdown Styling --- */
select.standard-input {
    width: 100%;
    padding: 16px 20px;
    
    /* Removes the ugly default browser/Windows arrow */
    appearance: none; 
    -webkit-appearance: none;
    -moz-appearance: none;
    
    /* Injects a custom, clean SVG arrow */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 18px;
    
    background-color: #f8fafc;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
}

select.standard-input:focus {
    outline: none;
    border-color: var(--primary);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* Fix for Firefox specifically to ensure text doesn't overlap the custom arrow */
@-moz-document url-prefix() {
    select.standard-input {
        text-overflow: '';
    }
}