/* ═══════════════════════════════════════════════════════════
   PRO PUZZLE MODE — CSS
   Covers: Admin Solution Editor (ProPuzzleEditor)
           User Solver (ProPuzzleSolver)
   ═══════════════════════════════════════════════════════════ */

/* ── Shared: board size ──────────────────────────────────── */
#ped-board,
#psl-board {
    width: 400px;
    height: 400px;
}

@media (max-width: 480px) {
    #ped-board, #psl-board {
        width: min(90vw, 360px);
        height: min(90vw, 360px);
    }
}

/* ══════════════════════════════════════════════════════════
   ADMIN — SOLUTION EDITOR MODAL
   ══════════════════════════════════════════════════════════ */

#pro-editor-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
}

.pro-editor-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(3px);
}

.pro-editor-panel {
    position: relative;
    z-index: 1;
    width: min(96vw, 900px);
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 40px rgba(108,92,231,.18);
    animation: proEditorSlideIn .25s ease;
}

@keyframes proEditorSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);   opacity: 1; }
}

.pro-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: linear-gradient(135deg, #6C5CE7, #5a4bd1);
    color: #fff;
    font-size: .95rem;
    gap: 12px;
    flex-shrink: 0;
}

.ped-badge {
    font-size: .78rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
}

.pro-editor-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 0;
}

/* Left column — board */
.pro-editor-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px;
    border-right: 1px solid #eee;
    flex-shrink: 0;
    background: #fafafa;
    overflow-y: auto;
}

#ped-board-wrap {
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
}

.ped-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.ped-info {
    font-size: .82rem;
    color: #636E72;
    text-align: center;
    line-height: 1.5;
}

/* Right column — tree */
.pro-editor-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ped-tree-header {
    padding: 10px 14px;
    font-weight: 700;
    font-size: .9rem;
    border-bottom: 1px solid #eee;
    background: #f8f8ff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.ped-tree-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px 14px;
}

/* Tree list */
.ped-tree-list {
    list-style: none;
    padding: 0 0 0 18px;
    margin: 0;
    border-left: 2px solid #e0d8ff;
}

.ped-tree-list > li:first-child { margin-top: 4px; }

.ped-tree-node {
    margin: 3px 0;
    border-radius: 6px;
    transition: background .15s;
}

.ped-tree-node--active > .ped-tree-row {
    background: #6C5CE7;
    color: #fff;
    border-radius: 6px;
}

.ped-tree-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 6px;
    font-size: .88rem;
    transition: background .12s;
}

.ped-tree-row:hover { background: #f0eeff; }

.ped-tree-node--active > .ped-tree-row:hover { background: #5a4bd1; }

.ped-move-label { font-weight: 700; flex: 1; }

.ped-points-badge {
    font-size: .72rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    background: #fdcb6e;
    color: #2d3436;
}

.ped-tree-actions {
    display: flex;
    gap: 2px;
    padding: 0 8px 2px;
    opacity: 0;
    transition: opacity .15s;
}

.ped-tree-node:hover .ped-tree-actions { opacity: 1; }

.ped-act-btn {
    font-size: .75rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: #f0eeff;
    border: 1px solid #d8d0ff;
    cursor: pointer;
    transition: background .12s;
}

.ped-act-btn:hover { background: #d8d0ff; }

.ped-act-btn--del { background: #fff0f0; border-color: #ffcdd2; }
.ped-act-btn--del:hover { background: #ffcdd2; }

/* Mobile: stack columns */
@media (max-width: 680px) {
    .pro-editor-body { flex-direction: column; }
    .pro-editor-left { border-right: none; border-bottom: 1px solid #eee; }
    .pro-editor-panel { width: 100%; }
}

/* ══════════════════════════════════════════════════════════
   USER — PRO PUZZLE SOLVER
   ══════════════════════════════════════════════════════════ */

.pro-solver-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    font-size: 1.1rem;
    color: #636E72;
}

.pro-solver-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(108,92,231,.12);
    max-width: 860px;
    margin: 0 auto;
}

/* Header */
.pro-solver-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #6C5CE7, #5a4bd1);
    color: #fff;
    gap: 12px;
    flex-wrap: wrap;
}

.pro-solver-title { font-size: 1rem; }

.pro-solver-meta { display: flex; gap: 8px; align-items: center; }

.pro-badge {
    font-size: .75rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
}

.pro-badge--pts {
    background: #fdcb6e;
    color: #2d3436;
    border-color: #f0b429;
}

/* Body */
.pro-solver-body {
    display: flex;
    gap: 0;
    min-height: 480px;
}

/* Board column */
.pro-solver-board-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px;
    background: #fafafa;
    border-right: 1px solid #eee;
    flex-shrink: 0;
}

#psl-board-wrap {
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,.14);
}

