/* WordleWonk Word Tools - Shared Stylesheet
 * Dark Wordle theme
 * Brand colors set via CSS custom properties:
 *   --brand: #538d4e;
 *   --brand-hover: #6aaa64;
 */

*, *::before, *::after { box-sizing: border-box; }

html {
    background-color: #121213;
    font-size: 16px;
    min-width: 300px;
    overflow-x: hidden;
    overflow-y: scroll;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #121213;
    min-height: 100vh;
    padding-top: 52px;
    margin: 0;
    color: #d7dadc;
    line-height: 1.5;
}

a { color: var(--brand); text-decoration: underline; }
a:hover { color: var(--brand-hover); }

/* === Navbar === */
.navbar {
    position: fixed; top: 0; left: 0; right: 0;
    background-color: #1a1a1b;
    border-bottom: 1px solid #3a3a3c;
    min-height: 52px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1rem; z-index: 30;
}
.navbar a { color: white; text-decoration: none; }
.navbar-brand { font-weight: bold; font-size: 1.1rem; }
.navbar-menu { display: flex; gap: 1rem; margin-left: 2rem; }
.navbar-item { padding: 0.5rem; border-radius: 4px; }
.navbar-item:hover { background: rgba(255,255,255,0.1); }

/* Hamburger */
.navbar-burger {
    display: none; cursor: pointer; width: 44px; height: 44px;
    position: relative; background: transparent; border: none; padding: 0;
}
.navbar-burger span {
    display: block; position: absolute; height: 3px; width: 24px;
    background: white; border-radius: 2px; left: 10px;
    transition: all 0.25s ease;
}
.navbar-burger span:nth-child(1) { top: 13px; }
.navbar-burger span:nth-child(2) { top: 20px; }
.navbar-burger span:nth-child(3) { top: 27px; }
.navbar-burger.is-active span:nth-child(1) { top: 20px; transform: rotate(45deg); }
.navbar-burger.is-active span:nth-child(2) { opacity: 0; }
.navbar-burger.is-active span:nth-child(3) { top: 20px; transform: rotate(-45deg); }

