/* =========================================================================
   MY SAVED WORDS WIDGET
   Reviewable grid of hearted words + "Practice These" launcher.
   Fleet-styled, mobile-first, no !important.
   ========================================================================= */

.saved-words-container {
    --sw-red: #ef4444;
    --sw-ink: #1e293b;
    --sw-muted: #64748b;
    --sw-border: #e5e7eb;
    --sw-surface: #ffffff;
    font-family: var(--as-font);
    color: var(--sw-ink);
    max-width: 880px;
    margin: 0 auto;
}

/* ---- Header ---- */
.saved-words-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.saved-words-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--sw-ink);
}

.saved-words-title-heart {
    color: var(--sw-red);
    font-size: 18px;
    line-height: 1;
}

.saved-words-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #fee2e2;
    color: var(--sw-red);
    font-size: 13px;
    font-weight: 700;
}

/* ---- Practice button ---- */
.saved-words-practice-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    background: var(--sw-red);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.saved-words-practice-btn:hover {
    background: #dc2626;
}

.saved-words-practice-btn:active {
    transform: scale(0.97);
}

.saved-words-practice-btn:focus-visible {
    outline: 2px solid var(--sw-red);
    outline-offset: 2px;
}

/* ---- Grid ---- */
.saved-words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.saved-word-card {
    border: 1px solid var(--sw-border);
    border-radius: 14px;
    background: var(--sw-surface);
    overflow: hidden;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.saved-word-card:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.saved-word-imgwrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.saved-word-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.saved-word-noimg {
    font-size: 2.4rem;
    color: #cbd5e1;
}

.saved-word-heart {
    position: absolute;
    top: 6px;
    right: 6px;
}

.saved-word-label {
    padding: 10px 12px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    color: var(--sw-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Empty / loading ---- */
.saved-words-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 40px 20px;
    border: 1px dashed var(--sw-border);
    border-radius: 14px;
    background: #fafafa;
}

.saved-words-empty-icon {
    font-size: 2.6rem;
    color: var(--sw-red);
    line-height: 1;
}

.saved-words-empty-msg {
    margin: 0;
    max-width: 420px;
    color: var(--sw-muted);
    font-size: 15px;
    line-height: 1.5;
}

.saved-words-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 20px;
    color: var(--sw-muted);
}

.saved-words-loading .loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--sw-border);
    border-top-color: var(--sw-red);
    border-radius: 50%;
    animation: saved-words-spin 0.8s linear infinite;
}

@keyframes saved-words-spin {
    to { transform: rotate(360deg); }
}

/* ---- Elementor editor preview ---- */
.saved-words-preview {
    padding: 24px;
    border: 1px dashed var(--sw-border);
    border-radius: 14px;
    background: #fafafa;
    text-align: center;
    color: var(--sw-muted);
}

.saved-words-preview h3 {
    margin: 0 0 8px;
    color: var(--sw-red);
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
    .saved-words-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
    }

    .saved-words-title {
        font-size: 18px;
    }

    .saved-words-practice-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .saved-word-card,
    .saved-words-practice-btn,
    .saved-words-loading .loading-spinner {
        transition: none;
        animation: none;
    }
}