/* Nav controls */
.pro-solver-nav {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.psl-turn-label {
    font-size: .82rem;
    font-weight: 700;
    color: #6C5CE7;
    padding: 4px 10px;
    border-radius: 8px;
    background: #f0eeff;
    border: 1px solid #d8d0ff;
}

/* Submit area */
.pro-solver-submit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    max-width: 400px;
}

.psl-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #6C5CE7, #00b894);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    padding: 12px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 4px 14px rgba(108,92,231,.3);
}

.psl-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(108,92,231,.4);
}

.psl-submit-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* Sidebar */
.pro-solver-sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.psl-sidebar-header {
    padding: 10px 14px;
    font-weight: 700;
    font-size: .88rem;
    border-bottom: 1px solid #eee;
    background: #f8f8ff;
    flex-shrink: 0;
}

.psl-movelist {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    font-size: .88rem;
}

/* Move line */
.psl-moveline { line-height: 2; }

.psl-move-num {
    color: #b2bec3;
    font-weight: 700;
    font-size: .8rem;
    margin-right: 2px;
}

.psl-move {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 5px;
    font-weight: 700;
    cursor: default;
    margin-right: 2px;
    background: #f0eeff;
    color: #6C5CE7;
    transition: background .12s;
}

.psl-move--correct {
    background: #d4edda;
    color: #155724;
}

.psl-move--wrong {
    background: #f8d7da;
    color: #721c24;
}

/* Result panel */
.psl-result-panel {
    padding: 14px;
    border-top: 1px solid #eee;
    background: #fafafa;
    flex-shrink: 0;
}

.psl-result-score {
    font-size: 1.4rem;
    font-weight: 800;
    color: #6C5CE7;
    margin-bottom: 4px;
}

.psl-result-pct {
    font-size: .85rem;
    color: #636E72;
    margin-bottom: 10px;
}

.psl-result-breakdown { display: flex; flex-direction: column; gap: 4px; }

.psl-rb {
    font-size: .82rem;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
}

.psl-rb--ok   { background: #d4edda; color: #155724; }
.psl-rb--err  { background: #f8d7da; color: #721c24; }
.psl-rb--miss { background: #fff3cd; color: #856404; }

/* Mobile: stack */
@media (max-width: 680px) {
    .pro-solver-body { flex-direction: column; }
    .pro-solver-board-col { border-right: none; border-bottom: 1px solid #eee; }
}

/* ══════════════════════════════════════════════════════════
   PRO PUZZLE SETS LIST (inside /puzzles page)
   ══════════════════════════════════════════════════════════ */

.pro-set-card {
    background: linear-gradient(135deg, #6C5CE7 0%, #5a4bd1 100%);
    color: #fff;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 4px 16px rgba(108,92,231,.25);
    position: relative;
    overflow: hidden;
}

.pro-set-card::before {
    content: '🏆';
    position: absolute;
    right: 12px;
    top: 10px;
    font-size: 2rem;
    opacity: .2;
}

.pro-set-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(108,92,231,.35);
}

.pro-set-card .pro-set-name { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.pro-set-card .pro-set-meta { font-size: .78rem; opacity: .8; }
.pro-set-card .pro-set-count { font-size: .82rem; opacity: .9; margin-top: 6px; }

/* Pro mode button in mode selector */
.cbc-mode-btn--pro {
    --mode-color: #6C5CE7;
}
