/* =============================================================================
   9UY REGEX — styles.css
   ============================================================================= */

/* ---- Suite base ---------------------------------------------------------- */
.block-cursor {
    display: inline-block;
    width: 0.6ch;
    height: 0.9em;
    background: #ffffff;
    vertical-align: middle;
    margin-left: 4px;
    animation: cursor-blink 1s step-end infinite;
}
@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50%        { opacity: 0; }
}

.scanline {
    width: 100%;
    height: 100px;
    z-index: 1000;
    background: linear-gradient(0deg, transparent 0%, rgba(255,255,255,0.02) 50%, transparent 100%);
    opacity: 0.1;
    position: fixed;
    top: -100px;
    left: 0;
    pointer-events: none;
    animation: scanline 10s linear infinite;
}
@keyframes scanline {
    to { top: 100vh; }
}

.deck-link {
    transition: color 0.1s ease, transform 0.1s ease;
}
.deck-link:hover { color: #fff; transform: scale(1.05); }
.deck-link:active { transform: scale(0.95); }

::selection { background: #fff; color: #000; }

/* ---- Pattern bar --------------------------------------------------------- */
.pattern-wrap {
    display: flex;
    align-items: stretch;
    background: #0a0a0a;
    border: 1px solid #262626;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.15s;
}
.pattern-wrap:focus-within { border-color: #6b7280; }
.pattern-wrap.error { border-color: #ef4444; }

.pattern-slash {
    display: flex;
    align-items: center;
    padding: 0 10px;
    color: #4b5563;
    font-size: 18px;
    font-weight: 300;
    user-select: none;
    flex-shrink: 0;
}

#pattern-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #f3f4f6;
    font-family: ui-monospace, monospace;
    font-size: 15px;
    padding: 10px 0;
    caret-color: #fff;
    min-width: 0;
}
#pattern-input::placeholder { color: #374151; }

/* ---- Flag buttons -------------------------------------------------------- */
.flag-btn {
    padding: 0 10px;
    font-family: ui-monospace, monospace;
    font-size: 12px;
    font-weight: 700;
    color: #4b5563;
    background: transparent;
    border: none;
    border-left: 1px solid #1f2937;
    cursor: pointer;
    transition: color 0.1s, background 0.1s;
    letter-spacing: 0.05em;
    user-select: none;
}
.flag-btn:hover { color: #d1d5db; background: #171717; }
.flag-btn.active { color: #fff; background: #1f2937; }

/* ---- Error / warning ----------------------------------------------------- */
.error-msg {
    font-size: 10px;
    color: #ef4444;
    font-family: ui-monospace, monospace;
    letter-spacing: 0.05em;
    padding: 4px 2px;
    min-height: 18px;
}
.warn-msg {
    font-size: 10px;
    color: #f59e0b;
    font-family: ui-monospace, monospace;
    letter-spacing: 0.05em;
    padding: 4px 2px;
}

/* ---- Test textarea ------------------------------------------------------- */
#test-input {
    width: 100%;
    background: #0a0a0a;
    border: 1px solid #262626;
    border-radius: 6px;
    color: #e5e7eb;
    font-family: ui-monospace, monospace;
    font-size: 13px;
    line-height: 1.7;
    padding: 12px 14px;
    resize: vertical;
    min-height: 180px;
    outline: none;
    transition: border-color 0.15s;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}
#test-input:focus { border-color: #6b7280; }
#test-input::placeholder { color: #374151; }

/* ---- Highlighted output -------------------------------------------------- */
#highlight-output {
    width: 100%;
    background: #0a0a0a;
    border: 1px solid #262626;
    border-radius: 6px;
    color: #e5e7eb;
    font-family: ui-monospace, monospace;
    font-size: 13px;
    line-height: 1.7;
    padding: 12px 14px;
    min-height: 180px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    cursor: default;
}

/* Match highlight styles */
.match-hl {
    background: rgba(251, 191, 36, 0.2);
    border-bottom: 2px solid #fbbf24;
    color: #fef3c7;
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.1s;
}
.match-hl:hover { background: rgba(251, 191, 36, 0.35); }
.match-hl.active {
    background: rgba(251, 191, 36, 0.45);
    border-bottom-color: #f59e0b;
    color: #fff;
    font-weight: 700;
}

/* ---- Match count badge --------------------------------------------------- */
.match-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 3px;
}
.match-badge.has-matches {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}
.match-badge.no-matches {
    background: #171717;
    color: #4b5563;
    border: 1px solid #262626;
}

/* ---- Match list ---------------------------------------------------------- */
#match-list {
    transition: max-height 0.3s ease, opacity 0.25s ease;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
}
#match-list.open {
    max-height: 600px;
    opacity: 1;
    overflow-y: auto;
}
.match-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    border: 1px solid #1f2937;
    border-radius: 5px;
    cursor: pointer;
    transition: border-color 0.1s, background 0.1s;
    background: #0a0a0a;
}
.match-item:hover { border-color: #374151; background: #111; }
.match-item.active { border-color: #fbbf24; background: rgba(251, 191, 36, 0.05); }
.match-idx {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #4b5563;
}
.match-text {
    font-family: ui-monospace, monospace;
    font-size: 12px;
    color: #fef3c7;
    word-break: break-all;
}
.match-pos {
    font-size: 9px;
    color: #374151;
    font-family: ui-monospace, monospace;
}
.group-row {
    font-size: 10px;
    color: #6b7280;
    font-family: ui-monospace, monospace;
    padding-left: 8px;
    border-left: 2px solid #262626;
    margin-top: 2px;
}
.group-row span { color: #d1d5db; }

/* ---- Mode toggle --------------------------------------------------------- */
.mode-btn {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 3px;
    cursor: pointer;
    color: #4b5563;
    background: transparent;
    border: 1px solid transparent;
    transition: color 0.1s, background 0.1s, border-color 0.1s;
}
.mode-btn:hover { color: #d1d5db; border-color: #374151; }
.mode-btn.active { color: #fff; background: #1f2937; border-color: #374151; }

/* ---- Replacement input --------------------------------------------------- */
#replace-input {
    width: 100%;
    background: #0a0a0a;
    border: 1px solid #262626;
    border-radius: 6px;
    color: #e5e7eb;
    font-family: ui-monospace, monospace;
    font-size: 13px;
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.15s;
}
#replace-input:focus { border-color: #6b7280; }
#replace-input::placeholder { color: #374151; }

/* ---- Replace preview ----------------------------------------------------- */
#replace-preview {
    background: #0a0a0a;
    border: 1px solid #262626;
    border-radius: 6px;
    color: #d1d5db;
    font-family: ui-monospace, monospace;
    font-size: 13px;
    line-height: 1.7;
    padding: 12px 14px;
    white-space: pre-wrap;
    word-break: break-all;
    min-height: 60px;
}

/* ---- Action buttons ------------------------------------------------------ */
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #4b5563;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 2px;
    transition: color 0.1s;
}
.action-btn:hover { color: #fff; }
.action-btn.copied { color: #4ade80; }

/* ---- Scrollbar ----------------------------------------------------------- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1f2937; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #374151; }
