.tool-workspace {
    display: flex;
    justify-content: center;
    align-items: stretch;
    min-height: 70vh;
    padding-bottom: 2rem;
}

.tool-panel {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.regex-inputs {
    display: flex;
    gap: 1rem;
}

.input-group {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0 1rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.3);
}

.regex-pattern-group {
    flex: 1;
}

.regex-flags-group {
    width: 100px;
}

.regex-slash {
    color: var(--text-muted);
    font-size: 1.2rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: bold;
    user-select: none;
}

.input-group input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1rem 0.5rem;
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
}

.input-group input:focus {
    outline: none;
}

.regex-status {
    font-size: 0.9rem;
    font-weight: 500;
}
.regex-status.error {
    color: #ef4444;
}

/* Editor with Highlights */
.editor-container {
    position: relative;
    height: 350px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.editor-backdrop, #test-string {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 1rem;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.editor-backdrop {
    color: transparent;
    overflow-y: auto;
    z-index: 1;
}

#test-string {
    color: var(--text-main);
    z-index: 2;
    caret-color: var(--text-main);
    resize: none;
}

#test-string:focus {
    outline: none;
}

/* Highlight styling */
mark {
    background-color: rgba(139, 92, 246, 0.5); /* Primary Accent Glow */
    border-radius: 2px;
    color: transparent;
}

/* Scrollbar sync hack */
#test-string::-webkit-scrollbar {
    width: 8px;
}
#test-string::-webkit-scrollbar-track {
    background: transparent;
}
#test-string::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* Match Results */
.match-results {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.match-results h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.match-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.match-list li {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    border-left: 3px solid var(--accent-primary);
}
