/* ============================================================
   Lexilet – Dashboard Styles: Cards & Modals
   Part of the refactored 3.4.0.0 CSS module system.
   Requires: lexilet-dashboard-core.css
   ============================================================ */

/* -- Quiz Max Game (10 options) specific style -- */
.lexd-quiz-max-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.lexd-quiz-max-btn {
    padding: 10px 14px;
    background: #fff;
    border: 2px solid #eaedf2;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: #444;
    transition: all 0.2s;
    user-select: none;
    line-height: 1.3;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-break: break-word;
}

.lexd-quiz-max-btn:hover {
    border-color: #6c63ff;
    color: #5a52e0;
    background: #f4f3ff;
}

.lexd-quiz-max-btn.is-answered {
    pointer-events: none;
}

.lexd-quiz-max-btn.is-correct {
    background: #e8f8f5;
    color: #27ae60;
    border-color: #2ecc71;
}

.lexd-quiz-max-btn.is-wrong {
    background: #fdeaea;
    color: #c0392b;
    border-color: #e74c3c;
    animation: lexd-shake 0.4s ease;
}

/* -- Typing (Beíró) Game ------------------------------------- */
.lexd-typing-container {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    border: 1px solid #eaedf2;
}

.lexd-typing-question {
    font-size: 1.4rem;
    font-weight: 700;
    color: #333;
    text-align: center;
    margin-bottom: 25px;
    line-height: 1.4;
    word-break: break-word;
}

.lexd-typing-input-wrap {
    margin-bottom: 15px;
}

.lexd-typing-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.2rem;
    border: 2px solid #eaedf2;
    border-radius: 10px;
    outline: none;
    transition: all 0.3s ease;
    text-align: center;
    background: #f9f9f9;
    color: #333;
    font-weight: 600;
}

.lexd-typing-input:focus {
    border-color: #6c63ff;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.1);
}

.lexd-typing-input.is-correct {
    border-color: #2ecc71;
    background: #e8f8f5;
    color: #27ae60;
}

.lexd-typing-input.is-wrong {
    border-color: #e74c3c;
    background: #fdeaea;
    color: #c0392b;
    animation: lexd-shake 0.4s ease;
}

.lexd-typing-chars {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.lexd-typing-feedback {
    margin-top: 10px;
    text-align: center;
    color: #c0392b;
    font-size: 1rem;
    animation: lexd-fade 0.3s ease;
}

/* -- Modal --------------------------------------------------- */
.lexd-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: lexd-fade 0.2s ease;
}

.lexd-modal-inner {
    background: #fff;
    border-radius: 16px;
    padding: 28px 32px;
    min-width: 340px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
}

.lexd-modal-inner h3 {
    margin: 0 0 16px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #222;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lexd-modal-inner h3 .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #6c63ff;
}

.lexd-modal-input {
    font-family: inherit;
    font-size: 0.95rem;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
    transition: border-color 0.15s;
}

.lexd-modal-input:focus {
    border-color: #6c63ff;
}

select.lexd-modal-input {
    cursor: pointer;
    background: #fff;
}

.lexd-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}

.lexd-empty {
    color: #888;
    font-size: 0.95rem;
}

