/* WordHelper.me - Main Stylesheet */
:root {
    --bg: #0f1117;
    --bg-card: #1a1d28;
    --bg-hover: #242736;
    --text: #e4e6eb;
    --text-muted: #9ba0b0;
    --accent: #6c5ce7;
    --accent-hover: #7c6ff0;
    --accent-glow: rgba(108, 92, 231, 0.15);
    --border: #2a2d3a;
    --success: #00b894;
    --danger: #e17055;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
.site-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    max-width: 900px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
}

.logo-icon { font-size: 1.5rem; }
.logo-text { letter-spacing: -0.5px; }
.highlight { color: var(--accent); }

.main-nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}
.nav-link:hover { color: var(--text); background: var(--bg-hover); }

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Breadcrumb */
.breadcrumb {
    max-width: 900px;
    margin: 0 auto;
    padding: 10px 20px 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
}
.breadcrumb li {
    display: flex;
    align-items: center;
    gap: 6px;
}
.breadcrumb li:not(:last-child)::after {
    content: "›";
    color: var(--text-muted);
    opacity: 0.4;
}
.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb [aria-current="page"] {
    color: var(--text);
    font-weight: 500;
}

/* Main Content */
.main-content {
    padding-top: 40px;
    padding-bottom: 60px;
    min-height: calc(100vh - 150px);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 30px 0 40px;
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 12px;
    line-height: 1.2;
}

.hero-sub {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 30px;
}

/* Search Form */
.search-form {
    max-width: 600px;
    margin: 0 auto;
}

.search-form-inline {
    margin: 20px auto;
}

.input-group {
    display: flex;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 5px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input-group:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 1.2rem;
    font-family: var(--font);
    padding: 12px 16px;
    letter-spacing: 1px;
    text-transform: lowercase;
}
.search-input::placeholder {
    text-transform: none;
    color: var(--text-muted);
    opacity: 0.5;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-hover);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-secondary:hover { background: var(--border); }

.input-hint {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.input-hint code {
    background: var(--bg-hover);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Features Grid */
.features { padding: 40px 0; }
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}
.feature-card:hover { transform: translateY(-2px); border-color: var(--accent); }

.feature-icon { font-size: 2rem; margin-bottom: 12px; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature-card p { color: var(--text-muted); font-size: 0.9rem; }

/* Quick Links */
.quick-links { padding: 20px 0 40px; }
.quick-links h2 { margin-bottom: 16px; font-size: 1.3rem; }

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.quick-link {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
    text-align: center;
}
.quick-link:hover { background: var(--bg-hover); border-color: var(--accent); }

/* About Section */
.about { padding: 20px 0; }
.about h2 { margin-bottom: 12px; }
.about p { color: var(--text-muted); margin-bottom: 8px; }

/* Results Page */
.results-header { text-align: center; padding: 10px 0 20px; }
.results-header h1 { font-size: 2rem; }

.results-subtitle {
    color: var(--text-muted);
    margin: 8px 0 16px;
    font-size: 1.1rem;
}

.exact-match {
    margin: 12px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.badge-success {
    background: rgba(0, 184, 148, 0.15);
    color: var(--success);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.95rem;
}

.score-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}
.scrabble { background: rgba(108, 92, 231, 0.15); color: var(--accent); }

.results-meta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 12px 0;
}

.results-content { padding: 10px 0; }

.word-group {
    margin-bottom: 24px;
}

.word-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.word-group-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
}

.word-count {
    background: var(--bg-hover);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

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

.word-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    text-decoration: none;
    transition: all 0.15s;
}
.word-card:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.word-text {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    letter-spacing: 0.3px;
}