@media (max-width: 768px) {
    .navbar-burger { display: block; }
    .navbar-menu {
        display: none; position: absolute; top: 52px; left: 0; right: 0;
        background-color: #1a1a1b;
        flex-direction: column; padding: 1rem; margin: 0; gap: 0;
    }
    .navbar-menu.is-active { display: flex; }
    .navbar-item { padding: 0.75rem 1rem; border-radius: 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
    .navbar-item:last-child { border-bottom: none; }
}

/* === Container === */
.container { max-width: 800px; margin: 0 auto; padding: 1rem; }

/* === Game Panel === */
.game-panel {
    background: linear-gradient(135deg, #1a1a1b 0%, #272729 100%);
    border: 1px solid #3a3a3c;
    border-radius: 12px; padding: 2rem; margin-bottom: 2rem;
}
.game-title { color: white; font-size: 1.75rem; margin: 0 0 0.5rem 0; text-align: center; }
.game-subtitle { color: #818384; text-align: center; margin: 0 0 1.5rem 0; }

/* === Form Elements === */
.input-group { margin-bottom: 1rem; }
.input-group label { display: block; color: white; font-weight: 600; margin-bottom: 0.5rem; }
.input-field {
    width: 100%; padding: 0.75rem 1rem; font-size: 1.5rem;
    font-family: monospace; text-transform: uppercase; letter-spacing: 0.1em;
    border: 2px solid #3a3a3c; border-radius: 8px; background: #2c2c2e; color: white;
}
.input-field:focus { outline: none; border-color: var(--brand); }
.hint-text { color: #818384; font-size: 0.85rem; margin-top: 0.5rem; font-weight: 500; }
.hint-text strong { color: #b59f3b; font-weight: 700; }

/* Input with action buttons */
.input-with-buttons { display: flex; align-items: center; gap: 0.5rem; }
.input-with-buttons input { flex: 1; }
.input-btn {
    width: 44px; height: 44px; border: none; border-radius: 8px; cursor: pointer;
    font-size: 1.2rem; font-weight: bold;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease; flex-shrink: 0;
}
.input-btn.clear-btn { background: #dc3545; color: white; }
.input-btn.clear-btn:hover { background: #c82333; }
.input-btn.add-btn { background: var(--brand); color: white; }
.input-btn.add-btn:hover { background: var(--brand-hover); }

/* Match type radio */
.match-type-row { display: flex; align-items: center; gap: 1rem; margin-top: 0.75rem; flex-wrap: wrap; }
.match-type-row span { color: #818384; font-size: 0.9rem; }
.match-type-row label { display: flex; align-items: center; gap: 0.3rem; cursor: pointer; font-size: 0.9rem; color: #818384; }
.match-type-row input[type="radio"] { accent-color: var(--brand); }

/* Filter section (collapsible) */
.filter-section-header {
    display: flex; justify-content: flex-start; align-items: center;
    cursor: pointer; padding: 0.5rem 0.75rem; margin-bottom: 0.5rem;
    user-select: none; background: rgba(255,255,255,0.05); border-radius: 6px;
    transition: background 0.2s ease;
}
.filter-section-header:hover { background: rgba(255,255,255,0.1); }
.filter-section-label { font-size: 0.9rem; color: #b59f3b; font-weight: 600; margin: 0; }
.filter-toggle { font-size: 0.85rem; color: white; font-weight: bold; padding: 0 0.5rem; }
.filter-section-content {
    overflow: hidden; transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    max-height: 500px; opacity: 1;
}
.filter-section-content.collapsed { max-height: 0; opacity: 0; margin-bottom: 0; }

/* Options row */
.options-row { display: flex; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.option-group { flex: 1; min-width: 120px; }
.option-group label { display: block; color: white; font-size: 0.9rem; margin-bottom: 0.25rem; }
.option-group select, .option-group input {
    width: 100%; padding: 0.5rem; border-radius: 6px; border: 2px solid #3a3a3c; background: #2c2c2e; color: white;
}
.option-group input { text-transform: uppercase; font-family: monospace; }

/* Search button */
.search-btn {
    width: 100%; padding: 1rem; font-size: 1.1rem; font-weight: 700;
    color: #121213; background: #6aaa64; border: none; border-radius: 8px;
    cursor: pointer; transition: background 0.2s;
}
.search-btn:hover { background: #7dbc78; }

/* === Results === */
.results-area { background: #1a1a1b; border: 1px solid #3a3a3c; border-radius: 8px; margin-top: 1.5rem; overflow: hidden; }
.results-header {
    background: #3a3a3c; color: white; padding: 0.75rem 1rem;
    font-weight: 700; display: flex; justify-content: space-between;
}
.results-list { max-height: 600px; overflow-y: auto; }
.result-group { border-bottom: 2px solid #3a3a3c; }
.result-group-header {
    background: #272729; padding: 0.5rem 1rem;
    font-weight: 700; color: var(--brand); font-size: 0.9rem;
}
.result-row {
    display: flex; align-items: center; padding: 0.5rem 1rem;
    border-bottom: 1px solid #2c2c2e;
}
.result-row:hover { background: rgba(83,141,78,0.15); cursor: pointer; }
.result-word {
    font-family: monospace; font-size: 1.1rem; font-weight: 700;
    color: var(--brand-hover); min-width: 120px;
}
.result-points {
    background: var(--brand); color: white;
    padding: 0.2rem 0.6rem; border-radius: 12px;
    font-weight: 700; font-size: 0.85rem; margin-right: 1rem;
}
.result-definition {
    color: #818384; font-size: 0.85rem; font-style: italic;
    margin-left: 0.5rem; flex: 1; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.result-bingo {
    background: #b59f3b; color: #121213;
    padding: 0.15rem 0.5rem; border-radius: 8px;
    font-size: 0.7rem; font-weight: 700; margin-left: 0.5rem;
}

/* Alternate result display: chip/pill style */
.point-group { margin-bottom: 0.5rem; }
.point-header {
    background: #272729; padding: 0.4rem 0.75rem;
    font-weight: 700; color: var(--brand); font-size: 0.85rem;
}
.words-row { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.5rem 0.75rem; }
.word-chip {
    background: #2c2c2e; border: 1px solid #3a3a3c; border-radius: 6px;
    padding: 0.25rem 0.6rem; font-family: monospace; font-size: 0.95rem;
    cursor: pointer; transition: all 0.15s ease; color: #d7dadc;
}
.word-chip:hover { background: var(--brand); color: white; border-color: var(--brand); }

/* Dictionary badge */
.dict-badge {
    display: inline-block; background: var(--brand); color: white;
    padding: 0.15rem 0.6rem; border-radius: 12px;
    font-size: 0.75rem; font-weight: 700; margin-left: 0.5rem;
}

/* Special character buttons */
.special-char-row { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.special-char-label { color: #818384; font-size: 0.85rem; }
.special-char-btn {
    background: #3a3a3c; color: white; border: none; border-radius: 4px;
    padding: 0.3rem 0.6rem; cursor: pointer; font-size: 0.9rem;
    transition: background 0.2s ease;
}
.special-char-btn:hover { background: var(--brand); }

/* === Loading === */
.loading { text-align: center; padding: 2rem; color: #818384; }
.spinner {
    border: 3px solid #3a3a3c; border-top: 3px solid var(--brand);
    border-radius: 50%; width: 30px; height: 30px;
    animation: spin 1s linear infinite; margin: 0 auto 1rem;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* === Pagination === */
.pagination-nav {
    display: flex; justify-content: center; align-items: center;
    gap: 0.25rem; padding: 1rem; flex-wrap: wrap;
}
.pagination-nav a, .pagination-nav span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 0.5rem;
    border-radius: 6px; font-size: 0.9rem; font-weight: 600;
    text-decoration: none; transition: all 0.2s ease;
}
.pagination-nav a {
    background: #2c2c2e; color: #d7dadc; border: 1px solid #3a3a3c;
}
.pagination-nav a:hover { background: var(--brand); color: white; border-color: var(--brand); }
.pagination-nav .current {
    background: var(--brand); color: white; border: 1px solid var(--brand);
}
.pagination-nav .disabled {
    background: #1a1a1b; color: #555; border: 1px solid #2c2c2e;
    cursor: default; pointer-events: none;
}
.pagination-nav .ellipsis { border: none; background: none; color: #818384; min-width: 24px; }

/* === Cross-links Section === */
.cross-links {
    background: linear-gradient(135deg, #1a1a1b 0%, #272729 100%);
    border: 1px solid #3a3a3c;
    border-radius: 12px; padding: 2rem; margin-top: 2rem; color: #818384;
}
.cross-links h2 { color: white; margin-top: 0; text-align: center; }
.cross-links-subtitle { text-align: center; color: #818384; margin-bottom: 1.5rem; }
.tools-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}
.tool-card {
    background: rgba(255,255,255,0.05); border: 1px solid #3a3a3c; border-radius: 8px; padding: 1rem;
    text-align: center; transition: all 0.2s ease; text-decoration: none; display: block;
}
.tool-card:hover { background: rgba(83,141,78,0.15); border-color: var(--brand); transform: translateY(-2px); text-decoration: none; }
.tool-card .tool-icon { font-size: 1.5rem; margin-bottom: 0.5rem; }
.tool-card .tool-name { color: #b59f3b; font-weight: 700; font-size: 0.95rem; text-decoration: underline; text-underline-offset: 3px; }
.tool-card .tool-desc { color: #818384; font-size: 0.8rem; margin-top: 0.25rem; }

/* === About Section === */
.about-section {
    background: linear-gradient(135deg, #1a1a1b 0%, #272729 100%);
    border: 1px solid #3a3a3c;
    border-radius: 12px; padding: 2rem; margin-top: 2rem; color: #d7dadc;
}
.about-section h2 { color: white; margin-top: 0; }
.about-section h3 { color: #b59f3b; }
.about-section strong { color: #b59f3b; }
.about-section ul { padding-left: 1.5rem; }
.about-section li { margin-bottom: 0.5rem; }

/* How-to grid */
.how-to-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem; margin: 1rem 0;
}
.how-to-card {
    background: rgba(255,255,255,0.03); border: 1px solid #3a3a3c; border-radius: 8px; padding: 1.25rem;
    text-align: center;
}
.step-number {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--brand); color: white; font-weight: 700;
    margin-bottom: 0.5rem;
}
.how-to-card h4 { color: white; margin: 0.5rem 0 0.25rem; font-size: 0.95rem; }
.how-to-card p { margin: 0; font-size: 0.85rem; }

/* Tip box */
.tip-box {
    background: rgba(181,159,59,0.1); border-left: 3px solid #b59f3b;
    padding: 0.75rem 1rem; border-radius: 0 6px 6px 0; margin: 1rem 0;
}
.tip-box strong { color: #b59f3b; }

/* FAQ */
.faq-grid { margin-top: 1rem; }
.faq-item {
    background: rgba(255,255,255,0.03); border: 1px solid #3a3a3c; border-radius: 8px;
    margin-bottom: 0.5rem; overflow: hidden;
}
.faq-item summary {
    padding: 0.75rem 1rem; cursor: pointer; font-weight: 600; color: white;
    list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: '+ '; color: #b59f3b; font-weight: 700; }
.faq-item[open] summary::before { content: '- '; }
.faq-item p { padding: 0 1rem 0.75rem; margin: 0; }

/* Points table */
.points-table {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.5rem; margin: 1rem 0;
}
.point-tile { background: #3a3a3c; padding: 0.5rem; border-radius: 4px; text-align: center; }
.point-tile .letter { font-weight: 700; color: white; }
.point-tile .value { font-size: 0.75rem; color: #b59f3b; }
.point-tile.high-value { background: var(--brand); }

/* === External Resources === */
.external-resources { margin-top: 2rem; }
.external-resources h2 { color: white; margin-bottom: 1.5rem; }
.resources-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem;
}
.resource-card { background: rgba(0,0,0,0.3); border: 1px solid #3a3a3c; border-radius: 8px; padding: 1.25rem; }
.resource-card h3, .resource-card h4 { color: #b59f3b; margin-bottom: 0.75rem; font-size: 1rem; margin-top: 0; }
.resource-card ul { list-style: none; padding: 0; margin: 0; }
.resource-card li { margin-bottom: 0.5rem; }
.resource-card a { color: #d7dadc; text-decoration: underline; }
.resource-card a:hover { color: #b59f3b; }

/* Other tools section */
.other-tools { margin-top: 1.5rem; }
.other-tools h3 { color: #b59f3b; margin-bottom: 0.75rem; }
.tools-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.tool-link {
    background: rgba(255,255,255,0.05); border: 1px solid #3a3a3c; border-radius: 6px;
    padding: 0.5rem 1rem; color: white; text-decoration: underline;
    text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,0.4);
    font-size: 0.9rem; transition: all 0.15s ease;
}
.tool-link:hover { background: var(--brand); color: white; text-decoration: underline; text-decoration-color: white; }

/* === Footer === */
.site-footer { background: #0a0a0a; border-top: 1px solid #3a3a3c; color: white; padding: 2rem 1rem; margin-top: 2rem; }
.footer-container { max-width: 1200px; margin: 0 auto; }
.footer-columns {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem; text-align: center; margin-bottom: 2rem;
}
.footer-column { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-column h3, .footer-column h4, .footer-heading { color: #b59f3b; font-weight: 700; margin-bottom: 0.75rem; font-size: 1rem; margin-top: 0; }
.footer-column a { color: #b0b0b0; text-decoration: underline; display: block; }
.footer-column a:hover { color: #d7dadc; }
.footer-column p { margin-bottom: 0.5rem; }
.footer-bottom { text-align: center; padding-top: 1.5rem; border-top: 1px solid #3a3a3c; }
.footer-bottom a { color: #b0b0b0; text-decoration: underline; }
.footer-bottom a:hover { color: #d7dadc; }
.footer-bottom strong { color: #d7dadc; }
.footer-legal, .copyright { font-size: 0.75rem; margin-top: 0.75rem; color: #b0b0b0; }

@media (max-width: 768px) {
    .footer-columns { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .footer-columns { grid-template-columns: 1fr; }
}

/* === Responsive === */
@media (max-width: 480px) {
    .game-panel { padding: 1rem; }
    .game-title { font-size: 1.25rem; }
    .input-field { font-size: 1.2rem; }
    .options-row { flex-direction: column; gap: 0.5rem; }
    .tools-grid { grid-template-columns: 1fr 1fr; }
}