/* -- Responsive ---------------------------------------------- */
@media (max-width: 700px) {
    .lexd {
        flex-direction: column;
        border-radius: 12px;
    }

    .lexd-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eaedf2;
        padding: 16px 0 8px;
    }

    .lexd-logo {
        padding: 0 16px 12px;
    }

    /* Nav: csempe rács (mint a tanári dashboardon) */
    .lexd-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        gap: 6px;
        overflow-x: unset;
        padding: 0;
    }

    .lexd-nav li {
        flex: 1;
        min-width: 70px;
        text-align: center;
    }

    .lexd .lexd-nav-link {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 8px 4px;
        font-size: 0.7rem;
        color: #555 !important;
        border: 1.5px solid #ddd !important;
        border-left: 1.5px solid #ddd !important;
        border-radius: 8px;
        background: #fdfdfd;
        height: 100%;
        width: 100%;
        text-align: center;
        gap: 4px;
    }

    .lexd .lexd-nav-link .dashicons {
        margin-bottom: 2px;
        font-size: 20px;
        width: 20px;
        height: 20px;
        opacity: 1;
    }

    .lexd .lexd-nav-link:hover {
        background: #f0f0ff !important;
        color: #6c63ff !important;
        border-color: #b0abff !important;
    }

    .lexd .lexd-nav-link.is-active {
        border-color: #6c63ff !important;
        background: #f0f0ff !important;
        color: #6c63ff !important;
    }

    .lexd .lexd-nav-link.is-active .dashicons {
        opacity: 1;
    }

    .lexd-main {
        padding: 20px 16px;
    }

    .lexd-overview-stats-wrap {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }

    .lexd-overview-stats-wrap .lexd-stat-cards {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 0 !important;
    }

    .lexd-overview-stats-wrap .lexd-stat-card {
        padding: 12px 10px;
        min-width: 0;
        gap: 8px;
    }

    .lexd-overview-stats-wrap .lexd-stat-card-icon {
        font-size: 22px !important;
        width: 22px !important;
        height: 22px !important;
    }

    .lexd-overview-stats-wrap .lexd-stat-card-label {
        font-size: 0.75rem;
    }

    .lexd-srs-toggle-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .lexd-tab-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .lexd-deck-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .lexd-deck-actions {
        margin-left: 0;
        width: 100%;
        flex-wrap: wrap;
    }

    .lexd-btn-study {
        flex: 1;
        justify-content: center;
    }

    .lexd-dict-item {
        flex-direction: column;
        gap: 12px;
    }

    .lexd-dict-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
    }

    .lexd-quick-add-fields {
        grid-template-columns: 1fr;
    }

    .lexd-quick-add-fields .lexd-qa-save,
    .lexd-quick-add-fields .lexd-ai-btn {
        grid-column: 1;
        justify-self: stretch;
    }

    .lexd-quick-input {
        width: 100%;
    }

    .lexd-cards-table {
        font-size: 0.82rem;
    }

    .lexd-cards-table thead th,
    .lexd-cards-table tbody td {
        padding: 8px 10px;
    }

    .lexd-panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .lexd-charbar {
        flex-wrap: wrap;
    }

    .lexd-import-deck-row {
        flex-direction: column;
    }

    .lexd-import-modes {
        flex-direction: column;
    }

    .lexd-import-delim-row {
        flex-wrap: wrap;
    }

    .lexd-library-item {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Stack game actions */
    .lexd-game-actions {
        grid-template-columns: 1fr !important;
    }

    /* Card table stack view – az advanced.css @media 768px szabályai kezelik az elrendezést */
    .lexd-cards-table thead {
        display: none;
    }

    /* A tbody tr és tbody td stílusokat a lexilet-dashboard-advanced.css kezeli mobilon.
       Az alábbi szabályok csak fallback-ként maradnak 700px alatt (nem ütköznek). */
    .lexd-cards-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.8rem;
        color: #999;
        text-transform: uppercase;
        margin-right: 12px;
        text-align: left;
    }

    /* Stack charbar on mobile */
    .lexd-charbar {
        justify-content: center;
    }
}

/* ============================================================
   v1.7.0 – Virtual Keyboard (Charbar)
   ============================================================ */
.lexd-charbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 0 2px;
}

.lexd-char-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #d5d9e0;
    border-radius: 6px;
    background: #f7f8fa;
    color: #333;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}

.lexd-char-btn:hover {
    background: #6c63ff !important;
    color: #fff !important;
    border-color: #6c63ff !important;
    transform: translateY(-1px);
}

.lexd-char-btn:active {
    transform: translateY(0);
}

/* ============================================================
   v1.7.0 – Mastery Percentage
   ============================================================ */
.lexd-mastery-pct {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #999;
    min-width: 32px;
    text-align: center;
    margin-right: 2px;
}

.lexd-mastery-badge.is-mastered+.lexd-mastery-pct {
    color: #f39c12;
}

/* ============================================================
   v1.7.0 – Study Button in Card Panel
   ============================================================ */
.lexd-panel-study {
    font-size: 0.85rem;
    padding: 7px 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.lexd-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============================================================
   v1.7.0 – Import Tab
   ============================================================ */
.lexd-import-panel {
    max-width: 700px;
}

.lexd-import-deck-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.lexd-import-deck-row label {
    font-weight: 600;
    color: #444;
}

.lexd-import-deck-row select,
.lexd-import-deck-row input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #d5d9e0;
    border-radius: 8px;
    font-size: 0.9rem;
    min-width: 200px;
}