.word-score {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 700;
    background: rgba(108, 92, 231, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
}

.mini-card {
    padding: 6px 10px;
}
.mini-card .word-text { font-size: 0.85rem; }
.mini-card .word-score { font-size: 0.75rem; }

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.no-results code {
    background: var(--bg-hover);
    padding: 2px 6px;
    border-radius: 4px;
}

/* More Tools */
.more-tools {
    margin-top: 30px;
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.more-tools h3 { margin-bottom: 12px; }

.tool-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tool-link {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.tool-link:hover { background: var(--border); border-color: var(--accent); }

/* Dictionary Check Page */
.dictionary-page { padding: 10px 0; }
.dictionary-page h1 { font-size: 2rem; margin-bottom: 20px; }

.check-result { text-align: center; padding: 30px 0; }

.result-valid, .result-invalid { margin-bottom: 30px; }

.result-icon { font-size: 3rem; margin-bottom: 12px; }
.valid-text { color: var(--success); }
.invalid-text { color: var(--danger); }

.score-cards {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.score-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 30px;
    text-align: center;
    min-width: 150px;
}

.score-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
    display: block;
}
.score-label { font-size: 0.9rem; color: var(--text-muted); display: block; margin-bottom: 8px; }
.score-unit { font-size: 0.8rem; color: var(--text-muted); }

.anagrams-section { padding: 20px 0; }
.anagrams-section h3 { margin-bottom: 12px; }

.quick-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

/* Definition Section */
.definition-section {
    margin: 30px 0;
    padding: 0;
}

.definition-section h3 {
    font-size: 1.2rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.phonetic {
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--text-muted);
    font-family: 'Georgia', serif;
    letter-spacing: 0.5px;
}

.meaning-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.meaning-card:last-child {
    margin-bottom: 0;
}

.meaning-card:hover {
    border-color: var(--accent);
}

.meaning-header {
    margin-bottom: 10px;
}

.pos-badge {
    display: inline-block;
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meaning-text {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 10px;
}

.meaning-example {
    background: var(--bg-hover);
    border-left: 3px solid var(--accent);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.example-label {
    font-weight: 600;
    color: var(--accent);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 6px;
}

.word-tags {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.tags-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    padding-top: 4px;
}

.tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s;
}

.tag-synonym {
    background: rgba(0, 184, 148, 0.12);
    color: #00b894;
    border: 1px solid rgba(0, 184, 148, 0.2);
}

.tag-synonym:hover {
    background: rgba(0, 184, 148, 0.2);
    text-decoration: none;
}

.tag-antonym {
    background: rgba(225, 112, 85, 0.12);
    color: #e17055;
    border: 1px solid rgba(225, 112, 85, 0.2);
}

.tag-antonym:hover {
    background: rgba(225, 112, 85, 0.2);
    text-decoration: none;
}

/* Scores Page */
.score-tables {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.score-table-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.score-table-card h2 { margin-bottom: 16px; font-size: 1.1rem; }

.scores-table {
    width: 100%;
    border-collapse: collapse;
}

.scores-table th {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.scores-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.score-pts {
    font-weight: 700;
    color: var(--accent);
    width: 70px;
}

.letter-1 { color: #00b894; }
.letter-2 { color: #00cec9; }
.letter-3 { color: #6c5ce7; }
.letter-4 { color: #fd79a8; }
.letter-5 { color: #e17055; }
.letter-8 { color: #fdcb6e; }
.letter-10 { color: #e84393; }

.tips { margin: 30px 0; }
.tips h3 { margin-bottom: 12px; }
.tips ul { padding-left: 20px; }
.tips li { margin-bottom: 8px; color: var(--text-muted); }

/* Tools Page */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
    position: relative;
}
.tool-card:hover { transform: translateY(-2px); border-color: var(--accent); }

.tool-card.featured { border-color: var(--accent); }
.tool-card-icon { font-size: 2rem; margin-bottom: 10px; }
.tool-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.tool-card p { color: var(--text-muted); font-size: 0.9rem; }
.tool-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Blog */
.blog-grid {
    display: grid;
    gap: 16px;
    margin: 20px 0;
}

.blog-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color 0.2s;
}
.blog-card:hover { border-color: var(--accent); }

.blog-card h2 { font-size: 1.2rem; margin-bottom: 8px; }
.blog-card h2 a { color: var(--text); text-decoration: none; }
.blog-card h2 a:hover { color: var(--accent); }

.blog-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.blog-card p { color: var(--text-muted); margin-bottom: 12px; }

.blog-readmore {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.blog-article {
    max-width: 700px;
    margin: 0 auto;
}

.blog-article h1 { font-size: 2rem; margin-bottom: 8px; }
.blog-article h2 { font-size: 1.4rem; margin: 28px 0 12px; }
.blog-article h3 { font-size: 1.15rem; margin: 20px 0 8px; }
.blog-article p { margin-bottom: 14px; color: var(--text-muted); line-height: 1.8; }
.blog-article ul, .blog-article ol { padding-left: 20px; margin-bottom: 14px; color: var(--text-muted); }
.blog-article li { margin-bottom: 6px; }
.blog-article a { color: var(--accent); }

/* Word List Compact (for blog pages) */
.word-list-compact { margin: 16px 0; }
.two-letter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 6px;
}
.word-ref-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}
.word-ref-table th, .word-ref-table td {
    padding: 6px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.word-ref-table th { color: var(--text-muted); font-size: 0.85rem; }
.word-ref-table a { color: var(--text); text-decoration: none; }
.word-ref-table a:hover { color: var(--accent); }

/* CTA Box */
.cta-box {
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    margin: 30px 0;
}
.cta-box h3 { margin-bottom: 8px; }
.cta-box p { margin-bottom: 0; }

/* Footer */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 30px 0;
    margin-top: 20px;
}

.footer-inner { text-align: center; }

.footer-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent); }

.footer-copy {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.footer-copy a { color: var(--text-muted); }

/* Error Pages */
.error-page {
    text-align: center;
    padding: 60px 20px;
}
.error-page h1 { font-size: 5rem; color: var(--accent); margin-bottom: 16px; }
.error-page p { color: var(--text-muted); margin-bottom: 20px; }

/* Ad Placeholders - hidden by default, enabled via ad-loader.js */
.ad-slot {
    display: none;
    min-height: 90px;
    margin: 24px 0;
    text-align: center;
    overflow: hidden;
}
.ad-slot.ad-active {
    display: block;
}
.ad-slot-inline {
    min-height: 250px;
}
.ad-slot-banner {
    min-height: 90px;
}
.ad-slot-sidebar {
    min-height: 600px;
}
.ad-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.4;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (max-width: 640px) {
    .ad-slot-inline { min-height: 200px; }
    .ad-slot-sidebar { min-height: 250px; }

    .hero h1 { font-size: 1.8rem; }
    
    .main-nav { display: none; }
    .main-nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        padding: 12px;
    }
    .mobile-menu-btn { display: block; }
    
    .input-group { flex-direction: column; padding: 8px; }
    .search-input { font-size: 1rem; padding: 10px 12px; }
    .btn-primary { justify-content: center; }
    
    .feature-grid { grid-template-columns: 1fr 1fr; }
    .score-tables { grid-template-columns: 1fr; }
    .word-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .two-letter-grid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }
    .score-cards { flex-direction: column; align-items: center; }
    .tools-grid { grid-template-columns: 1fr; }
    .quick-actions { flex-direction: column; align-items: center; }
}
