/* ============================================================
   word-unscrambler.css  —  /word-unscrambler page styles
   Follows the site design system: Poppins, Bootstrap 5.3,
   CSS custom properties matching site-custom.css
   ============================================================ */

/* ── Hero ──────────────────────────────────────────────────── */
.wu-hero {
    background: linear-gradient(135deg, #eef3ff 0%, #f5f0ff 100%);
    border-radius: 16px;
    padding: 2rem 2rem 1.6rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.wu-hero h1 {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 800;
    color: #111827;
    margin-bottom: .45rem;
}

.wu-hero p {
    color: #6b7280;
    font-size: 1rem;
    max-width: 560px;
    margin: 0 auto;
}

/* ── Tool card ─────────────────────────────────────────────── */
.wu-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,.07);
    padding: 1.8rem;
    margin-bottom: 1.5rem;
}

/* ── Letter input area ─────────────────────────────────────── */
.wu-input-row {
    display: flex;
    gap: .75rem;
    align-items: stretch;
    flex-wrap: wrap;
}

#wu-letters {
    flex: 1 1 240px;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    padding: .7rem 1rem;
    transition: border-color .2s;
    min-width: 0;
}

#wu-letters:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124,58,237,.15);
}

#wu-letters::placeholder { color: #9ca3af; letter-spacing: normal; font-weight: 400; }

.wu-btn-primary {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: .75rem 1.6rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .18s, transform .12s;
    flex-shrink: 0;
}
.wu-btn-primary:hover  { opacity: .92; transform: translateY(-1px); }
.wu-btn-primary:active { transform: translateY(0); }
.wu-btn-primary:focus-visible { outline: 3px solid #a78bfa; outline-offset: 2px; }

.wu-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: .75rem 1.2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .16s;
    flex-shrink: 0;
}
.wu-btn-secondary:hover { background: #e9ecef; }
.wu-btn-secondary:focus-visible { outline: 3px solid #7c3aed; outline-offset: 2px; }

/* ── Advanced filters ──────────────────────────────────────── */
.wu-filters-toggle {
    background: none;
    border: none;
    color: #7c3aed;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    padding: .3rem 0;
    margin-top: .6rem;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    transition: opacity .15s;
}
.wu-filters-toggle:hover { opacity: .75; }

.wu-filters-panel {
    border-top: 1px solid #f3f4f6;
    margin-top: 1rem;
    padding-top: 1rem;
    display: none;
}
.wu-filters-panel.open { display: block; }

.wu-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: .75rem;
}

.wu-filter-group label {
    display: block;
    font-size: .78rem;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: .25rem;
}

.wu-filter-group input,
.wu-filter-group select {
    width: 100%;
    border: 1.5px solid #d1d5db;
    border-radius: 9px;
    padding: .42rem .7rem;
    font-size: .9rem;
    transition: border-color .18s;
    background: #fff;
}
.wu-filter-group input:focus,
.wu-filter-group select:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124,58,237,.12);
}

/* ── Spinner / loading ─────────────────────────────────────── */
.wu-spinner {
    display: none;
    align-items: center;
    gap: .6rem;
    color: #6b7280;
    font-size: .9rem;
    margin-top: .8rem;
}
.wu-spinner.visible { display: flex; }

.wu-spin-ring {
    width: 22px; height: 22px;
    border: 3px solid #e5e7eb;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: wu-spin .7s linear infinite;
}
@keyframes wu-spin { to { transform: rotate(360deg); } }

/* ── Results area ──────────────────────────────────────────── */
.wu-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
}

.wu-count-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: #f5f3ff;
    color: #5b21b6;
    border: 1.5px solid #ddd6fe;
    border-radius: 999px;
    padding: .3rem .9rem;
    font-size: .88rem;
    font-weight: 700;
}