.lexd-import-modes {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.lexd-import-mode-btn {
    border: 1px solid #d5d9e0 !important;
    background: #fff !important;
    color: #555 !important;
}

.lexd-import-mode-btn.is-active {
    border-color: #6c63ff !important;
    background: #f4f3ff !important;
    color: #6c63ff !important;
    font-weight: 700 !important;
}

.lexd-import-mode-btn:hover {
    border-color: #6c63ff !important;
    color: #6c63ff !important;
    background: #f9f8ff !important;
}

.lexd-import-delim-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.lexd-import-delim-row label {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: #555;
}

.lexd-import-delim-row label:first-child {
    font-weight: 600;
    color: #444;
}

.lexd-import-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d5d9e0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Fira Code', 'Consolas', monospace;
    resize: vertical;
    min-height: 160px;
    margin-bottom: 8px;
}

.lexd-import-textarea:focus {
    border-color: #6c63ff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.12);
}

.lexd-import-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 20px;
    border: 2px dashed #d5d9e0;
    border-radius: 12px;
    background: #fafbfc;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    text-align: center;
    margin-bottom: 8px;
}

.lexd-import-dropzone:hover,
.lexd-import-dropzone.is-dragover {
    border-color: #6c63ff;
    background: #f4f3ff;
}

.lexd-import-dropzone .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
    color: #aab;
}

.lexd-import-dropzone p {
    margin: 0;
    color: #888;
    font-size: 0.9rem;
}

.lexd-import-formats {
    font-size: 0.8rem !important;
    color: #aaa !important;
}

.lexd-import-file-name {
    font-size: 0.9rem;
    color: #333;
    font-weight: 600;
    min-height: 20px;
    margin-bottom: 8px;
}

.lexd-import-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.lexd-import-result {
    font-size: 0.9rem;
    font-weight: 600;
}

/* ============================================================
   v1.7.0 – Library (Master Decks)
   ============================================================ */
.lexd-library-hint {
    color: #888;
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.lexd-library-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lexd-library-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #eaedf2;
    transition: box-shadow 0.15s;
}

