/* ── THOP Explorer Notes — Popup Modal ── */

/* Trigger Button */
.thop-notes-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1e1e2e;
    color: #c5c5ff;
    border: 1px solid #3a3a6a;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, border-color .2s;
    font-family: inherit;
    letter-spacing: .01em;
}

.thop-notes-trigger:hover {
    background: #2a2a4a;
    border-color: #5c5caa;
    color: #e0e0ff;
}

.thop-notes-trigger .thop-trigger-icon { font-size: 1rem; }

.thop-notes-trigger .thop-trigger-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #555;
    margin-left: 2px;
    transition: background .2s;
}

.thop-notes-trigger.has-note .thop-trigger-dot { background: #4caf50; }

/* Overlay */
.thop-notes-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    z-index: 99998;
    backdrop-filter: blur(3px);
}

.thop-notes-overlay.active { display: block; }

/* Modal */
.thop-notes-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%) scale(.96);
    opacity: 0;
    z-index: 99999;
    width: 480px;
    max-width: calc(100vw - 32px);
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,.7);
    font-family: inherit;
    transition: transform .22s cubic-bezier(.34,1.56,.64,1), opacity .18s ease;
}

.thop-notes-modal.active {
    display: block;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* Modal Header */
.thop-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1e1e2e;
    border-bottom: 1px solid #2a2a3a;
    padding: 14px 18px;
}

.thop-modal-icon { font-size: 1.15rem; }

.thop-modal-title {
    font-weight: 700;
    font-size: .95rem;
    color: #e0e0ff;
    flex: 1;
}

.thop-modal-badge {
    font-size: .65rem;
    font-weight: 700;
    color: #9c9cff;
    background: #2a2a4a;
    border-radius: 20px;
    padding: 2px 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
    border: 1px solid #3a3a6a;
}

.thop-modal-close {
    background: none;
    border: none;
    color: #666;
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 0 0 10px;
    transition: color .15s;
}
.thop-modal-close:hover { color: #ccc; }

/* Textarea */
.thop-notes-modal textarea {
    width: 100%;
    min-height: 160px;
    border: none;
    outline: none;
    resize: vertical;
    padding: 16px 18px;
    font-size: .9rem;
    color: #ccc;
    background: #141414;
    line-height: 1.7;
    box-sizing: border-box;
    font-family: inherit;
}

.thop-notes-modal textarea::placeholder {
    color: #484848;
    font-style: italic;
}

.thop-notes-modal textarea::-webkit-scrollbar { width: 4px; }
.thop-notes-modal textarea::-webkit-scrollbar-track { background: #1a1a1a; }
.thop-notes-modal textarea::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }

/* Footer */
.thop-modal-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-top: 1px solid #2a2a2a;
    background: #181818;
}

.thop-modal-char {
    font-size: .76rem;
    color: #555;
    flex: 1;
    font-variant-numeric: tabular-nums;
}

.thop-modal-status {
    font-size: .82rem;
    font-weight: 600;
    min-width: 70px;
    text-align: center;
    transition: opacity .3s;
}
.thop-modal-status.saved  { color: #4caf50; }
.thop-modal-status.error  { color: #ef5350; }
.thop-modal-status.saving { color: #888; }

.thop-modal-save-btn {
    background: #e53935;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 22px;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .1s;
    letter-spacing: .02em;
    font-family: inherit;
}
.thop-modal-save-btn:hover   { background: #c62828; }
.thop-modal-save-btn:active  { transform: scale(.97); }
.thop-modal-save-btn:disabled { background: #555; cursor: default; }

/* Login prompt inside modal */
.thop-notes-modal .thop-modal-login {
    padding: 32px 24px;
    text-align: center;
    color: #777;
    font-size: .9rem;
}
.thop-notes-modal .thop-modal-login a { color: #e53935; font-weight: 600; text-decoration: none; }