.wu-copy-all-btn {
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    color: #374151;
    border-radius: 9px;
    padding: .3rem .85rem;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.wu-copy-all-btn:hover { background: #e9ecef; }
.wu-copy-all-btn:focus-visible { outline: 3px solid #7c3aed; outline-offset: 2px; }

/* Speak button active/speaking state */
.wu-speak-btn.wu-speak-active {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
}
.wu-speak-btn.wu-speak-active:hover { background: #6d28d9; }

/* ── Word group ────────────────────────────────────────────── */
.wu-group {
    margin-bottom: 1.4rem;
}

.wu-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .6rem;
}

.wu-group-title {
    font-size: .95rem;
    font-weight: 700;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.wu-copy-group-btn {
    background: none;
    border: 1.5px solid #e5e7eb;
    color: #9ca3af;
    border-radius: 8px;
    padding: .18rem .6rem;
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    transition: color .15s, border-color .15s;
}
.wu-copy-group-btn:hover { color: #7c3aed; border-color: #c4b5fd; }

/* ── Word tiles ────────────────────────────────────────────── */
.wu-word-list {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.wu-word {
    display: inline-flex;
    align-items: center;
    background: #f5f3ff;
    color: #3730a3;
    border: 1.5px solid #ddd6fe;
    border-radius: 9px;
    padding: .28rem .7rem;
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: .04em;
    cursor: default;
    transition: background .15s, transform .1s;
    user-select: text;
}
.wu-word:hover { background: #ede9fe; transform: translateY(-1px); }

/* ── Empty / no-result state ───────────────────────────────── */
.wu-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #6b7280;
}
.wu-empty .wu-empty-icon { font-size: 2.8rem; margin-bottom: .5rem; }
.wu-empty h3 { font-size: 1.1rem; font-weight: 700; color: #374151; }
.wu-empty p  { font-size: .9rem; max-width: 380px; margin: .3rem auto 0; }

/* ── Error state ───────────────────────────────────────────── */
.wu-error {
    background: #fef2f2;
    border: 1.5px solid #fca5a5;
    border-radius: 12px;
    padding: .9rem 1.1rem;
    color: #991b1b;
    font-size: .9rem;
    font-weight: 600;
    margin-top: .8rem;
    display: none;
}
.wu-error.visible { display: block; }

/* ── Recent searches ───────────────────────────────────────── */
.wu-recent {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}
.wu-recent-label {
    font-size: .78rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: .45rem;
}
.wu-recent-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    align-items: center;
}
.wu-recent-chip {
    background: #f3f4f6;
    border: 1.5px solid #e5e7eb;
    border-radius: 999px;
    padding: .22rem .75rem;
    font-size: .82rem;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
    transition: background .15s;
}
.wu-recent-chip:hover { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; }
.wu-clear-history {
    background: none;
    border: none;
    font-size: .75rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 0 .2rem;
    margin-left: .2rem;
}
.wu-clear-history:hover { color: #dc2626; }

/* ── Content sections ──────────────────────────────────────── */
.wu-section { margin-bottom: 2rem; }
.wu-section h2 { font-size: 1.3rem; font-weight: 800; color: #111827; margin-bottom: .7rem; }
.wu-section h3 { font-size: 1.05rem; font-weight: 700; color: #374151; margin-top: 1.2rem; margin-bottom: .45rem; }
.wu-section p, .wu-section li { color: #4b5563; line-height: 1.7; }

.wu-use-cases {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .8rem;
    margin-top: .8rem;
}
.wu-use-case-card {
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem 1.1rem;
}
.wu-use-case-card .icon { font-size: 1.5rem; margin-bottom: .35rem; }
.wu-use-case-card h4 { font-size: .9rem; font-weight: 700; color: #111827; margin-bottom: .2rem; }
.wu-use-case-card p  { font-size: .82rem; color: #6b7280; margin: 0; }

/* ── FAQ ───────────────────────────────────────────────────── */
.wu-faq dt {
    font-weight: 700;
    color: #111827;
    margin-top: 1.1rem;
}
.wu-faq dd {
    color: #4b5563;
    line-height: 1.7;
    margin-left: 0;
    margin-top: .2rem;
}

/* ── Links section ─────────────────────────────────────────── */
.wu-related-links {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .6rem;
}
.wu-related-links a {
    background: #f3f4f6;
    border: 1.5px solid #e5e7eb;
    border-radius: 9px;
    padding: .35rem .9rem;
    font-size: .87rem;
    font-weight: 600;
    color: #374151;
    text-decoration: none;
    transition: background .15s;
}
.wu-related-links a:hover { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; }

/* ── Breadcrumb ────────────────────────────────────────────── */
.wu-breadcrumb {
    font-size: .82rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}
.wu-breadcrumb a { color: #9ca3af; text-decoration: none; }
.wu-breadcrumb a:hover { color: #7c3aed; }
.wu-breadcrumb span { margin: 0 .3rem; }

/* ── Aria live region ──────────────────────────────────────── */
#wu-live { position: absolute; left: -9999px; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 576px) {
    .wu-hero { padding: 1.4rem 1rem 1.2rem; }
    .wu-card { padding: 1.2rem 1rem; }
    .wu-input-row { flex-direction: column; }
    .wu-btn-primary, .wu-btn-secondary { width: 100%; justify-content: center; }
    .wu-filter-grid { grid-template-columns: 1fr 1fr; }
}