.lexd-library-item:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.lexd-library-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lexd-library-name {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lexd-library-name .dashicons {
    color: #6c63ff;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.lexd-library-meta {
    font-size: 0.82rem;
    color: #999;
}

.lexd-library-copy {
    white-space: nowrap;
}

/* ============================================================
   v1.7.1 – Library Preview Table
   ============================================================ */
.lexd-library-preview {
    margin: 0 0 10px;
    padding: 0 18px 14px;
    background: #fafbfc;
    border: 1px solid #eaedf2;
    border-top: none;
    border-radius: 0 0 10px 10px;
}

.lexd-library-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.lexd-library-preview-table thead th {
    text-align: left;
    padding: 8px 10px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #999;
    border-bottom: 1px solid #eaedf2;
}

.lexd-library-preview-table tbody td {
    padding: 7px 10px;
    border-bottom: 1px solid #f0f1f4;
    color: #444;
}

.lexd-library-preview-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================================
   v3.7.2.30 – Library Folder Accordion
   ============================================================ */
.lexd-library-folder {
    border: 1px solid #e8ebf0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.lexd-library-folder-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: #f5f4ff;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.lexd-library-folder-header:hover {
    background: #ece9ff;
}

.lexd-lib-folder-arrow {
    color: #6c63ff;
    font-size: 16px;
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.lexd-lib-folder-name {
    font-weight: 700;
    font-size: 1rem;
    color: #333;
    flex: 1;
}

.lexd-lib-folder-count {
    font-size: 0.8rem;
    color: #888;
    background: #eee;
    border-radius: 12px;
    padding: 2px 10px;
    white-space: nowrap;
}

.lexd-library-folder-body {
    display: flex;
    flex-direction: column;
    background: #fff;
}

.lexd-library-folder-body .lexd-library-item {
    border: none;
    border-bottom: 1px solid #f0f1f4;
    border-radius: 0;
    margin: 0;
    padding: 12px 16px;
    box-shadow: none;
}

.lexd-library-folder-body .lexd-library-item:last-of-type {
    border-bottom: none;
}

.lexd-library-folder-body .lexd-library-item:hover {
    background: #fafbfc;
    box-shadow: none;
}

.lexd-library-folder-body .lexd-library-preview {
    border-radius: 0;
    margin: 0;
}

/* ============================================================
   v1.7.1 – Shortcode: lexilet_wordlist
   ============================================================ */
.lexilet-wordlist-wrap {
    max-width: 700px;
    margin: 1.5em auto;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.lexilet-wordlist-wrap h3 {
    margin: 0 0 12px;
    font-size: 1.2rem;
    color: #333;
}

.lexilet-wordlist-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #eaedf2;
    border-radius: 10px;
    overflow: hidden;
}

.lexilet-wordlist-table thead th {
    text-align: left;
    padding: 10px 14px;
    background: #f4f3ff;
    color: #5a52e0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}

.lexilet-wordlist-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f1f4;
    color: #444;
    font-size: 0.9rem;
}

.lexilet-wordlist-table tbody tr:last-child td {
    border-bottom: none;
}

.lexilet-wordlist-table tbody tr:hover td {
    background: #fafbfc;
}

/* ============================================================
   v1.7.1 – Shortcode: lexilet_master_deck
   ============================================================ */
.lexilet-master-card {
    max-width: 100%;
    margin: 1.5em auto;
    padding: 24px;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #eaedf2;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    text-align: center;
}

.lexilet-master-card h3 {
    margin: 0 0 6px;
    font-size: 1.3rem;
    color: #333;
}

.lexilet-master-card .lexilet-master-meta {
    color: #999;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.lexilet-master-card .lexilet-master-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #6c63ff, #897cff);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 10px;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

body .lexilet-master-card .lexilet-master-btn:hover {
    background: #5a52e0 !important;
    color: #fff !important;
    transform: translateY(-1px);
}

.lexilet-master-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.lexilet-master-copy {
    background: linear-gradient(135deg, #48c6ef, #6f86d6) !important;
    border: none;
    cursor: pointer;
}

/* ============================================================
   v1.7.1 – Dashboard Charbar Mobile Mini-Buttons
   ============================================================ */
@media (max-width: 740px) {
    .lexd-charbar .lexd-char-btn {
        min-width: 28px;
        height: 28px;
        padding: 0 5px;
        font-size: 0.82rem;
    }
}


/* ============================================================
   v3.5.2.12 – Kártya háttérszín rendszer
   ============================================================ */

/* Pasztell háttérszínek – szótár kártyasorok, pakli tábla sorok */
.lex-bg-red    { background-color: #ffe0e0 !important; }
.lex-bg-green  { background-color: #d6f5da !important; }
.lex-bg-blue   { background-color: #d8e8ff !important; }
.lex-bg-yellow { background-color: #fff3b0 !important; }

/* Szín-választó gombcsoport */
.lex-color-picker {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 8px 0 4px;
}

.lex-color-picker-label {
    font-size: 0.82rem;
    color: #888;
    margin-right: 2px;
    white-space: nowrap;
}

.lex-color-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent !important;
    cursor: pointer;
    padding: 0;
    transition: transform 0.13s, border-color 0.13s, box-shadow 0.13s;
    flex-shrink: 0;
    outline: none !important;
    box-shadow: none !important;
    /* WordPress admin button stílusok neutralizálása */
    background-image: none !important;
    text-shadow: none !important;
    line-height: 1 !important;
}

.lex-color-btn:hover {
    transform: scale(1.25);
    box-shadow: 0 0 0 2px rgba(0,0,0,0.25) !important;
}

.lex-color-btn:focus {
    outline: none !important;
    box-shadow: none !important;
}

.lex-color-btn.is-selected {
    border: 2px solid #333 !important;
    transform: scale(1.2);
    box-shadow: 0 0 0 1px #333 !important;
}

.lex-color-none   { background-color: #e8e8e8 !important; }
.lex-color-red    { background-color: #ffb3b3 !important; }
.lex-color-green  { background-color: #a8e6b3 !important; }
.lex-color-blue   { background-color: #a8c4f5 !important; }
.lex-color-yellow { background-color: #ffe58a !important; }
